Quick Start Guide
Set up a development environment and run the end to end test stack.
System Requirements
Ubuntu 22.04 LTS (Ubuntu 20.04 LTS should also work)
Development Tools
Utilities (
jq
,direnv
,sponge
,gcc
,g++
,build-essential
)
sudo apt install jq direnv moreutils gcc g++ build-essential
Install hooks for direnv
. Change this if you are using a different shell.
direnv hook bash >> .bashrc
source .bashrc
Install https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Install Node
cd core && nvm use
Install pnpm (https://pnpm.io/)
corepack enable
corepack prepare pnpm@7.14.2 --activate
sudo apt install -y git clang curl libssl-dev llvm libudev-dev make protobuf-compiler
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
rustup default stable
rustup update
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
cargo install typos-cli
Golang (https://go.dev/doc/install)
curl -LO https://go.dev/dl/go1.19.3.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz
# Add to ~/.profile to persist
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
Mage and Revive (https://magefile.org/, https://github.com/mgechev/revive#installation)
go install github.com/magefile/mage@latest
go install github.com/mgechev/revive@master
go install github.com/ethereum/go-ethereum/cmd/geth@latest
Setup
This guide uses the root of the $HOME/
folder for all source code.
Clone the https://github.com/paritytech/polkadot repo.
git clone -n https://github.com/paritytech/polkadot.git cd polkadot git checkout v0.9.30 cargo build --release
Clone the https://github.com/Snowfork/snowbridge repo.
git clone https://github.com/Snowfork/snowbridge.git
yarn
install dependencies.cd snowbridge (cd core && pnpm install)
Edit
.envrc
anddirenv allow
In the
web/packages/test
subfolder of thesnowbridge
repo copy the envrc-example.cp .envrc-example .envrc
Modify the
POLKADOT_BIN
variable in.envrc
to point to thepolkadot
binary. If you have checked out all source code to the$HOME
folder you can use the relative path below:export POLKADOT_BIN=../../../../polkadot/target/release/polkadot
Allow the variables to be automatically loaded by
direnv
direnv allow
In the
contracts
subfolder of thesnowbridge
repo copy the envrc-example. Here we do not need to edit the.envrc
as defaults are set.cp .envrc-example .envrc direnv allow
Running the E2E stack
Start up the local E2E test stack
In a separate terminal change directory to the web/packages/test
subfolder of the snowbridge
repo. Run start-services.sh
script to start the bridge.
scripts/start-services.sh
This script will:
Launch a local ethereum node (Geth & Lodestar)
Deploy contracts
Build and start the Snowbridge parachain
Configure the bridge
Start the relayers.
When this is complete Testnet has been initialized
will be printed to the terminal. The bridge will continue to run until cancelled by Ctrl+C
to kill the start-services.sh
script.
Bootstrap the bridge.
The bridge requires a certain amount of funds (SnowDOT and SnowETH) in order for Incentivized channels to be used. The bootstrap process are the first two test cases and needs to be run before other tests will pass.
In the
web/packages/test
subfolder of thesnowbridge
repo run the bootstrap tests:pnpm test:integration test/bootstrap.js
Inspecting the E2E environment
Ethereum
The ethereum data directory is
/tmp/snowbridge/geth
.The ethereum log file is
/tmp/snowbridge/geth.log
.The Lodestar log file is
/tmp/snowbridge/lodestar.log
.Relaychain
The relay chain log files are in the
web/packages/test
subdirectory of thesnowbridge
repo.alice.log
,bob.log
,charlie.log
The relay chain can be accessed via the polkadot.js web using the following url:
https://polkadot.js.org/apps/?rpc=ws%3A%2F%127.0.0.1%3A9944#/explorer
Parachain
The Snowbridge parachain log files are in the
web/packages/test
subdirectory of thesnowbridge
repo.11144.log
,11155.log
The Snowbridge parachain can be accessed via the polkadot.js web using the following url:
https://polkadot.js.org/apps/?rpc=ws%3A%2F%127.0.0.1%3A11144#/explorer
Test Parachain
The third-party test parachain log files are in the
web/packages/test
subdirectory of thesnowbridge
repo.13144.log
,13155.log
The Snowbridge Test parachain can be accessed via the polkadot.js web using the following url:
https://polkadot.js.org/apps/?rpc=ws%3A%2F%127.0.0.1%3A13144#/explorer
Relayers
The relayers log files can be found in the web/packages/test
subdirectory of the snowbridge
repo.
beacon-relay.log
parachain-relay.log
beefy-relay.log
Thestart-services.sh
script will automatically restart the relayer processes if they exit and print to the terminal. Seeing a relayer restart constantly is a sign that something might be wrong with your environment. Grepping the relayer logs will help pin point the issue.
Last updated