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
)
Install hooks for direnv
. Change this if you are using a different shell.
Install https://github.com/nvm-sh/nvm
Install Node
Install pnpm (https://pnpm.io/)
Golang (https://go.dev/doc/install)
Mage and Revive (https://magefile.org/, https://github.com/mgechev/revive#installation)
Setup
This guide uses the root of the $HOME/
folder for all source code.
Clone the https://github.com/paritytech/polkadot repo.
Clone the https://github.com/Snowfork/snowbridge repo.
yarn
install dependencies.Edit
.envrc
anddirenv allow
In the
web/packages/test
subfolder of thesnowbridge
repo copy the envrc-example.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
In the
contracts
subfolder of thesnowbridge
repo copy the envrc-example. Here we do not need to edit the.envrc
as defaults are set.
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.
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:
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