diff --git a/Makefile b/Makefile index ccae4ad6..5246033e 100644 --- a/Makefile +++ b/Makefile @@ -51,8 +51,12 @@ get-heighliner: get-localic: @echo "Installing local-interchain" - git clone --branch v8.7.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader - cd interchaintest-downloader/local-interchain && make install +# git clone --branch v8.7.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader +# cd interchaintest-downloader/local-interchain && make install + wget https://github.com/strangelove-ventures/interchaintest/releases/download/v8.7.0/local-ic + chmod +x local-ic + mv local-ic $(shell go env GOPATH)/bin + @sleep 0.1 @echo ✅ local-interchain installed $(shell which local-ic) .PHONY: get-heighliner diff --git a/README.md b/README.md index 0c48719a..8e3cbb18 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,13 @@ https://github.com/rollchains/spawn/assets/31943163/ecc21ce4-c42c-4ff2-8e73-897c - [`go 1.22+`](https://go.dev/doc/install) - [`Docker`](https://docs.docker.com/get-docker/) +- [`git`](https://git-scm.com/) -[MacOS + Ubuntu Setup](./docs/SYSTEM_SETUP.md) +## System Setup + +* [MacOS](./docs/SYSTEM_SETUP.md#macos-setup) +* [Ubuntu](./docs/SYSTEM_SETUP.md#ubuntu-setup) +* [Windows](./docs/SYSTEM_SETUP.md#windows-setup) --- @@ -36,7 +41,7 @@ In this tutorial, we'll create and interact with a new Cosmos-SDK blockchain cal 1. Clone this repo and install -```shell +```bash git clone https://github.com/rollchains/spawn.git cd spawn git checkout v0.50.7 @@ -44,35 +49,34 @@ git checkout v0.50.7 make install make get-localic -# If you get "command 'spawn' not found", make sure to add go to your path -# Run the following in your terminal to test, then add to your ~/.bashrc or similar +# If you get "command 'spawn' not found", add to path +# Run the following in your terminal to test +# Then add to ~/.bashrc (linux) or ~/.zshrc (mac) export PATH="$PATH:$(go env GOPATH)/bin" +echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bashrc ``` 2. Create your chain using the `spawn` command and customize it to your needs! -```shell +```bash GITHUB_USERNAME=rollchains -# Available Features: -# * tokenfactory,globalfee,ibc-packetforward,ibc-ratelimit,cosmwasm,wasm-light-client,optimistic-execution,ignite-cli,block-explorer - +# If the `--consensus` or `--disabled` flags are not present, +# a selector UI will appear in your terminal to see all options. spawn new rollchain \ ---consensus=proof-of-authority `# proof-of-authority,proof-of-stake,interchain-security` \ ---bech32=roll `# the prefix for addresses` \ ---denom=uroll `# the coin denomination to create` \ ---bin=rolld `# the name of the binary` \ ---disabled=cosmwasm,globalfee,block-explorer `# disable features.` \ ---org=${GITHUB_USERNAME} `# the github username or organization to use for the module imports, optional` - - +--consensus=proof-of-authority \ +--bech32=roll \ +--denom=uroll \ +--bin=rolld \ +--disabled=cosmwasm,globalfee,block-explorer \ +--org=${GITHUB_USERNAME} ``` > *NOTE:* `spawn` creates a ready to use repository complete with `git` and GitHub CI. It can be quickly pushed to a new repository getting you and your team up and running quickly. 3. Spin up a local testnet for your chain -```shell +```bash cd rollchain # Starts 2 networks for the IBC testnet at http://127.0.0.1:8080. @@ -85,7 +89,7 @@ make testnet 4. Open a new terminal window and send a transaction on your new chain -```shell +```bash # list the keys that have been provisioned with funds in genesis rolld keys list @@ -93,13 +97,13 @@ rolld keys list rolld tx bank send acc0 $(rolld keys show acc1 -a) 1337uroll --chain-id=localchain-1 # enter "y" to confirm the transaction -# then query your balances tfor proof the transaction executed successfully +# then query your balances for proof the transaction executed successfully rolld q bank balances $(rolld keys show acc1 -a) ``` 5. (optional) Send an IBC transaction -```shell +```bash # submit a cross chain transfer from acc0 to the other address rolld tx ibc-transfer transfer transfer channel-0 cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr 7uroll --from=acc0 --chain-id=localchain-1 --yes @@ -114,7 +118,7 @@ local-ic interact localcosmos-1 query 'bank balances cosmos1hj5fveer5cjtn4wd6wst 6. Push your new chain to a github repository -```shell +```bash # Create a new repository on GitHub from the gh cli gh repo create rollchain --source=. --remote=upstream --push --private ``` diff --git a/docs/SYSTEM_SETUP.md b/docs/SYSTEM_SETUP.md index b8ba4868..dfe628f4 100644 --- a/docs/SYSTEM_SETUP.md +++ b/docs/SYSTEM_SETUP.md @@ -14,24 +14,72 @@ brew install go # Docker brew install docker + +# Continue to main README.md to install spawn & local-ic +``` + +# Windows Setup + +```bash +# Install WSL in powershell +wsl --install +Restart-Computer + +# Setup WSL Ubuntu Image +wsl.exe --install Ubuntu-24.04 + +# Open wsl instance +wsl + +# update and add snap if not already installed +sudo apt update && sudo apt install snapd + +# Install Go (Snap) +sudo snap info go +sudo snap install go --channel=1.23/stable --classic + +# Install Basics +sudo apt install make gcc git jq + +# Install github-cli +sudo snap install gh + +# Install docker +https://docs.docker.com/desktop/wsl/#turn-on-docker-desktop-wsl-2 +# or snap: +sudo snap install docker + +# Fix versioning for interaction of commands +sudo chmod 666 /var/run/docker.sock + +# Setup base github config +git config --global user.email "yourEmail@gmail.com" +git config --global user.name "Your Name" + +# Continue to main README.md to install spawn & local-ic ``` -# Ubuntu +# Ubuntu Setup ```bash # Base -sudo apt-get install make gcc +sudo apt install make gcc git # Github CLI - https://github.com/cli/cli curl -sS https://webi.sh/gh | sh gh auth login # Golang -wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz -sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz -echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc -export PATH=$PATH:/usr/local/go/bin +GO_VERSION=1.23.0 +wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz +sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz # Docker sudo apt -y install docker.io -``` \ No newline at end of file + +# Setup base github config +git config --global user.email "yourEmail@gmail.com" +git config --global user.name "Your Name" + +# Continue to main README.md to install spawn & local-ic +``` diff --git a/scripts/bump_localic.sh b/scripts/bump_localic.sh index 362e56cb..0548d48a 100644 --- a/scripts/bump_localic.sh +++ b/scripts/bump_localic.sh @@ -10,3 +10,6 @@ find . -type f -name "Dockerfile" -exec sed -i "s/v[0-9]\.[0-9]\.[0-9]\/local-ic GIT_REPO="https://github.com/strangelove-ventures/interchaintest" GIT_REPO=$(echo $GIT_REPO | sed 's/\//\\\//g') # https:\/\/github.com\/strangelove-ventures\/interchaintest find . -type f -name "Makefile" -exec sed -i "s/v[0-9]\.[0-9]\.[0-9] $GIT_REPO/$NEW_VERSION $GIT_REPO/g" {} \; + +# replace https://github.com/strangelove-ventures/interchaintest/releases/download/v8.7.0/local-ic in makefile +find . -type f -name "Makefile" -exec sed -i "s/https:\/\/github.com\/strangelove-ventures\/interchaintest\/releases\/download\/v[0-9]\.[0-9]\.[0-9]\/local-ic/https:\/\/github.com\/strangelove-ventures\/interchaintest\/releases\/download\/$NEW_VERSION\/local-ic/g" {} \; diff --git a/spawn/cfg.go b/spawn/cfg.go index c9049e40..0057bbdc 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -166,7 +166,7 @@ func (cfg *NewChainConfig) CreateNewChain() error { // Set proper pairings for modules to be disabled if others are enabled cfg.SetProperFeaturePairs() - logger.Debug("Spawning new app", "app", NewDirName) + logger.Info("Spawning new app", "name", NewDirName) logger.Debug("NewChain Disabled features", "features", cfg.DisabledModules) if err := os.MkdirAll(NewDirName, 0755); err != nil { diff --git a/spawn/version_check.go b/spawn/version_check.go index 0b446618..de8e4acc 100644 --- a/spawn/version_check.go +++ b/spawn/version_check.go @@ -17,7 +17,7 @@ import ( var ( RunCheckInterval = 24 * time.Hour howToInstallBinary = map[string]string{ - "local-ic": "git clone https://github.com/strangelove-ventures/interchaintest.git && cd interchaintest/local-interchain && git checkout __VERSION__ && make install", + "local-ic": "wget https://github.com/strangelove-ventures/interchaintest/releases/download/__VERSION__/local-ic && mv local-ic $HOME/go/bin && chmod +x $HOME/go/bin/local-ic", "spawn": "git clone https://github.com/rollchains/spawn.git && cd spawn && git checkout __VERSION__ && make install", } BinaryToGithubAPI = map[string]string{ @@ -150,7 +150,14 @@ func WhereIsBinInstalled(binName string) string { // OutOfDateCheckLog logs & returns true if it is out of date. func OutOfDateCheckLog(logger *slog.Logger, binName, current, latest string) bool { + + if current == "" { + logger.Error("Could not find "+binName+" binary", "install", GetInstallMsg(howToInstallBinary[binName], latest)) + return true + } + isOutOfDate := semver.Compare(current, latest) < 0 + if isOutOfDate { logger.Error( "New "+binName+" version available",