arrudagates / Basilisk-node

Basilisk - cross-chain liquidity protocol on Kusama

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basilisk node

Local Development

Follow these steps to prepare a local Substrate development environment 🛠️

Simple Setup

Install all the required dependencies with a single command (be patient, this can take up to 30 minutes).

curl https://getsubstrate.io -sSf | bash -s -- --fast

Manual Setup

Find manual setup instructions at the Substrate Developer Hub.

Build

Once the development environment is set up, build the node. This command will build the Wasm and native code:

make build

Run

Local Testnet

Relay chain repository Polkadot has to be built in ../polkadot sibling directory Install polkadot-launch utility used to start network.

npm install -g polkadot-launch

Start local testnet with 4 relay chain validators and Basilisk as a parachain with 2 collators.

cd ../rococo-local
polkadot-launch config.json

Observe Basilisk logs

multitail 99*.log

Use Testing Runtime

There is also an option to run the testing runtime with less restrictive settings to facilitate testing of new features. The following command starts a dev node collator, and the testing runtime is used as a runtime for our node.

./target/release/basilisk --dev --runtime=testing

The testing runtime currently supports only two chain specifications: dev and local testnet. Both runtimes store blockchain data in the same directories( e.g. the dev directory is shared for both runtimes started with the --dev parameter. That's why it is important to purge chain data when switching to different runtime( note: --runtime parameter can't be used when purging chain data)

In the case of starting a testnet using the polkadot-launch tool, we don't have an option to communicate to its internal commands that we would like to use the testing runtime. To overcome this limitation, rename the binary so it starts with the testing prefix, e.g. testing-basilisk. Such a binary always uses the testing runtime, even if the --runtime testing option is not specified.

Start local testnet with testing runtime

cd ../rococo-local
polkadot-launch testing-config.json

Interaction with the node

Go to the Polkadot apps at https://dotapps.io

Connect to the local testnet at ws://localhost:9988 or live wss://basilisk.hydradx.io:9944

NOTE - FixedU128 type is not yet implemented for polkadot apps. Balance is a measure so price can be reasonably selected. If using polkadot apps to create pool:

  • 1 Mega Units equals 1:1 price
  • 20 Mega Units equals 20:1 price
  • 50 Kilo Units equals 0.05:1 price

Testing of storage migrations and runtime upgrades

The try-runtime tool can be used to test storage migrations and runtime upgrades against state from a real chain. Run the following command to test against the state on Basilisk on Kusama

cargo run --features=try-runtime try-runtime on-runtime-upgrade live --uri wss://rpc.basilisk.cloud:443

or against the Basilisk testnet on Rococo

cargo run --release --features=try-runtime try-runtime on-runtime-upgrade live --uri wss://rococo-basilisk-rpc.hydration.dev:443

Chopsticks simulations

Chopsticks can be used to dry-run any transaction in parallel reality of any Substrate network.

Setting up the repo:

git clone --recurse-submodules https://github.com/AcalaNetwork/chopsticks.git && cd chopsticks
yarn
yarn build-wasm

To run Kusama-Basilisk-Karura setup use configs from launch-configs/chopsticks and run

npx @acala-network/chopsticks@0.3.11 xcm --relaychain=configs/kusama.yml --parachain=configs/basilisk.yml --parachain=configs/karura.yml

About

Basilisk - cross-chain liquidity protocol on Kusama

License:Apache License 2.0


Languages

Language:Rust 95.7%Language:Shell 1.9%Language:Handlebars 1.2%Language:JavaScript 0.8%Language:Makefile 0.2%Language:Dockerfile 0.2%Language:HCL 0.1%