Skip to content
Snippets Groups Projects
README.md 11.29 KiB

Duniter v2s

🆙 A rewriting of Duniter v1 in the Substrate framework.

⚠️ Duniter-v2s is under active development.

🚧 A test network called "ĞDev" is deployed, allowing to test wallets and indexers.

logov2

Documentation TOC

Use

Join ĞDev network

The easiest way is to use the docker image.

Minimal command to deploy a temporary mirror peer:

docker run -it -p9944:9944 -e DUNITER_CHAIN_NAME=gdev duniter/duniter-v2s:v0.4.0 --tmp --execution=Wasm

To go further, read How to deploy a permanent mirror node on ĞDev network.

Create your local blockchain

It can be useful to deploy your local blockchain, for instance to have a controlled environement to develop/test an application that interacts with the blockchain.

docker run -it -p9944:9944 duniter/duniter-v2s:v0.4.0 --tmp

Or use the docker-compose.yml at the root of this repository.

Control when your local blockchain should produce blocks

By default, your local blockchain produces a new block every 6 seconds, which is not practical in some cases.

You can decide when to produce blocks with the cli option --sealing which has two modes:

  • --sealing=instant: produce a block immediately upon receiving a transaction into the transaction pool
  • --sealing=manual: produce a block upon receiving an RPC request (method engine_createBlock).

Autocompletion

See autocompletion.

Test

Test a specific commit

At each commit on master, an image with the tag debug-sha-******** is published, where ******** corresponds to the first 8 hash characters of the commit.

Usage:

docker run -it -p9944:9944 --name duniter-v2s duniter/duniter-v2s:debug-sha-b836f1a6

Then open https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944 in a browser.

Enable detailed logging:

docker run -it -p9944:9944 --name duniter-v2s \
  -e RUST_LOG=debug \
  -e RUST_BACKTRACE=1 \
  -lruntime=debug \
  duniter/duniter-v2s:debug-sha-b836f1a6

Contribute

If you are beginner in Rust and need a well guided tutorial, follow the beginner walkthrough.

Before any contribution, please read carefully the CONTRIBUTING file and our git conventions.

Setup your dev environment

First, complete the basic setup instructions.

Build

NOTE: You must first follow the instructions in the Setup section.

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

cargo build

Run

Use Rust's native cargo command to build and launch the node:

cargo run -- --dev --tmp

This will deploy a local blockchain with test accounts (Alice, Bob, etc) in the genesis.

Single-Node Development Chain

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

./target/debug/duniter --dev --tmp

Then open https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944 in a browser.

Start the development chain with detailed logging:

RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/duniter -lruntime=debug --dev