Document environment variables in help
Available environment variables should be documented in --help
or something like that.
It should also be documented that any additional envvar should be added to the list.
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Pascal Engélibert changed milestone to %Ğ1 fake migration
changed milestone to %Ğ1 fake migration
- Pascal Engélibert added C-binary D-easy ET-days P7-nicetohave RN-binary labels
added C-binary D-easy ET-days P7-nicetohave RN-binary labels
Collapse replies - Author Maintainer
I don't know, maybe some are used only in Substrate code. Another option would be to replace them with CLI arguments. @HugoTrentesaux ?
I've searched through duniter-v2s and substrate source code for environment variables.
Environment variables found in substrate code:
$ find . -name .git -prune -o -type f -exec grep -Eo 'env::var\([^)]*)' {} \; | sed -E 's/^env::var\(//;s/\)$//' | sort -u "CARGO" "CARGO_CFG_TARGET_ARCH" "CARGO_CFG_TARGET_ENV" "CARGO_CFG_TARGET_OS" "CARGO_MANIFEST_DIR" "CARGO_PKG_NAME" "CARGO_PKG_VERSION" crate::SKIP_BUILD_ENV crate::WASM_BUILD_NO_COLOR crate::WASM_BUILD_RUSTFLAGS_ENV crate::WASM_BUILD_TYPE_ENV crate::WASM_BUILD_WORKSPACE_HINT crate::WASM_TARGET_DIRECTORY "ENABLE_LOGGING" format!("CARGO_FEATURE_{}", feature_env generate_crate_skip_build_env_name( "HOST" OFFLINE "OPT_LEVEL" "OUT_DIR" "PRINT_MAX_LOG_LEVEL" PRINT_PALLET_UPGRADE "PROFILE" "RUN_CUSTOM_FORMAT_TEST" "RUN_FORKED_TEST" "RUN_TEST" "RUN_TEST_PARENT_ID_WITH_THREADS" "RUN_UI_TESTS" "RUSTC" "RUSTC_BOOTSTRAP" "RUST_LOG" "SUBSTRATE_CLI_GIT_COMMIT_HASH" "SUBSTRATE_TEST_TIMEOUT" "TEST_LOG_FILTER" "TRACING_TARGETS" version_env WASM_BUILD_TOOLCHAIN
Environment variables found in duniter-v2s code:
$ find . -name .git -prune -o -type f -exec grep -Eo 'env::var\([^)]*)' {} \; | sed -E 's/^env::var\(//;s/\)$//' | sort -u "AT_BLOCK_NUMBER" "DUNITER_BINARY_PATH" "DUNITER_END2END_TESTS_SPAWN_NODE_TIMEOUT" "DUNITER_GENESIS_CONFIG" "DUNITER_GENESIS_TIMESTAMP" env_var_name "GITLAB_TOKEN" "WS_RPC_ENDPOINT"
Chainspec related environment variables:
$ find . -name .git -prune -o -type f -exec grep -w get_env_u32 {} \; -print let babe_epoch_duration = get_env_u32("DUNITER_BABE_EPOCH_DURATION", 30) as u64; let cert_validity_period = get_env_u32("DUNITER_CERT_VALIDITY_PERIOD", 1_000); let membership_period = get_env_u32("DUNITER_MEMBERSHIP_PERIOD", 1_000); let smith_cert_validity_period = get_env_u32("DUNITER_SMITH_CERT_VALIDITY_PERIOD", 1_000); let smith_membership_period = get_env_u32("DUNITER_SMITH_MEMBERSHIP_PERIOD", 1_000); let ud_creation_period = get_env_u32("DUNITER_UD_CREATION_PERIOD", 10); let ud_reeval_period = get_env_u32("DUNITER_UD_REEEVAL_PERIOD", 200);
Remaining after ruling out build, test and chainspec related variables:
substrate
None (IMHO).
duniter
"DUNITER_GENESIS_CONFIG" "DUNITER_GENESIS_TIMESTAMP"
These variables are related to the chainspec (chain spec generation or bootnode startup).
Edited by pini 2- Owner
Pini is right, the only environment variables are related to chainspec generation. I guess it is for convenience, and they are only needed for developers. Only documenting them in the developer documentation is enough in my opinion.
I think we should focus on documenting things that people will use or need to understand, and keep the rest for specific tutorials.
- Hugo Trentesaux added P9-somedaymaybe label and removed P7-nicetohave label
added P9-somedaymaybe label and removed P7-nicetohave label
- Hugo Trentesaux changed milestone to %Horizon
changed milestone to %Horizon
- Hugo Trentesaux removed milestone %Horizon
removed milestone %Horizon