The summary of the different values for --chain
argument can be found here: État des lieux des différentes chaînes - #17 by cgeek ( the first post is out of date, make sure to check the post number 17).
It seems that framework upgrades discouraged the use of custom chains for local developement without --dev
flag through multiple means:
- the removal of automatic key generation for validator nodes
- the requirement to provide a
--public-address
for validator node
The result is that you have to proceed in two steps:
- generate key at given position
$ duniter key generate-node-key --chain=dev --base-path /tmp/test-duniter-local
Generating key in "/tmp/test-duniter-local/chains/gdev_local/network/secret_ed25519"
12D3KooW9surMsDEaFvAfr13zsUzfQDbpkAWXJxK4dKDu4XaMCuH
- start duniter with a dummy public address
$ duniter --chain=dev --force-authoring --alice --public-addr /dns/localhost --base-path /tmp/test-duniter-local
This is for a simple dev
chain. What you want here is a gdev_dev
chain using a data file and a config file.
At the beginning, there was a single file genesis.json
. But now, it has been split in two parts:
- data (identities, wallets, initial monetary mass)
- config (smith web of trust, session keys…)
Config file can be passed both in json or yaml. The files you can find in cucumber tests are a mix of both: end2end-tests/cucumber-genesis/default.json · master · nodes / rust / Duniter v2S · GitLab, that’s why they are passed in both environment variables: end2end-tests/tests/common/mod.rs · 315f93aea8aa909f21b55d567852870b5e1c7a14 · nodes / rust / Duniter v2S · GitLab.
You can use the same trick to have a single file with both data and config:
$ export EXAMPLE=/home/hugo/example.json
$ DUNITER_GENESIS_DATA=$EXAMPLE DUNITER_GENESIS_CONFIG=$EXAMPLE duniter key generate-node-key --chain=gdev_dev --base-path /tmp/test-duniter
Generating key in "/tmp/test-duniter/chains/gdev/network/secret_ed25519"
12D3KooWFdjdeRuFRcS7tNASm9vN9o4ZXrNNYZvTZJDqZMZQUtEw
$ DUNITER_GENESIS_DATA=$EXAMPLE DUNITER_GENESIS_CONFIG=$EXAMPLE duniter --chain=gdev_dev --force-authoring --alice --public-addr /dns/localhost --base-path /tmp/test-duniter
...
Some answers:
The monetary mass is data, not config.
What you generate here is chainspecs, which combines both config and data to give the state of block zero plus other things.
You can use a single file with this
DUNITER_GENESIS_CONFIG: "/input/custom.json"
DUNITER_GENESIS_DATA: "/input/custom.json"
volumes:
- duniter-data:/var/lib/duniter
- ./input/custom.json:/input/custom.json