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

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
Show changes
Commits on Source (25)
Showing
with 3146 additions and 2913 deletions
......@@ -39,7 +39,7 @@ check_labels:
.env:
image: paritytech/ci-linux:production
tags:
- elois-neutron
- dind
fmt_and_clippy:
extends: .env
......@@ -159,10 +159,12 @@ tests_debug:
DUNITER_END2END_TESTS_SPAWN_NODE_TIMEOUT: "20"
script:
- cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests
- cargo cucumber -i balance*
- cargo cucumber -i monetary*
- cargo cucumber -i transfer*
- cargo cucumber -i account_creation*
- cargo cucumber -i certification*
- cargo cucumber -i identity_creation*
- cargo cucumber -i monetary_mass*
- cargo cucumber -i oneshot_account*
- cargo cucumber -i transfer_all*
after_script:
- cd target/debug/deps/
- rm cucumber_tests-*.d
......@@ -183,9 +185,12 @@ tests_release:
DUNITER_END2END_TESTS_SPAWN_NODE_TIMEOUT: "20"
script:
- cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests
- cargo cucumber -i balance*
- cargo cucumber -i monetary*
- cargo cucumber -i transfer*
- cargo cucumber -i account_creation*
- cargo cucumber -i certification*
- cargo cucumber -i identity_creation*
- cargo cucumber -i monetary_mass*
- cargo cucumber -i oneshot_account*
- cargo cucumber -i transfer_all*
after_script:
- cd target/debug/deps/
- rm cucumber_tests-*.d
......@@ -201,9 +206,9 @@ tests_release:
stage: deploy
image: docker:18.06
tags:
- redshift
- docker
services:
- docker:18.06-dind
- docker:dind
before_script:
- docker info
script:
......
......@@ -9,7 +9,12 @@
"request": "launch",
"name": "Debug unit tests in library 'duniter'",
"cargo": {
"args": ["test", "--no-run", "--lib", "--package=duniter"],
"args": [
"test",
"--no-run",
"--lib",
"--package=duniter"
],
"filter": {
"name": "duniter",
"kind": "lib"
......@@ -23,13 +28,20 @@
"request": "launch",
"name": "Debug executable 'duniter'",
"cargo": {
"args": ["build"],
"args": [
"build"
],
"filter": {
"name": "duniter",
"kind": "bin"
}
},
"args": ["--tmp", "--dev", "--execution", "Native"],
"args": [
"--tmp",
"--dev",
"--execution",
"Native"
],
"cwd": "${workspaceFolder}"
},
{
......@@ -37,7 +49,12 @@
"request": "launch",
"name": "Debug unit tests in executable 'duniter'",
"cargo": {
"args": ["test", "--no-run", "--bin=duniter", "--package=duniter"],
"args": [
"test",
"--no-run",
"--bin=duniter",
"--package=duniter"
],
"filter": {
"name": "duniter",
"kind": "bin"
......@@ -51,7 +68,12 @@
"request": "launch",
"name": "Debug unit tests in library 'gdev-runtime'",
"cargo": {
"args": ["test", "--no-run", "--lib", "--package=gdev-runtime"],
"args": [
"test",
"--no-run",
"--lib",
"--package=gdev-runtime"
],
"filter": {
"name": "gdev-runtime",
"kind": "lib"
......@@ -65,7 +87,12 @@
"request": "launch",
"name": "Debug unit tests in library 'pallet-certification'",
"cargo": {
"args": ["test", "--no-run", "--lib", "--package=pallet-certification"],
"args": [
"test",
"--no-run",
"--lib",
"--package=pallet-certification"
],
"filter": {
"name": "pallet-certification",
"kind": "lib"
......@@ -79,7 +106,12 @@
"request": "launch",
"name": "Debug unit tests in library 'pallet-identity'",
"cargo": {
"args": ["test", "--no-run", "--lib", "--package=pallet-identity"],
"args": [
"test",
"--no-run",
"--lib",
"--package=pallet-identity"
],
"filter": {
"name": "pallet-identity",
"kind": "lib"
......@@ -108,4 +140,4 @@
"cwd": "${workspaceFolder}"
}
]
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -29,27 +29,28 @@ runtime-benchmarks = [
'gdev-runtime/runtime-benchmarks',
#'gtest-runtime',
#'gtest-runtime/runtime-benchmarks',
'sc-client-db/runtime-benchmarks',
]
try-runtime = [
"g1-runtime/try-runtime",
#"g1-runtime/try-runtime",
"gdev-runtime/try-runtime",
"gtest-runtime/try-runtime",
#"gtest-runtime/try-runtime",
"try-runtime-cli"
]
[build-dependencies]
clap = { version = "3.0" }
#clap_complete = { version = "3.0" }
substrate-build-script-utils = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26' }
clap = { version = "4.0" }
#clap_complete = { version = "4.0" }
substrate-build-script-utils = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32' }
[dev-dependencies]
rusty-hook = "^0.11.2"
# Dependencies for specific targets
[target.'cfg(any(target_arch="x86_64", target_arch="aarch64"))'.dependencies]
sc-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26", default-features = false, features = ["wasmtime"] }
sc-service = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26", default-features = false, features = ["wasmtime"] }
sp-trie = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26", features = ["memory-tracker"] }
sc-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false, features = ["wasmtime"] }
sc-service = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false, features = ["wasmtime"] }
sp-trie = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", features = ["memory-tracker"] }
[dependencies]
......@@ -59,67 +60,71 @@ g1-runtime = { path = 'runtime/g1', optional = true }
gdev-runtime = { path = 'runtime/gdev', optional = true }
gtest-runtime = { path = 'runtime/gtest', optional = true }
pallet-certification = { path = 'pallets/certification' }
pallet-oneshot-account = { path = 'pallets/oneshot-account' }
sp-membership = { path = 'primitives/membership' }
# crates.io dependencies
async-io = "1.3"
clap = { version = "3.0", features = ["derive"] }
clap_complete = { version = "3" }
clap = { version = "4.0", features = ["derive"] }
clap_complete = { version = "4" }
futures = { version = "0.3.1", features = ["compat"] }
hex = "0.4.3"
jsonrpsee = { version = "0.14.0", features = ["server"] }
jsonrpsee = { version = "0.15.1", features = ["server"] }
lazy_static = "1.4.0"
log = "0.4"
maplit = '1.0.2'
memmap2 = "0.5.0"
serde = "1.0"
serde_json = "1.0.64"
tracing-core = "=0.1.26"
tracing-core = "0.1.28"
# substrate dependencies
frame-benchmarking = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
frame-benchmarking-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
pallet-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
pallet-transaction-payment-rpc = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-basic-authorship = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-chain-spec = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26", default-features = false }
sc-client-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
babe = { package = "sc-consensus-babe", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
manual-seal = { package = "sc-consensus-manual-seal", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-consensus-uncles = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-executor = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-finality-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-network = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-rpc-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-service = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26", default-features = false }
sc-telemetry = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-transaction-pool = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sc-transaction-pool-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-authority-discovery = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-block-builder = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-blockchain = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-consensus-babe = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-core = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-finality-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-inherents = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-io = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-offchain = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-keyring = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-runtime = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-session = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-storage = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-timestamp = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-transaction-pool = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
sp-trie = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
substrate-frame-rpc-system = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
try-runtime-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26", optional = true }
frame-benchmarking = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
frame-benchmarking-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
frame-system = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false }
pallet-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
pallet-transaction-payment = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false }
pallet-transaction-payment-rpc = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-basic-authorship = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-chain-spec = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false }
sc-client-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
babe = { package = "sc-consensus-babe", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
manual-seal = { package = "sc-consensus-manual-seal", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-client-db = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false }
sc-consensus-uncles = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-executor = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-finality-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-network = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-rpc-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-service = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false }
sc-telemetry = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-transaction-pool = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-transaction-pool-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-authority-discovery = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-block-builder = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-blockchain = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-consensus-babe = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-core = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-finality-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-inherents = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-io = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-offchain = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-keyring = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-runtime = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-session = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-storage = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-timestamp = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-transaction-pool = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sp-trie = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
substrate-frame-rpc-system = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
try-runtime-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", optional = true }
[workspace]
resolver = "2"
......@@ -204,6 +209,74 @@ zeroize = { opt-level = 3 }
panic = "unwind"
[patch.crates-io]
# rw-stream-sink has not been updated for 2 years and uses a too old version of pin-project (v0.4.28)
# For the project to compile, we have to patch this dependency to force the use of pin-project v1.x
#rw-stream-sink = { git = "https://github.com/librelois/rw-stream-sink", branch = "master" }
#[patch."https://github.com/duniter/substrate"]
#fork-tree = { path = "../substrate/utils/fork-tree" }
#frame-support = { path = "../substrate/frame/support" }
#frame-support-procedural = { path = "../substrate/frame/support/procedural" }
#frame-support-procedural-tools = { path = "../substrate/frame/support/procedural/tools" }
#frame-system = { path = "../substrate/frame/system" }
#frame-benchmarking = { path = "../substrate/frame/benchmarking" }
#frame-benchmarking-cli = { path = "../substrate/utils/frame/benchmarking-cli" }
#sc-basic-authorship = { path = "../substrate/client/basic-authorship" }
#sc-block-builder = { path = "../substrate/client/block-builder" }
#sc-chain-spec = { path = "../substrate/client/chain-spec" }
#sc-cli = { path = "../substrate/client/cli" }
#sc-client-api = { path = "../substrate/client/api" }
#sc-client-db = { path = "../substrate/client/db" }
#sc-consensus = { path = "../substrate/client/consensus/common" }
#sc-consensus-aura = { path = "../substrate/client/consensus/aura" }
#sc-consensus-babe = { path = "../substrate/client/consensus/babe" }
#sc-consensus-manual-seal = { path = "../substrate/client/consensus/manual-seal" }
#sc-consensus-slots = { path = "../substrate/client/consensus/slots" }
#sc-consensus-uncles = { path = "../substrate/client/consensus/uncles" }
#sc-executor = { path = "../substrate/client/executor" }
#sc-executor-common = { path = "../substrate/client/executor/common" }
#sc-executor-wasmi = { path = "../substrate/client/executor/wasmi" }
#sc-executor-wasmtime = { path = "../substrate/client/executor/wasmtime" }
#sc-finality-grandpa = { path = "../substrate/client/finality-grandpa" }
#sc-keystore = { path = "../substrate/client/keystore" }
#sc-network = { path = "../substrate/client/network" }
#sc-rpc-api = { path = "../substrate/client/rpc-api" }
#sc-service = { path = "../substrate/client/service" }
#sc-telemetry = { path = "../substrate/client/telemetry" }
#sc-transaction-pool = { path = "../substrate/client/transaction-pool" }
#sc-transaction-pool-api = { path = "../substrate/client/transaction-pool/api" }
#sp-api = { path = "../substrate/primitives/api" }
#sp-application-crypto = { path = "../substrate/primitives/application-crypto" }
#sp-arithmetic = { path = "../substrate/primitives/arithmetic" }
#sp-authority-discovery = { path = "../substrate/primitives/authority-discovery" }
#sp-authorship = { path = "../substrate/primitives/authorship" }
#sp-block-builder = { path = "../substrate/primitives/block-builder" }
#sp-blockchain = { path = "../substrate/primitives/blockchain" }
#sp-consensus = { path = "../substrate/primitives/consensus/common" }
#sp-consensus-babe = { path = "../substrate/primitives/consensus/babe" }
#sp-consensus-slots = { path = "../substrate/primitives/consensus/slots" }
#sp-consensus-vrf = { path = "../substrate/primitives/consensus/vrf" }
#sp-core = { path = "../substrate/primitives/core" }
#sp-core-hashing = { path = "../substrate/primitives/core/hashing" }
#sp-core-hashing-proc-macro = { path = "../substrate/primitives/core/hashing/proc-macro" }
#sp-debug-derive = { path = "../substrate/primitives/debug-derive" }
#sp-externalities = { path = "../substrate/primitives/externalities" }
#sp-finality-grandpa = { path = "../substrate/primitives/finality-grandpa" }
#sp-inherents = { path = "../substrate/primitives/inherents" }
#sp-io = { path = "../substrate/primitives/io" }
#sp-keyring = { path = "../substrate/primitives/keyring" }
#sp-keystore = { path = "../substrate/primitives/keystore" }
#sp-maybe-compressed-blob = { path = "../substrate/primitives/maybe-compressed-blob" }
#sp-offchain = { path = "../substrate/primitives/offchain" }
#sp-panic-handler = { path = "../substrate/primitives/panic-handler" }
#sp-rpc = { path = "../substrate/primitives/rpc" }
#sp-runtime = { path = "../substrate/primitives/runtime" }
#sp-session = { path = "../substrate/primitives/session" }
#sp-staking = { path = "../substrate/primitives/staking" }
#sp-state-machine = { path = "../substrate/primitives/state-machine" }
#sp-std = { path = "../substrate/primitives/std" }
#sp-storage = { path = "../substrate/primitives/storage" }
#sp-timestamp = { path = "../substrate/primitives/timestamp" }
#sp-tracing = { path = "../substrate/primitives/tracing" }
#sp-transaction-pool = { path = "../substrate/primitives/transaction-pool" }
#sp-trie = { path = "../substrate/primitives/trie" }
#sp-version = { path = "../substrate/primitives/version" }
#sp-weights = { path = "../substrate/primitives/weights" }
#substrate-prometheus-endpoint = { path = "../substrate/utils/prometheus" }
......@@ -28,6 +28,7 @@
- [setup](./docs/dev/setup.md)
- [verify-runtime-code](./docs/dev/verify-runtime-code.md)
- [weights-benchmarking](./docs/dev/weights-benchmarking.md)
- [upgrade-substrate](./docs/dev/upgrade-substrate.md)
- [test](./docs/test/)
- [replay-block](./docs/test/replay-block.md)
- [user](./docs/user/)
......@@ -35,8 +36,8 @@
- [build-for-arm](./docs/user/build-for-arm.md)
- [rpc](./docs/user/rpc.md) deploy a permanent ǦDev mirror node
- [smith](./docs/user/smith.md) deploy a permanent ǦDev validator node
- [end2end-tests](./end2end-tests/) automated end to end tests written with cucumber
- [live-tests](./live-tests/) sanity checks to test the storage of a live chain
- [end2end-tests](./end2end-tests/) automated end to end tests written with cucumber
- [live-tests](./live-tests/) sanity checks to test the storage of a live chain
## Use
......@@ -47,7 +48,7 @@ The easiest way is to use the docker image.
Minimal command to deploy a **temporary** mirror peer:
```docker
docker run -it -p9944:9944 -e DUNITER_CHAIN_NAME=gdev duniter/duniter-v2s:v0.3.0 --tmp --execution=Wasm
docker run -it -p9944:9944 -e DUNITER_CHAIN_NAME=gdev duniter/duniter-v2s:v0.4.0 --tmp --execution=Wasm
```
To go further, read [How to deploy a permanent mirror node on ĞDev network](./docs/user/rpc.md).
......@@ -58,7 +59,7 @@ It can be useful to deploy your local blockchain, for instance to have a control
to develop/test an application that interacts with the blockchain.
```docker
docker run -it -p9944:9944 duniter/duniter-v2s:v0.3.0 --tmp
docker run -it -p9944:9944 duniter/duniter-v2s:v0.4.0 --tmp
```
Or use the `docker-compose.yml` at the root of this repository.
......@@ -69,8 +70,8 @@ By default, your local blockchain produces a new block every 6 seconds, which is
You can decide when to produce blocks with the cli option `--sealing` which has two modes:
* `--sealing=instant`: produce a block immediately upon receiving a transaction into the transaction pool
* `--sealing=manual`: produce a block upon receiving an RPC request (method `engine_createBlock`).
- `--sealing=instant`: produce a block immediately upon receiving a transaction into the transaction pool
- `--sealing=manual`: produce a block upon receiving an RPC request (method `engine_createBlock`).
### Autocompletion
......@@ -278,3 +279,21 @@ A FRAME pallet is compromised of a number of blockchain primitives:
- Errors: When a dispatchable fails, it returns an error.
- Config: The `Config` configuration interface is used to define the types and parameters upon
which a FRAME pallet depends.
## License
CopyLeft 2021-2023 Axiom-Team
Some parts borrowed from Polkadot (Parity Technologies (UK) Ltd.)
Duniter-v2S is free software: you can redistribute it and/or modify
it under the terms of the **GNU Affero General Public License** as published by
the Free Software Foundation, **version 3** of the License.
Duniter-v2S is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
......@@ -7,7 +7,7 @@ services:
duniter-v2s:
container_name: duniter-v2s
# choose the version of the image here
image: duniter/duniter-v2s:v0.3.0
image: duniter/duniter-v2s:latest
ports:
# telemetry
- 9615:9615
......@@ -18,9 +18,8 @@ services:
# p2p
- 30333:30333
environment:
DUNITER_INSTANCE_NAME: "duniter_local"
DUNITER_CHAIN_NAME: "dev"
#DUNITER_DISABLE_PROMETHEUS: "false"
DUNITER_NODE_NAME: "duniter_local"
DUNITER_CHAIN_NAME: "gdev"
volumes:
- duniter-local-data:/var/lib/duniter
......
......@@ -14,7 +14,7 @@ COPY . .
RUN test -x build/duniter || \
( \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y clang \
DEBIAN_FRONTEND=noninteractive apt-get install -y clang cmake protobuf-compiler \
)
# build duniter
......
# duniter/duniter-v2s
Duniter is the software that supports the [Ğ1 libre-currency blockchain](https://duniter.org/).
[Duniter v2s](https://git.duniter.org/nodes/rust/duniter-v2s) is a complete rewrite of Duniter based on the Substrate / Polkadot framework. **This is alpha state work in progress.**
# Minimal docker-compose file for an RPC (non validator) node
```
version: "3.5"
services:
duniter-rpc:
image: duniter/duniter-v2s:latest
restart: unless-stopped
ports:
# Prometheus endpoint
- 9615:9615
# rpc via http
- 9933:9933
# rpc via websocket
- 9944:9944
# p2p
- 30333:30333
volumes:
- data-rpc:/var/lib/duniter/
environment:
- DUNITER_CHAIN_NAME=gdev
- DUNITER_NODE_NAME=<my-node-name>
volumes:
data-rpc:
```
# Minimal docker-compose file for a validator node
```
version: "3.5"
services:
duniter-validator:
image: duniter/duniter-v2s:latest
restart: unless-stopped
ports:
# Prometheus endpoint
- 9615:9615
# p2p
- 30333:30333
volumes:
- data-validator:/var/lib/duniter/
environment:
- DUNITER_CHAIN_NAME=gdev
- DUNITER_VALIDATOR=true
- DUNITER_NODE_NAME=<my-validator-node-name>
volumes:
data-validator:
```
# Environment variables
| Name | Description | Default |
| ---- | ----------- | ------- |
| `DUNITER_NODE_NAME` | The node name. This name will appear on the Substrate telemetry server when telemetry is enabled. | Random name |
| `DUNITER_CHAIN_NAME` | The currency to process. "gdev" uses the embeded chainspec. A path allows to use a local json raw chainspec. | `dev` (development mode) |
| `DUNITER_PUBLIC_ADDR` | The libp2p public address base. See [libp2p documentation](https://docs.libp2p.io/concepts/fundamentals/addressing/). This variable is useful when the node is behind a reverse-proxy with its ports not directly exposed.<br>Note: the `p2p/<peer_id>` part of the address shouldn't be set in this variable. It is automatically added by Duniter. | duniter-v2s guesses one from the node's IPv4 address. |
| `DUNITER_LISTEN_ADDR` | The libp2p listen address. See [libp2p documentation](https://docs.libp2p.io/concepts/fundamentals/addressing/). This variable is useful when running a validator node behind a reverse proxy, to force the P2P end point in websocket mode with:<br> `DUNITER_LISTEN_ADDR=/ip4/0.0.0.0/tcp/30333/ws` | Non validator node: `/ip4/0.0.0.0/tcp/30333/ws`<br>Validator node: `/ip4/0.0.0.0/tcp/30333` |
| `DUNITER_RPC_CORS` | Value of the polkadot `--rpc-cors` option. | `all` |
| `DUNITER_VALIDATOR` | Boolean (`true` / `false`) to run the node in validator mode. Configure the polkadot options `--validator --rpc-methods Unsafe`. | `false` |
| `DUNITER_DISABLE_PROMETHEUS` | Boolean to disable the Prometheus endpoint on port 9615. | `false` |
| `DUNITER_DISABLE_TELEMETRY` | Boolean to disable connecting to the Substrate tememetry server. | `false` |
# Other duniter options
You can pass any other option to duniter using the `command` docker-compose element:
```
command:
# workaround for substrate issue #12073
# https://github.com/paritytech/substrate/issues/12073
- "--wasm-execution=interpreted-i-know-what-i-do"
```
# This is a docker template for running a gdev mirror
# You should write a .env file aside with the environment variables:
#
# --- .env ---
# SERVER_DOMAIN=gdev.example.com
# PEER_ID=1234XxxXXxxXxxxXxzbQqEkEpTPxD9S1PtpzkZSYoueyERA5vVtQ
# ------------
#
# The peer id has to be replaced withe the output of the following command
#
# >>> PEER_ID >>>
# docker run --rm -it --entrypoint duniter -v $PWD:/var/lib/duniter/ duniter/duniter-v2s:v0.3.0 key generate-node-key --file /var/lib/duniter/node.key
# <<<<<<<<<<<<<<<
version: "3.4"
version: "3.5"
services:
duniter-rpc:
image: duniter/duniter-v2s:v0.3.0
image: duniter/duniter-v2s:latest
restart: unless-stopped
ports:
# telemetry
......@@ -33,15 +20,8 @@ services:
- duniter-rpc-data:/var/lib/duniter/
environment:
- DUNITER_CHAIN_NAME=gdev
command:
- "--node-key-file"
- "/var/lib/duniter/node.key"
- "--public-addr"
# SERVER_DOMAIN should be replaced by a domain name that point on your server
# PEER_ID should be replaced by the output of the command given at the top of this file
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${PEER_ID?PEER_ID should be set}"
- "--rpc-cors"
- "all"
- DUNITER_PUBLIC_ADDR=/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/ws
volumes:
duniter-rpc-data:
version: "3.4"
version: "3.5"
services:
duniter-rpc:
image: duniter/duniter-v2s:v0.3.0
image: duniter/duniter-v2s:latest
restart: unless-stopped
ports:
# telemetry
......@@ -18,18 +18,11 @@ services:
- duniter-rpc-data:/var/lib/duniter/
environment:
- DUNITER_CHAIN_NAME=gdev
command:
- "--node-key-file=/var/lib/duniter/node.key"
- "--public-addr"
# SERVER_DOMAIN should be replaced by a domain name that point on your server
#
# The PEER_ID should be replaced by the output of this command:
# docker run --rm -it --entrypoint -v $PWD/duniter-rpc/:/var/lib/duniter/ duniter duniter/duniter-v2s:v0.3.0 key generate-node-key --file /var/lib/duniter/node.key
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${PEER_ID?PEER_ID should be set}"
- "--rpc-cors=all"
# RPC_SERVER_DOMAIN should be replaced by a domain name that point on your server
- DUNITER_PUBLIC_ADDR=/dns/${RPC_SERVER_DOMAIN?RPC_SERVER_DOMAIN should be set}/tcp/30333/ws
duniter-validator:
image: duniter/duniter-v2s:v0.3.0
image: duniter/duniter-v2s:latest
restart: unless-stopped
ports:
# telemetry
......@@ -45,15 +38,8 @@ services:
- duniter-validator-data:/var/lib/duniter/
environment:
- DUNITER_CHAIN_NAME=gdev
# VALIDATOR_SERVER_DOMAIN should be replaced by a domain name that point on your server
- DUNITER_PUBLIC_ADDR=/dns/${VALIDATOR_SERVER_DOMAIN?VALIDATOR_SERVER_DOMAIN should be set}/tcp/30333
- DUNITER_VALIDATOR=true
command:
- "--node-key-file=/var/lib/duniter/node.key"
- "--public-addr"
- "--pruning=14400"
# SERVER_DOMAIN should be replaced by a domain name that point on your server
#
# The VALIDATOR_PEER_ID should be replaced by the output of this command:
# docker run --rm -it --entrypoint -v $PWD/duniter-rpc/:/var/lib/duniter/ duniter duniter/duniter-v2s:v0.3.0 key generate-node-key --file /var/lib/duniter/node.key
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${VALIDATOR_PEER_ID?VALIDATOR_PEER_ID should be set}"
- "--rpc-cors=all"
- "--rpc-methods=Unsafe"
- "--validator"
version: "3.4"
version: "3.5"
services:
duniter-rpc:
......@@ -14,10 +14,6 @@ services:
command:
- "--bootnodes"
- "/dns/duniter-validator/tcp/30333/p2p/VALIDATOR_NODE_KEY"
- "--node-key-file"
- "/var/lib/duniter/node-key"
- "--rpc-cors"
- "all"
duniter-validator:
image: duniter/duniter-v2s:DUNITER_IMAGE_TAG
......@@ -29,12 +25,7 @@ services:
- ./duniter-validator/:/var/lib/duniter/
environment:
- DUNITER_CHAIN_NAME=/var/lib/duniter/CURRENCY-raw.json
- DUNITER_VALIDATOR=true
command:
- "--bootnodes"
- "/dns/duniter-rpc/tcp/30333/p2p/RPC_NODE_KEY"
- "--node-key-file"
- "/var/lib/duniter/node-key"
- "--rpc-methods=Unsafe"
- "--validator"
- "--rpc-cors"
- "all"
......@@ -12,11 +12,48 @@ function ternary () {
fi
}
if [ -n "$DUNITER_INSTANCE_NAME" ]; then
set -- "$@" --name "$DUNITER_INSTANCE_NAME"
DUNITER_NODE_NAME="${DUNITER_NODE_NAME:-$DUNITER_INSTANCE_NAME}"
if [ -n "$DUNITER_NODE_NAME" ]; then
set -- "$@" --name "$DUNITER_NODE_NAME"
fi
_DUNITER_KEY_FILE=/var/lib/duniter/node.key
set -- "$@" --node-key-file "$_DUNITER_KEY_FILE"
if [ ! -f "$_DUNITER_KEY_FILE" ]; then
echo "Generating node key file '$_DUNITER_KEY_FILE'..."
duniter key generate-node-key --file "$_DUNITER_KEY_FILE"
else
echo "Node key file '$_DUNITER_KEY_FILE' exists."
fi
_DUNITER_PEER_ID="$(duniter key inspect-node-key --file "$_DUNITER_KEY_FILE")"
echo "Node peer ID is '$_DUNITER_PEER_ID'."
if [ -n "$DUNITER_PUBLIC_ADDR" ]; then
set -- "$@" --public-addr "$DUNITER_PUBLIC_ADDR"
fi
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"
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
DUNITER_CHAIN_NAME="${DUNITER_CHAIN_NAME:-dev}"
case "$DUNITER_CHAIN_NAME" in
......@@ -30,7 +67,6 @@ esac
set -- "$@" \
"${chain[@]}" \
$(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \
-d /var/lib/duniter --unsafe-rpc-external --unsafe-ws-external
echo "Starting duniter with parameters:" "$@"
......
This diff is collapsed.
......@@ -45,6 +45,10 @@ An example of genesis configuration file: `resources/gdev.json`
## 5. Generate raw spec
```docker
docker run -v $HOME/dev/duniter-v2s/resources:/var/lib/duniter/resources -e DUNITER_GENESIS_CONFIG=/var/lib/duniter/resources/gdev.json --rm -it --entrypoint duniter duniter/duniter-v2s:TAG build-spec -lerror --chain=gdev-gl --raw > name-raw.json
```
```bash
./scripts/gen-live-network-raw-spec.sh CURRENCY "<path/to/your/genesis/config/file>"
```
......
# Upgrade Substrate
We need to keep up to date with Substrate. Here is an empirical guide.
Let's say for the example that we want to upgrade from `v0.9.26` to `v0.9.32`.
## Upgrade Substrate fork
TBD (only Élois has done this for now)
## Upgrade Subxt fork
1. Checkout the currently used branch in [our Subxt fork](https://github.com/duniter/subxt), e.g. `duniter-substrate-v0.9.26`
2. Create a new branch `duniter-substrate-v0.9.32`
3. Fetch the [upstream repository](https://github.com/paritytech/subxt)
4. Rebase on an upstream stable branch matching the wanted version
## Upgrade Duniter
1. Replace `duniter-substrate-v0.9.26` with `duniter-substrate-v0.9.32` in `Cargo.toml`
2. Update the `rust-toolchain` file according to [Polkadot release notes](https://github.com/paritytech/polkadot/releases)
* Tip: To save storage space on your machine, do `rm target -r` after changing the rust toolchain version and before re-building the project with the new version.
3. While needed, iterate `cargo check`, `cargo update` and upgrading dependencies to match substrate's dependencies
4. Fix errors in Duniter code
* You may need to check how Polkadot is doing by searching in [their repo](https://github.com/paritytech/polkadot). Luckily, the project structure and Substrate patterns are close enough to ours.
* Some errors may happen due to two semver-incompatible versions of a same crate being used. To check this, use `cargo tree -i <crate>`. Update the dependency accordingly, then do `cargo update`.
5. As always, don't forget to `clippy` once you're done with the errors.
6. Test benchmarking:
`cargo run --features runtime-benchmarks -- benchmark overhead --chain=dev --execution=wasm --wasm-execution=interpreted-i-know-what-i-do --weight-path=. --warmup=10 --repeat=100`
\ No newline at end of file
# How to benchmarks weights of a Call/Hook/Pallet
# Weights benchmarking
## What is the reference machine?
For now (09/2022), it's a `Raspberry Pi 4 Model B - 4GB` with an SSD connected via USB3.
To cross-compile the benchmarks binary for armv7:
```
./scripts/cross-build-arm.sh --features runtime-benchmarks
```
The cross compiled binary is generated here: `target/armv7-unknown-linux-gnueabihf/release/duniter`
## How to benchmarks weights of a Call/Hook/Pallet
1. Create the benchmarking tests, see commit 31057e37be471e3f27d18c63818d57cc907b4b4f for a
complete real example.
......@@ -19,15 +33,27 @@ Note 1: You *must* replace `CURRENCY` by the currency type, or for ĞDev use dir
Note 2: If the reference machine does not support wasmtime, you should replace `--wasm-execution=compiled`
by `--wasm-execution=interpreted-i-know-what-i-do`.
## What is the reference machine?
For now (09/2022), it's a `Raspberry Pi 4 Model B - 4GB` with an SSD connected via USB3.
## Generate base block benchmarking
To cross-compile the benchmarks binary for armv7:
1. Build binary for reference machine and copy it on reference machine.
2. Run base block benchmarks command:
```
./scripts/cross-build-arm.sh --features runtime-benchmarks
./duniter benchmark overhead --chain=gdev --execution=wasm --wasm-execution=interpreted-i-know-what-i-do --weight-path=. --warmup=10 --repeat=100
```
3. Copy the generated file `block_weights.rs` in the codebase in folder `runtime/common/src/weights/`.
4. Commit changes and open an MR.
The cross compiled binary is generated here: `target/armv7-unknown-linux-gnueabihf/release/duniter`
## Generate storage benchmarking
1. Build binary for reference machine and copy it on reference machine.
2. Copy a DB on reference machine (on ssd), example: `scp -r -P 37015 tmp/t1 pi@192.168.1.188:/mnt/ssd1/duniter-v2s/`
3. Run storage benchmarks command, example:
```
./duniter benchmark storage -d=/mnt/ssd1/duniter-v2s/t1 --chain=gdev --mul=2 --weight-path=. --state-version=1
```
4. Copy the generated file `paritydb_weights.rs` in the codebase in folder `runtime/common/src/weights/`.
5. Commit changes and open an MR.
......@@ -5,19 +5,14 @@
### Duniter part
- Add this docker-compose template on your server:
[docker/compose/gdev-rpc.docker-compose.yml](https://git.duniter.org/nodes/rust/duniter-v2s/-/blob/master/docker/compose/gdev-mirror.docker-compose.yml)
[docker/compose/gdev-rpc.docker-compose.yml](https://git.duniter.org/nodes/rust/duniter-v2s/-/blob/master/docker/compose/gdev-mirror.docker-compose.yml)
- Rename the file : `mv gdev-mirror.docker-compose.yml docker-compose.yml`
- In the same folder, create a `.env` file that defime environment variables `SERVER_DOMAIN` and `PEER_ID`:
- In the same folder, create a `.env` file that defime environment variables `SERVER_DOMAIN`:
```bash
SERVER_DOMAIN=YOUR_DOMAIN
PEER_ID=YOUR_PEER_ID
```
Your `PEER_ID` shoud be generated with this command:
```bash
docker run --rm -it --entrypoint duniter -v $PWD:/var/lib/duniter/ duniter/duniter-v2s:v0.3.0 key generate-node-key --file /var/lib/duniter/node.key
```
- If you have write access errors run in docker-compose.yml folder : `chmod o+rwX -R .`
- Do `docker compose up -d` to start your node
### Reverse-proxy part (with Nginx)
......@@ -63,6 +58,7 @@ server {
}
}
```
and replace `YOUR_DOMAIN` by your domain each time.
- [generate your ssl certificates](https://github.com/acmesh-official/acme.sh) with let's encrypt
......
......@@ -5,13 +5,13 @@
### Duniter part
- Add this docker-compose on your server :
[docker/compose/gdev-validator.docker-compose.yml](https://git.duniter.org/nodes/rust/duniter-v2s/-/blob/master/docker/compose/gdev-validator.docker-compose.yml)
- Create a `.env` file that define environment variables `SERVER_DOMAIN`, `PEER_ID` and `VALIDATOR_PEER_ID`:
- `SERVER_DOMAIN`: a domain name that point on your server
- `PEER_ID`: Your rpc node peer id, shoud be generated with this command: `docker run --rm -it --entrypoint -v $PWD:/var/lib/duniter/ duniter duniter/duniter-v2s:v0.3.0 key generate-node-key --file /var/lib/duniter/rpc-node.key`
- `VALIDATOR_PEER_ID`: Your validator node peer id, shoud be generated with this command: `docker run --rm -it --entrypoint -v $PWD:/var/lib/duniter/ duniter duniter/duniter-v2s:v0.3.0 key generate-node-key --file /var/lib/duniter/validator-node.key`
Note: duniter-rpc PEER_ID and duniter-validator PEER_ID isn't the same.
- If you have write access errors run in docker-compose.yml folder : `chmod o+rwX -R .`
[docker/compose/gdev-validator.docker-compose.yml](https://git.duniter.org/nodes/rust/duniter-v2s/-/blob/master/docker/compose/gdev-validator.docker-compose.yml)
- Create a `.env` file that define environment variable `SERVER_DOMAIN`:
```bash
SERVER_DOMAIN=YOUR_DOMAIN
```
- `docker compose up -d` to start your node
### Reverse-proxy part (with Nginx)
......@@ -57,6 +57,7 @@ server {
}
}
```
and replace `YOUR_DOMAIN` by your domain each time.
- [generate your ssl certificates](https://github.com/acmesh-official/acme.sh) with let's encrypt
......
......@@ -11,7 +11,7 @@ version = '3.0.0'
[dev-dependencies]
anyhow = "1.0"
async-trait = "0.1"
clap = { version = "3.0", features = ["derive"] }
clap = { version = "3.2.23", features = ["derive"] }
ctrlc = "3.2.2"
cucumber = "0.11"
env_logger = "0.9.0"
......@@ -20,8 +20,8 @@ notify = "4.0"
parity-scale-codec = "3.1.5"
portpicker = "0.1.1"
serde_json = "1.0.64"
sp-keyring = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" }
subxt = { git = 'https://github.com/duniter/subxt.git', branch = 'duniter-substrate-v0.9.26' }
sp-keyring = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
subxt = { git = 'https://github.com/duniter/subxt.git', branch = 'duniter-substrate-v0.9.32' }
tokio = { version = "1.15.0", features = ["macros"] }
[[test]]
......
......@@ -85,7 +85,7 @@ pub async fn get_identity_value(world: &mut DuniterWorld, account: String) -> Re
.unwrap();
let identity_value = world
.read(&gdev::storage().identity().identities(&identity_index))
.read(&gdev::storage().identity().identities(identity_index))
.await?
.ok_or_else(|| {
anyhow::anyhow!(
......