Code Monkey home page Code Monkey logo

dust-chain's Introduction

Dust Chain

Dust chain is written in Rust. A basic familiarity with Rust tooling is required.

To learn more about Dust chain, please refer to Documentation.

Clone

To clone the repo with its submodules run:

git clone --recursive https://github.com/dust-defi/dust-chain

Rust Setup

If you don’t have Rust already, you can install it with:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

You can install developer tools on Ubuntu 20.04 with:

sudo apt install make clang pkg-config libssl-dev build-essential

You can install the latest Rust toolchain with:

make init

Start a development node

The make run command will launch a temporary node and its state will be discarded after you terminate the process.

make run

Run a persistent single-node chain

Use the following command to build the node without launching it:

make build

This command will start the single-node development chain with persistent state:

./target/release/dust-node --dev

Purge the development chain's state:

./target/release/dust-node purge-chain --dev

Start the development chain with detailed logging:

RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/dust-node -lruntime=debug --dev

Run tests

make test

Run benchmarks

Run runtime benchmark tests:

make bench

Run module benchmark tests:

cargo test -p module-poc --all-features

Run the module benchmarks and generate the weights file:

./target/release/dust-node benchmark \
    --chain=dev \
    --steps=50 \
    --repeat=20 \
    --pallet=module_poc \
    --extrinsic='*'  \
    --execution=wasm \
    --wasm-execution=compiled \
    --heap-pages=4096 \
    --output=./modules/poc/src/weights.rs

Run in debugger

make debug

Embedded docs

Once the project has been built, the following command can be used to explore all parameters and subcommands:

./target/release/dust-node -h

Release builds

To list all available release builds run:

git tag

To create a corresponding production build, first checkout the tag:

git checkout testnet-1

Then run this command to install appropriate compiler version and produce a binary.

make release

On-Chain upgrade builds

Build the wasm runtime with:

make wasm

Fork dust-chain

You can create a fork of a live chain (testnet / mainnet) for development purposes.

  1. Build binary and sync with target chain on localhost defaults. You will need to use unsafe rpc.
  2. Execute the Make command ensuring to specify chain name (testnet / mainnet).
make chain=testnet fork
  1. Now run a forked chain:
cd fork/data
./binary --chain fork.json --alice

dust-chain's People

Contributors

chivay avatar dependabot[bot] avatar frisitano avatar marlonhanks avatar mattiafailla avatar mwarzynski avatar netherdrake avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.