Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1000i100-test
  • 105_gitlab_container_registry
  • cgeek/issue-297-cpu
  • ci_cache
  • debug/podman
  • elois-compose-metrics
  • elois-duniter-storage
  • elois-smoldot
  • feature/dc-dump
  • feature/distance-rule
  • feature/show_milestone
  • fix-252
  • gdev-800-tests
  • hugo-release/runtime-701
  • hugo-tmp-dockerfile-cache
  • hugo/195-doc
  • hugo/195-graphql-schema
  • hugo/distance-precompute
  • hugo/endpoint-gossip
  • hugo/tmp-0.9.1
  • master
  • network/gdev-800
  • network/gdev-802
  • network/gdev-803
  • network/gdev-900
  • pini-check-password
  • release/client-800.2
  • release/hugo-chainspec-gdev5
  • release/poka-chainspec-gdev5
  • release/poka-chainspec-gdev5-pini-docker
  • release/runtime-100
  • release/runtime-200
  • release/runtime-300
  • release/runtime-400
  • release/runtime-401
  • release/runtime-500
  • release/runtime-600
  • release/runtime-700
  • release/runtime-701
  • release/runtime-800
  • tests/distance-with-oracle
  • tuxmain/anonymous-tx
  • tuxmain/benchmark-distance
  • update-docker-compose-rpc-squid-names
  • gdev-800
  • gdev-800-0.8.0
  • gdev-802
  • gdev-803
  • gdev-900-0.10.0
  • gdev-900-0.10.1
  • gdev-900-0.9.0
  • gdev-900-0.9.1
  • gdev-900-0.9.2
  • runtime-100
  • runtime-101
  • runtime-102
  • runtime-103
  • runtime-104
  • runtime-105
  • runtime-200
  • runtime-201
  • runtime-300
  • runtime-301
  • runtime-302
  • runtime-303
  • runtime-400
  • runtime-401
  • runtime-500
  • runtime-600
  • runtime-700
  • runtime-701
  • runtime-800
  • runtime-800-backup
  • runtime-800-bis
  • runtime-801
  • v0.1.0
  • v0.2.0
  • v0.3.0
  • v0.4.0
  • v0.4.1
80 results

Target

Select target project
  • nodes/rust/duniter-v2s
  • llaq/lc-core-substrate
  • pini-gh/duniter-v2s
  • vincentux/duniter-v2s
  • mildred/duniter-v2s
  • d0p1/duniter-v2s
  • bgallois/duniter-v2s
  • Nicolas80/duniter-v2s
8 results
Select Git revision
  • distance
  • elois-ci-binary-release
  • elois-compose-metrics
  • elois-duniter-storage
  • elois-fix-85
  • elois-opti-cert
  • elois-remove-renewable-period
  • elois-rework-certs
  • elois-smoldot
  • elois-substrate-v0.9.23
  • elois-technical-commitee
  • hugo-cucumber-identity
  • master
  • no-bootnodes
  • poc-oneshot-accounts
  • release/runtime-100
  • release/runtime-200
  • ts-types
  • ud-time-64
  • runtime-100
  • runtime-101
  • runtime-102
  • runtime-103
  • runtime-104
  • runtime-105
  • runtime-200
  • runtime-201
  • v0.1.0
