Stagenet Deployment Guide
Last updated
Last updated
Prior to diving into stagenet deployment, make sure to follow the Local Deployment Guide.
Below is a practical guide on how to get started deploying to THORChain’s stagenet, taking inspiration from our friends at who made a similar .
It covers the steps from installing and setting up the daemon to connecting to different chain environments, gettings funds on stagenet, and provides a broad overview of & .
After brew install golang coreutils binutils diffutils findutils gnu-tar gnu-sed gawk grep make git protobuf
you need to prioritize the GNU versions and modify your PATH. You’ll find all the commands needed in the installation log of the command before. An example:
PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
echo 'export PATH="/opt/homebrew/opt/binutils/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/opt/homebrew/opt/binutils/lib"
export CPPFLAGS="-I/opt/homebrew/opt/binutils/include"
PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/gawk/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"
echo 'export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/opt/homebrew/opt/postgresql@16/lib"
export CPPFLAGS="-I/opt/homebrew/opt/postgresql@16/include"
// reload your shell
source ~/.zshrc
# Verify gawk is available
which gawk
gawk --version
Install Docker: https://www.docker.com/products/docker-desktop/
Add GOBIN
to your PATH
.
export GOBIN=$GOPATH/bin
Clone Repo
git clone https://gitlab.com/thorchain/thornode.git
cd thornode
git checkout app/rc1
Install via make
command
TAG=stagenet make go-generate openapi install
Verify the correct installation
thornode help
The Stagenet is THORChain’s permissionless testnet, allowing you to freely test your contract with real money.
Connection Details (see details in API & RPC Endpoints)
Chain-ID: thorchain-stagenet-2
Example commands:
// Query all tokens
thornode query bank total-supply --node https://stagenet-rpc.ninerealms.com/
// Execute a transaction
thornode tx wasm execute <contract-addr> <json-msg> --from <account> --chain-id stage-1 --node https://stagenet-rpc.ninerealms.com/
Store the contract:
thornode tx wasm store <wasm file> --from <account> --chain-id stage-1 --node https://stagenet-rpc.ninerealms.com/
Instantiate it
thornode tx wasm instantiate <code Id> <InstantiateMsg> --from <account> --chain-id stage-1 --node https://stagenet-rpc.ninerealms.com/
Assets on stagenet are “real money” so to get assets to test, you will need to deposit real money (e.g. ATOM), swap some of it to another asset (e.g. RUNE) if you need a pair of assets to test, and then send by interacting with the different apps / contracts you want to test.
If above doesn't work, you can also get RUNE on THORChain via AVAX using below method:
This covers a manual conversion process from AVAX on the Avalance-C chain to RUNE on THORChain Stagenet.
Find the relevant section, e.g. AVAX:
Find the address field, e.g. 0xd6a6c0b3bb4150a98a379811934e440989209db6
Find your deposit address, e.g.: sthor1e2r98hpf3eer8pfpcrsprmrx5vpfq8jpwt06jw
Construct a message using that address of the form: =:THOR.RUNE:sthor1egxvam70a86jafa8gcg3kqfmfax3s0m2ug8gzt
Hex encode that string, e.g.: 3d3a54484f522e52554e453a7374686f723165677876616d37306138366a61666138676367336b71666d6661783373306d32756738677a74
And finally, prepend 0x to that string to match MetaMask expectations: 0x3d3a54484f522e52554e453a7374686f723165677876616d37306138366a61666138676367336b71666d6661783373306d32756738677a74
You need to ensure that the “show data” option is enabled under advanced settings:
You can use any Avalanche-compatible wallet, but in this example we're using MetaMask. You need to set message data, which can only be done in the full screen mode. Open MetaMask and choose expand view:
Initiate a send, and configure the destination address, token, and amount, plus the hex data from above:
RPC:
API:
Build and optimize your cosmwasm contract, so you have an artifact. A good starting point is this template:
The easiest way to deposit and swap assets on stagenet is to use , which is connected to stagenet:
Deposit: Go to , connect your wallet (Keplr, Ctrl, Leap or whichever you prefer) and hit the Deposit button. You can find the stagenet thor address (sthor….) in the portfolio page:
Swap: Once you’ve made a deposit, you can swap to e.g. RUNE to get on your sthor address using
Go to this URL:
You can use any tool to hex encode data, for example this site:
Broadcast the transaction above:
Take that transaction hash to:
Search for that transaction hash, and you’ll find: