I’m creating this thread to list hidden hardcoded Duniter variables that should be exposed in a cleaner way (for example in pallet_config) so that we have easier control over Duniter parameters tuning.
Most of the constants are common in pallets_config.rs:
The bounds of identity length should be in pallet_config and not hardcoded. Without this, the wallets will not be able to get the values programmatically.
Duniter uses some environment variables. I do not consider it good practice as it is less explicit than a proper configuration file when not properly documented.
if let Ok(genesis_timestamp) = std::env::var("DUNITER_GENESIS_TIMESTAMP") {
genesis_timestamp
.parse()
.map_err(|_| "DUNITER_GENESIS_TIMESTAMP must be a number".to_owned())?
Maybe the genesis timestamp could be directly in the genesis json. @poka do you know the genesis timestamp you used for ĞDev5 ? Or it can be provided by a system call like now().
[edit] actually it was the other option if genesis timestamp was not provided
use std::time::SystemTime;
SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.expect("SystemTime before UNIX EPOCH!")
.as_secs()
It seems that the genesis timestamp isn’t used anywhere else than for computing membership expiration in number of blocks. So you could not have found it. The first timestamp is the one of the first block set_timestamp event.