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
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

---

Expand All @@ -36,43 +41,42 @@ 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

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.
Expand All @@ -85,21 +89,21 @@ 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

# send a transaction from one account to another
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

Expand All @@ -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
```
Expand Down
62 changes: 55 additions & 7 deletions docs/SYSTEM_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

# 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
```
3 changes: 3 additions & 0 deletions scripts/bump_localic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" {} \;
2 changes: 1 addition & 1 deletion spawn/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my Windows dell machine is very slow, and I did not see an output. So thought it was broken. nice to have for older hardware

logger.Debug("NewChain Disabled features", "features", cfg.DisabledModules)

if err := os.MkdirAll(NewDirName, 0755); err != nil {
Expand Down
9 changes: 8 additions & 1 deletion spawn/version_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better for older machines

"spawn": "git clone https://github.com/rollchains/spawn.git && cd spawn && git checkout __VERSION__ && make install",
}
BinaryToGithubAPI = map[string]string{
Expand Down Expand Up @@ -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",
Expand Down