28 results
Show changes
Showing
with 8788 additions and 1323 deletions
#!/bin/bash
# Custom startup if a first argument is present and is equal to '--'
# then we just run duniter with the provided arguments (but the '--')
# without applying all the automated configuration below
if [ "$1" = -- ]; then
shift
distance-oracle "$@"
else
ORACLE_RESULT_DIR="${ORACLE_RESULT_DIR:-/distance}"
ORACLE_EXECUTION_INTERVAL="${ORACLE_EXECUTION_INTERVAL:-1800}"
ORACLE_RPC_URL="${ORACLE_RPC_URL:-ws://127.0.0.1:9944}"
ORACLE_LOG_LEVEL="${ORACLE_LOG_LEVEL:-info}"
while [ true ]; do
distance-oracle --evaluation-result-dir "$ORACLE_RESULT_DIR" --rpc-url "$ORACLE_RPC_URL" --log "$ORACLE_LOG_LEVEL"
echo "Waiting $ORACLE_EXECUTION_INTERVAL seconds before next execution..."
sleep $ORACLE_EXECUTION_INTERVAL
done
fi
#!/bin/bash
# Custom startup if a first argument is present and is equal to '--'
# then we just run duniter with the provided arguments (but the '--')
# without applying all the automated configuration below
if [ "$1" = -- ]; then
shift
exec duniter "$@"
fi
# Normal startup
function boolean () {
echo "$1" | sed -E 's/^(true|yes|1)$/true/i'
}
......@@ -12,12 +21,8 @@ function ternary () {
fi
}
if [ -n "$DUNITER_INSTANCE_NAME" ]; then
set -- "$@" --name "$DUNITER_INSTANCE_NAME"
fi
DUNITER_DISABLE_PROMETHEUS=$(boolean "${DUNITER_DISABLE_PROMETHEUS:-false}")
# Define chain name at the beginning
# with #274 we could have default given in network branch
DUNITER_CHAIN_NAME="${DUNITER_CHAIN_NAME:-dev}"
case "$DUNITER_CHAIN_NAME" in
dev)
......@@ -28,10 +33,93 @@ case "$DUNITER_CHAIN_NAME" in
;;
esac
# Node name will appear on network
DUNITER_NODE_NAME="${DUNITER_NODE_NAME:-$DUNITER_INSTANCE_NAME}"
if [ -n "$DUNITER_NODE_NAME" ]; then
set -- "$@" --name "$DUNITER_NODE_NAME"
fi
# Path of key file. Should be generated below if not present before starting Duniter
_DUNITER_KEY_FILE=/var/lib/duniter/node.key
set -- "$@" --node-key-file "$_DUNITER_KEY_FILE"
# Generate node.key if not existing (chain name is required)
if [ ! -f "$_DUNITER_KEY_FILE" ]; then
echo "Generating node key file '$_DUNITER_KEY_FILE'..."
duniter key generate-node-key --file "$_DUNITER_KEY_FILE" "${chain[@]}"
else
echo "Node key file '$_DUNITER_KEY_FILE' exists."
fi
# Log peer ID
_DUNITER_PEER_ID="$(duniter key inspect-node-key --file "$_DUNITER_KEY_FILE")"
echo "Node peer ID is '$_DUNITER_PEER_ID'."
# Define public address (with dns, correct port and protocol for instance)
if [ -n "$DUNITER_PUBLIC_ADDR" ]; then
set -- "$@" --public-addr "$DUNITER_PUBLIC_ADDR"
fi
# Define public RPC endpoint (gossiped on the network)
if [ -n "$DUNITER_PUBLIC_RPC" ]; then
set -- "$@" --public-rpc "$DUNITER_PUBLIC_RPC"
fi
# Define public Squid endpoint (gossiped on the network)
if [ -n "$DUNITER_PUBLIC_SQUID" ]; then
set -- "$@" --public-squid "$DUNITER_PUBLIC_SQUID"
fi
# Define public endpoints from JSON file (gossiped on the network)
if [ -n "$DUNITER_PUBLIC_ENDPOINTS" ]; then
set -- "$@" --public-endpoints "$DUNITER_PUBLIC_ENDPOINTS"
fi
# Define listen address (inside docker)
if [ -n "$DUNITER_LISTEN_ADDR" ]; then
set -- "$@" --listen-addr "$DUNITER_LISTEN_ADDR"
fi
DUNITER_RPC_CORS="${DUNITER_RPC_CORS:-all}"
set -- "$@" --rpc-cors "$DUNITER_RPC_CORS"
# In case of validator, unsafe rpc methods are needed (like rotate_key) and should not be exposed publicly
DUNITER_VALIDATOR=$(boolean "${DUNITER_VALIDATOR:-false}")
if [ "$DUNITER_VALIDATOR" = true ]; then
set -- "$@" --rpc-methods Unsafe --validator
fi
DUNITER_DISABLE_PROMETHEUS=$(boolean "${DUNITER_DISABLE_PROMETHEUS:-false}")
if [ "$DUNITER_DISABLE_PROMETHEUS" = true ]; then
set -- "$@" --no-prometheus
fi
DUNITER_DISABLE_TELEMETRY=$(boolean "${DUNITER_DISABLE_TELEMETRY:-false}")
if [ "$DUNITER_DISABLE_TELEMETRY" = true ]; then
set -- "$@" --no-telemetry
fi
# Set pruning profile
DUNITER_PRUNING_PROFILE="${DUNITER_PRUNING_PROFILE:-default}"
case "$DUNITER_PRUNING_PROFILE" in
default)
;;
archive)
set -- "$@" --state-pruning archive --blocks-pruning archive
;;
light)
set -- "$@" --blocks-pruning 14400
;;
*)
echo "ERROR: ignoring unknown DUNITER_PRUNING_PROFILE value '$DUNITER_PRUNING_PROFILE'" >&2
;;
esac
# Set main command
# Since we are inside docker, we can bind to all interfaces.
# User will bind port to host interface or set reverse proxy when needed.
set -- "$@" \
"${chain[@]}" \
$(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \
-d /var/lib/duniter --unsafe-rpc-external --unsafe-ws-external
-d /var/lib/duniter --unsafe-rpc-external
echo "Starting duniter with parameters:" "$@"
exec duniter "$@"
# Manual for wallet developers
This functional documentation presents how wallets can interact with the blockchain.
It is intended to complete the [runtime calls documentation](./runtime-calls.md) in a runtime-specific way to fit the real needs of wallet developers.
NOTE : a more detailed doc is available at <https://duniter.org/wiki/duniter-v2/doc/>
## Notations
1 ĞD = 100 units
## Account existence
An account exists if and only if it contains at least the existential deposit (`balances.existentialDeposit` = 1 ĞD).
## Become member
Only use `identity` pallet.
1. The account that wants to gain membership needs to exists.
1. Any account that already has membership and respects the identity creation period can create an identity for another account, using `identity.createIdentity`.
1. The account has to confirm its identity with a name, using `identity.confirmIdentity`. The name must be ASCII alphanumeric, punctuation or space characters: `` /^[-!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~a-zA-Z0-9 ]{3,64}$/ `` (additionally, trailing spaces and double spaces are forbidden, as a phishing countermeasure). If the name is already used, the call will fail.
1. 4 different member accounts must certify the account using `cert.addCert`.
1. The distance evaluation must be requested for the pending identity using `distance.requestDistanceEvaluation`.
1. 3 distance sessions later, if the distance rule is respected, identity is validated automatically.
## Change key
A member can request a key change via the `identity.change_onwner_key` call. It needs the following SCALE encoded (see SCALE encoding section below) payload:
- The new owner key payload prefix (rust definition: `b"icok"`)
- the genesis block hash. (rust type `[u8; 32]` (`H256`))
- The identity index (rust type `u64`)
- The old key (rust type `u64`)
This payload must be signed with the new key.
## Revoke an identity
Revoking an identity makes it lose its membership, hence UD creation and governance rights. Other data such as balance will remain.
This feature is useful in case the user has lost their private key since the revocation document can be made in advance.
### Generate the revocation payload
The revocation needs this SCALE encoded (see SCALE encoding section below) payload:
- The revocation payload prefix (rust definition: `b"revo"`)
- The identity index (rust type `u64`)
- the genesis block hash. (rust type `[u8; 32]` (`H256`))
This payload must be signed with the corresponding revocation key.
### Effectively revoke the identity
1. From any origin that can pay the fee, use `identity.revokeIdentity` with the revocation payload.
## SCALE encoding
SCALE codec documentation: https://docs.substrate.io/reference/scale-codec/.
At the end of this documentation you'll find links to SCALE codec implementation for other languages.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# Compilation
Duniter is compiled using the Rust compiler. For a general overview, refer to the [Rustc Dev Guide](https://rustc-dev-guide.rust-lang.org/overview.html).
Substrate and Duniter provide a set of features enabling or disabling parts of the code using conditional compilation. More information on conditional compilation can be found [here](https://doc.rust-lang.org/reference/conditional-compilation.html), or by enabling or disabling compilation of packages. Below is a list of all available features:
## External
- **runtime-benchmarks**: Compiles the runtime with benchmarks for extrinsics benchmarking.
- **try-runtime**: Compiles the runtime for tests and verifies operations in a simulated environment.
- **std**: Enables the Rust standard library.
## Duniter
- **gdev**: Sets `gdev-runtime` and `std` used to build the development chain.
- **gtest**: Sets `gtest-runtime` and `std` used to build the test chain.
- **g1**: Sets `g1-runtime` and `std` used to build the production chain.
- **constant-fees**: Uses a constant and predictable weight-to-fee conversion only for testing.
- **embed**: Enables hardcoded live chainspecs loaded from "../specs/gtest-raw.json" file.
- **native**: Compiles the runtime into native-platform executable only for debugging purposes.
Note: By default, Duniter will be compiled using the `gdev` feature and including the compilation of the distance oracle. Since the three Duniter chains are mutually exclusive, it is mandatory to disable the default feature to compile `gtest` and `g1` as follows:
- `cargo build --no-default-features --features gtest`
- `cargo build --no-default-features --features g1`
- `cargo build --no-default-features -p distance-oracle --features std`
This diff is collapsed.
docs/dev/img/release-pipeline.png

44.1 KiB

This diff is collapsed.
# Duniter Pallet Conventions
## Call
Custom Duniter pallet calls should adhere to the standard Substrate naming convention:
- `action_` for regular calls (e.g., `create_identity`).
- `force_action_` for calls with a privileged origin (e.g., `force_set_distance_status`).
## Error
In the event of a call failure, it should trigger a pallet error with a self-explanatory name, for instance, `IdtyNotFound`.
## Event
Successful calls should deposit a system event to notify external entities of the change. The event name should be self-explanatory and structured in the form of a Rust struct with named fields, ensuring clarity in autogenerated documentation. An example is:
```rust
IdtyRemoved {
idty_index: T::IdtyIndex,
reason: IdtyRemovalReason<T::IdtyRemovalOtherReason>,
}
```
## Hook
Hooks are inherently infallible, and no errors should be emitted within them. To monitor progression from inside the hook, events can be employed to inform external entities about changes or no-changes.
## Internal Function
Internal functions should adhere to the following naming convention:
- `do_action_` for regular functions executing the base logic of a call (e.g., `do_remove_identity_`). These functions should directly emit events and trigger errors as needed.
- `force_action_` for privileged functions that bypass any checks. This can be useful for specific benchmarking functions.
- `check_` for functions performing checks and triggering errors in case of failure.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.