Crates.io | pallet-cosmos-abci |
lib.rs | pallet-cosmos-abci |
version | 0.0.1 |
source | src |
created_at | 2020-11-17 15:38:37.006969 |
updated_at | 2020-11-17 15:38:37.006969 |
description | Pallet ABCI module with runtime interfaces |
homepage | |
repository | https://github.com/adoriasoft/polkadot_cosmos_integration |
max_upload_size | |
id | 313323 |
size | 18,842 |
A new FRAME-based Substrate node with Cosmos ABCI.
Documentation for this project is here
Install Rust:
curl https://sh.rustup.rs -sSf | sh
Initialize your Wasm Build environment:
./scripts/init.sh
Build Wasm and native code:
cargo build
Before running substrate node, you should build and start cosmos node. Go to the our fork of the cosmos-sdk, switch to the branch feature/add_nameservice, then just follow instractions.
To run node locally you will need to specify the environment variables for cosmos-abci pallet.
export ABCI_SERVER_URL=tcp://localhost:26658
export ABCI_GENESIS_STATE_PATH=$HOME/.nsd/config/genesis.json
# or
export ABCI_GENESIS_STATE=$(cat $HOME/.nsd/config/genesis.json)
After any updating of the genesis.json file should specify following encironment variable
export ABCI_GENESIS_STATE=$(cat $HOME/.nsd/config/genesis.json)
To run tests from local use commands:
# pallet-cosmos-abci
cargo test --test pallet_abci_test
# abci
cargo test --test abci_test
Purge any existing developer chain state:
./target/release/node-template purge-chain --dev
Start a development chain with:
./target/release/node-template --dev
Detailed logs may be shown by running the node with the following environment variables set: RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev
.
First, install Docker and Docker Compose.
Then run the following command to start a single node development chain.
./scripts/docker_run.sh
This command will firstly compile your code, and then start a local development network. You can also replace the default command (cargo build --release && ./target/release/node-template --dev --ws-external
) by appending your own. A few useful ones are as follow.
# Run Substrate node without re-compiling
./scripts/docker_run.sh ./target/release/node-template --dev --ws-external
# Purge the local dev chain
./scripts/docker_run.sh ./target/release/node-template purge-chain --dev
# Check whether the code is compilable
./scripts/docker_run.sh cargo check
{ "jsonrpc": "2.0", "method": <method_name>, "id": 0, "params": <method_params> }