diff --git a/Makefile b/Makefile index 6ff99dc8..2e6a5987 100644 --- a/Makefile +++ b/Makefile @@ -45,17 +45,15 @@ run: ## get-heighliner: Install the cosmos docker utility. get-heighliner: @echo ⏳ Installing heighliner... - git clone https://github.com/strangelove-ventures/heighliner.git + git clone --depth 1 https://github.com/strangelove-ventures/heighliner.git cd heighliner && go install + @sleep 0.1 @echo ✅ heighliner installed to $(shell which 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 - 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 + git clone --depth 1 --branch v8.7.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader + cd interchaintest-downloader/local-interchain && make install @sleep 0.1 @echo ✅ local-interchain installed $(shell which local-ic) diff --git a/README.md b/README.md index 7dc17eab..ed7721fe 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ If you do not have [`go 1.22+`](https://go.dev/doc/install), [`Docker`](https:// ```bash # Download the the Spawn repository -git clone https://github.com/rollchains/spawn.git --depth=1 --branch v0.50.7 +git clone https://github.com/rollchains/spawn.git --depth=1 --branch v0.50.8 cd spawn # Install Spawn @@ -53,6 +53,6 @@ In this 4 minute demo we: - Build and launch a chain locally - Interact with the chain's nameservice logic, settings a name, and retrieving it -[Follow Along with the nameservice demo](https://rollchains.github.io/spawn/v0.50/build/name-service/) | [source](./docs/versioned_docs/version-v0.50.x/02-build-your-chain/01-nameservice.md) +[Follow Along with the nameservice demo](https://rollchains.github.io/spawn/v0.50/build/name-service/) | [source](./docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md) https://github.com/rollchains/spawn/assets/31943163/ecc21ce4-c42c-4ff2-8e73-897c0ede27f0 diff --git a/cmd/spawn/module_test.go b/cmd/spawn/module_test.go index 59f3eb86..3d48c13e 100644 --- a/cmd/spawn/module_test.go +++ b/cmd/spawn/module_test.go @@ -36,11 +36,11 @@ func TestModuleGeneration(t *testing.T) { mcs := []mc{ { - Name: "ibcmodule", + Name: "iibcmid", Args: []string{"new", "myibc", "--ibc-module"}, }, { - Name: "ibcmiddleware", + Name: "iibcmod", Args: []string{"new", "myibcmw", "--ibc-middleware"}, }, { diff --git a/docs/versioned_docs/version-v0.50.x/00-meet-spawn.md b/docs/versioned_docs/version-v0.50.x/00-meet-spawn.md index a932dba4..c1b49946 100644 --- a/docs/versioned_docs/version-v0.50.x/00-meet-spawn.md +++ b/docs/versioned_docs/version-v0.50.x/00-meet-spawn.md @@ -13,6 +13,6 @@ Spawn is the easiest way to build, maintain and scale a Cosmos SDK blockchain. S ## NameService Demo -[Follow Along with the NameService demo](../version-v0.50.x/02-build-your-chain/01-nameservice.md) +[Follow Along with the NameService demo](../version-v0.50.x/02-build-your-application/01-nameservice.md) diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md index cd83c05b..b823d4fa 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md @@ -42,8 +42,8 @@ sudo apt update && sudo apt install snapd sudo snap info go sudo snap install go --channel=1.23/stable --classic -# Install Basics -sudo apt install make gcc git jq +# Install Base +sudo apt install make gcc git jq wget # Install github-cli sudo snap install gh @@ -56,7 +56,7 @@ sudo snap install docker # Fix versioning for interaction of commands sudo chmod 666 /var/run/docker.sock -# Setup base github config +# Setup base git config git config --global user.email "yourEmail@gmail.com" git config --global user.name "Your Name" ``` @@ -68,6 +68,8 @@ git config --global user.name "Your Name" # Base brew install make brew install gcc +brew install wget +brew install jq # Github CLI - https://github.com/cli/cli brew install gh @@ -77,9 +79,12 @@ gh auth login brew install go # Docker -brew install docker +brew install --cask docker +open -a Docker # start docker desktop +# settings -> General -> Start Docker Desktop when you sign in to your computer +# Apply & Restart -# Setup base github config +# Setup base git config git config --global user.email "yourEmail@gmail.com" git config --global user.name "Your Name" ``` @@ -89,9 +94,9 @@ git config --global user.name "Your Name" ```bash # Base -sudo apt install make gcc git +sudo apt install make gcc git jq wget -# Github CLI - https://github.com/cli/cli +# (optional) Github CLI - https://github.com/cli/cli curl -sS https://webi.sh/gh | sh gh auth login @@ -103,7 +108,7 @@ sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd # Docker sudo apt -y install docker.io -# Setup base github config +# Setup base git config git config --global user.email "yourEmail@gmail.com" git config --global user.name "Your Name" ``` diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md b/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md index 54af7780..2362451c 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md @@ -19,7 +19,7 @@ Install Spawn from source. ```bash # Install from latest source -git clone https://github.com/rollchains/spawn.git --depth 1 --branch v0.50.7 +git clone https://github.com/rollchains/spawn.git --depth 1 --branch v0.50.8 # Change to this directory cd spawn diff --git a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md index b7bd356a..bc8f0393 100644 --- a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md +++ b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md @@ -7,16 +7,16 @@ slug: /demo/ibc-module # IBC NameService Module -In this tutorial, you will build on the [nameservice tutorial](../02-build-your-chain/01-nameservice.md) to add cross chain functionality. This will allow you to sent a name from another network. +In this section, you will build on top of the Service tutorial to add cross chain functionality. This will allow you to sent a name from another network. ## Prerequisites - [System Setup](../01-setup/01-system-setup.md) - [Install Spawn](../01-setup/02-install-spawn.md) -- [Build Your Name Service Chain Turotial](../02-build-your-chain/01-nameservice.md) +- [Build Your Name Service Chain Tutorial](../02-build-your-application/01-nameservice.md) ## Create your chain -You should already have a network, `rollchain`, with the nameservice module from the [nameservice tutorial](../02-build-your-chain/01-nameservice.md). If you do not, complete that tutorial now. +You should already have a network, `rollchain`, with the nameservice module from the nameservice tutorial. If you do not, complete that tutorial now. :::note warning Make sure you do not have the previous testnet still running by stopping it with: `killall -9 rolld` @@ -158,7 +158,7 @@ You could just as easily write the NameMapping in the ibc keeper store as well. make install # verify the binary works. if you get a panic, -# `make proto-gen`, then re make install +# `make proto-gen`, then re `make install` rolld # build docker image @@ -177,7 +177,9 @@ The source is publicly available on GitHub to review. It gives you the ability t ```bash # Import the testnet interaction helper functions # for local-interchain -source <(curl -s https://raw.githubusercontent.com/strangelove-ventures/interchaintest/main/local-interchain/bash/source.bash) +curl -s https://raw.githubusercontent.com/strangelove-ventures/interchaintest/main/local-interchain/bash/source.bash > ict_source.bash +source ./ict_source.bash + API_ADDR="http://localhost:8080" # Waits for the testnet to start @@ -219,3 +221,16 @@ rolld q tx 8A2009667022BE432B60158498C2256AEED0E86E9DFF79BD11CC9EA70DEC4A8A # `rolld keys show -a acc0` from chain-1 ICT_QUERY "http://localhost:8080" "localchain-2" "nameservice resolve roll1hj5fveer5cjtn4wd6wstzugjfdxzl0xpg2te87" ``` + +## Summary + +You just build an IBC module that interacts with your other nameservice module! It allowed you to set your name from a different network entirely and securely with IBC. + +## What you Learned + +* Scaffolding ab IBC module +* Importing another module +* Adding business logic for an IBC request +* Connecting two chains with a custom IBC protocol +* Sending your first IBC packet from chain A +* Processing the packet on chain B and verifying it was set diff --git a/scripts/matrix_generator.py b/scripts/matrix_generator.py index 79c32a5f..991802a2 100644 --- a/scripts/matrix_generator.py +++ b/scripts/matrix_generator.py @@ -187,7 +187,19 @@ def main(): f"u{random_string(5, True)}", random_string(10, True), ) - .set_custom_modules([f"{random_string(6, True)}" for _ in range(10)]) + .set_custom_modules([f"{random_string(6, True)}" for _ in range(5)] + [f"{random_string(6, True)} --ibc-module" for _ in range(5)] + [f"{random_string(6, True)} --ibc-middleware" for _ in range(10)]) + .set_with_local_unit_test() + .build(), + CmdCreator( + "poswithwithibctest", + POS, + [], + random_string(5, True), + f"{random_string(6, True)}", + f"u{random_string(5, True)}", + random_string(10, True), + ) + .set_custom_modules(["nsibc --ibc-module"]) .set_with_local_unit_test() .build(), ] diff --git a/simapp/Makefile b/simapp/Makefile index f814743d..1d207ba9 100644 --- a/simapp/Makefile +++ b/simapp/Makefile @@ -226,6 +226,7 @@ get-localic: @echo "Installing local-interchain" git clone --depth 1 --branch v8.7.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader cd interchaintest-downloader/local-interchain && make install + @sleep 0.1 @echo ✅ local-interchain installed $(shell which local-ic) is-localic-installed: @@ -234,8 +235,11 @@ ifeq (,$(shell which local-ic)) endif get-heighliner: - git clone https://github.com/strangelove-ventures/heighliner.git + @echo ⏳ Installing heighliner... + git clone --depth 1 https://github.com/strangelove-ventures/heighliner.git cd heighliner && go install + @sleep 0.1 + @echo ✅ heighliner installed to $(shell which heighliner) local-image: ifeq (,$(shell which heighliner)) diff --git a/simapp/contrib/devtools/README.md b/simapp/contrib/devtools/README.md index 99225c1d..ee957103 100644 --- a/simapp/contrib/devtools/README.md +++ b/simapp/contrib/devtools/README.md @@ -3,4 +3,4 @@ Thanks to the entire Cosmos SDK team and the contributors who put their efforts into making simulation testing easier to implement. 🤗 -https://github.com/cosmos/cosmos-sdk/blob/v0.50.7/contrib/devtools/Makefile \ No newline at end of file +https://github.com/cosmos/cosmos-sdk/blob/v0.50.9/contrib/devtools/Makefile diff --git a/simapp/docker-compose.yml b/simapp/docker-compose.yml index 9754dfad..8fb9498a 100644 --- a/simapp/docker-compose.yml +++ b/simapp/docker-compose.yml @@ -11,8 +11,8 @@ services: image: pingpub:latest network_mode: "host" build: - context: pingpub - dockerfile: ./explorer/Dockerfile + context: explorer + dockerfile: ./Dockerfile volumes: - ./explorer/chains:/app/chains/ diff --git a/simapp/embed.go b/simapp/embed.go index 55dbccab..47843165 100644 --- a/simapp/embed.go +++ b/simapp/embed.go @@ -14,7 +14,7 @@ var SimAppFS embed.FS //go:embed interchaintest/* var ICTestFS embed.FS -//go:embed proto/* +//go:embed proto/example/* proto/ibcmiddleware/* proto/ibcmodule/* var ProtoModuleFS embed.FS //go:embed x/* diff --git a/spawn/cfg.go b/spawn/cfg.go index a2bd9a1b..790f9bb7 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -108,6 +108,13 @@ func (cfg *NewChainConfig) Validate() error { return types.ErrCfgProjSpecialChars } + // TODO(breaks): new chain named matrixposibcmodule && cd && spawn new nsibc --ibc-module moves in all template modules too + // Probably since it fines it in the import namespace, so when moving files it just coppies all over. + // The module.go `switch moduleName` is the culprit. + if strings.Contains(cfg.ProjectName, "ibcmodule") || strings.Contains(cfg.ProjectName, "ibcmiddleware") { + return fmt.Errorf("project name cannot contain 'ibcmodule' or 'ibcmiddleware'") + } + if cfg.GithubOrg == "" { return types.ErrCfgEmptyOrg }