Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions cmd/spawn/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-v0.50.x/00-meet-spawn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<video src="https://github.com/rollchains/spawn/assets/31943163/ecc21ce4-c42c-4ff2-8e73-897c0ede27f0" width="100%" height="100%" controls></video>
21 changes: 13 additions & 8 deletions docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
```
Expand All @@ -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
Expand All @@ -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"
```
Expand All @@ -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

Expand All @@ -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"
```
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 20 additions & 5 deletions docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
14 changes: 13 additions & 1 deletion scripts/matrix_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]
Expand Down
6 changes: 5 additions & 1 deletion simapp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion simapp/contrib/devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
https://github.com/cosmos/cosmos-sdk/blob/v0.50.9/contrib/devtools/Makefile
4 changes: 2 additions & 2 deletions simapp/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion simapp/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
7 changes: 7 additions & 0 deletions spawn/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down