Skip to content
Snippets Groups Projects
Select Git revision
  • 2ed9ca97f79e9165436655886aa8da1fb553e84b
  • master default protected
  • ci-embed-raw-specs
  • network/gtest-1000 protected
  • upgradable-multisig
  • runtime/gtest-1000
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • gtest-1000-0.11.0 protected
  • gtest-1000 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
  • v0.4.1 protected
41 results

gen_genesis_data.rs

Blame
  • Distance rule evaluation

    The distance rule is computationally too heavy to be handled by the runtime. Therefore it is computed offchain using the distance oracle.

    Distance evaluation is operated on a voluntary basis by individual smiths. Since evaluators can lie or make errors, the result considered for applying the distance rule is the median of results published by the different evaluators.

    Running distance evaluation

    Any smith member authoring blocks can run a distance evaluation oracle. It is better to have a machine more powerful than the reference machine.

    The simplest way is to run the oracle on the same machine as Duniter.

    Build the oracle:

    cargo build --release -p distance-oracle

    It will be available at ./target/release/distance-oracle. Move it to somewhere appropriate.

    Add this line to your cron with the command crontab -e: (add option -u <user> to edit another user's cron)

    4,24,44 * * * * nice -n 2 /absolute/path/to/distance-oracle

    The precise hours don't matter so you can pick random values, but it should run at least one time per hour, and running it more often decreases the risk of problem in case of missing blocks or temporary network failure.

    If the evaluation ran successfully in a session, the next runs in the same session won't re-evaluate the same data.

    The nice -n 2 lowers the oracle's priority, so that Duniter has the priority even when the oracle wants to use all the cores.

    Additional Duniter configuration

    Duniter should keep states at least one session old, that it 600 blocks (while 256 is the default). Use the option --state-pruning 600 if your node is not already an archive (--state-pruning archive).