🆙 A rewriting of Duniter v1 in the Substrate framework.
🚧 A test network called "ĞDev" is deployed, allowing to test wallets and indexers.
Multiple documentation sources are available depending on the level of detail you need.
- Full technical Rust doc (auto-generated with
cargo xtask gen-doc) : https://doc-duniter-org.ipns.pagu.re/duniter/ - User and client developer doc (official website) : https://duniter.org/wiki/duniter-v2/
- Internal documentation (within git repository), see table of contents below : ./docs
- README (this file)
- docs internal documentation
- api API
- manual manage account and identities
- runtime-calls the calls you can submit through the RPC API
- runtime-errors the errors you can get submitting a call
- runtime-events the events you can get submitting a call
- dev developer documentation
- user user documentation
- packaging packaging
- build-for-arm build for ARM architecture
- api API
- docker docker-related documentation
- end2end-tests automated end to end tests written with cucumber
- live-tests sanity checks to test the storage of a live chain
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-gdev-800:latest
To go further, read How to deploy a permanent mirror node on ĞDev network 🔗.
It can be useful to deploy your local blockchain, for instance to have a controlled environment to develop/test an application that interacts with the blockchain.
docker run -it -p9944:9944 duniter/duniter-gdev-800:latest
Or use the docker-compose.yml at the root of this repository.
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 (methodengine_createBlock).
See autocompletion to generate shell autocompletion for duniter commands.
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.
First, complete the basic setup instructions.
NOTE: You must first follow the instructions in the Setup section.
Use the following command to build the node without launching it:
cargo buildUse Rust's native cargo command to build and launch the node:
cargo run -- --devThis deploys a local blockchain with test accounts (Alice, Bob, etc) in the genesis using the
default runtime (gdev).
To run a local chain with another runtime:
# gdev local chain
cargo run -p duniter --no-default-features --features gdev -- \
--chain gdev_local --validator --unsafe-force-node-key-generation --sealing manual --tmp
# gtest local chain
cargo run -p duniter --no-default-features --features gtest -- \
--chain gtest_local --validator --unsafe-force-node-key-generation --sealing manual --tmp
# gtest local chain with 2 authorities (Alice and Bob)
# generate Alice's deterministic p2p key once
cargo run -p duniter --no-default-features --features gtest -- \
key generate-node-key --file /tmp/gtest_local2_alice.nodekey
# inspect the corresponding peer ID
cargo run -p duniter --no-default-features --features gtest -- \
key inspect-node-key --file /tmp/gtest_local2_alice.nodekey
cargo run -p duniter --no-default-features --features gtest -- \
--chain gtest_local2 --validator --alice --unsafe-force-node-key-generation \
--node-key-file /tmp/gtest_local2_alice.nodekey \
--listen-addr /ip4/127.0.0.1/tcp/30333 --tmp
# the peer ID printed by `key inspect-node-key` is Alice's stable peer ID:
# <ALICE_PEER_ID>
cargo run -p duniter --no-default-features --features gtest -- \
--chain gtest_local2 --validator --bob --unsafe-force-node-key-generation \
--port 30334 --rpc-port 9945 --prometheus-port 9616 \
--bootnodes /ip4/127.0.0.1/tcp/30333/p2p/<ALICE_PEER_ID> --tmp
# same setup with the dedicated helper script
scripts/run-gtest-local2.sh alice-peer-id
scripts/run-gtest-local2.sh alice
scripts/run-gtest-local2.sh bob --alice-peer-id <ALICE_PEER_ID>
# g1 local chain
cargo run -p duniter --no-default-features --features g1 -- \
--chain g1_local --validator --unsafe-force-node-key-generation --sealing manual --tmpYou can also use the helper script (it includes these options by default):
scripts/run-local-chain.sh --runtime gtestOpen https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944 to watch and interact with your node.
Start the development chain with detailed logging:
RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/duniter -lruntime=debug --devSee LICENSE
CopyLeft 2021-2023 Axiom-Team
Some parts borrowed from Polkadot (Parity Technologies (UK) Ltd.)
Duniter-v2S is free software: you can redistribute it and/or modify
it under the terms of the **GNU Affero General Public License** as published by
the Free Software Foundation, **version 3** of the License.
Duniter-v2S is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.