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: ...@@ -39,7 +39,7 @@ check_labels:
.env: .env:
image: paritytech/ci-linux:production image: paritytech/ci-linux:production
tags: tags:
- elois-neutron - dind
fmt_and_clippy: fmt_and_clippy:
extends: .env extends: .env
...@@ -159,10 +159,12 @@ tests_debug: ...@@ -159,10 +159,12 @@ tests_debug:
DUNITER_END2END_TESTS_SPAWN_NODE_TIMEOUT: "20" DUNITER_END2END_TESTS_SPAWN_NODE_TIMEOUT: "20"
script: script:
- cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests - cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests
- cargo cucumber -i balance* - cargo cucumber -i account_creation*
- cargo cucumber -i monetary*
- cargo cucumber -i transfer*
- cargo cucumber -i certification* - 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: after_script:
- cd target/debug/deps/ - cd target/debug/deps/
- rm cucumber_tests-*.d - rm cucumber_tests-*.d
...@@ -183,9 +185,12 @@ tests_release: ...@@ -183,9 +185,12 @@ tests_release:
DUNITER_END2END_TESTS_SPAWN_NODE_TIMEOUT: "20" DUNITER_END2END_TESTS_SPAWN_NODE_TIMEOUT: "20"
script: script:
- cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests - cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests
- cargo cucumber -i balance* - cargo cucumber -i account_creation*
- cargo cucumber -i monetary* - cargo cucumber -i certification*
- cargo cucumber -i transfer* - cargo cucumber -i identity_creation*
- cargo cucumber -i monetary_mass*
- cargo cucumber -i oneshot_account*
- cargo cucumber -i transfer_all*
after_script: after_script:
- cd target/debug/deps/ - cd target/debug/deps/
- rm cucumber_tests-*.d - rm cucumber_tests-*.d
...@@ -201,9 +206,9 @@ tests_release: ...@@ -201,9 +206,9 @@ tests_release:
stage: deploy stage: deploy
image: docker:18.06 image: docker:18.06
tags: tags:
- redshift - docker
services: services:
- docker:18.06-dind - docker:dind
before_script: before_script:
- docker info - docker info
script: script:
......
...@@ -9,7 +9,12 @@ ...@@ -9,7 +9,12 @@
"request": "launch", "request": "launch",
"name": "Debug unit tests in library 'duniter'", "name": "Debug unit tests in library 'duniter'",
"cargo": { "cargo": {
"args": ["test", "--no-run", "--lib", "--package=duniter"], "args": [
"test",
"--no-run",
"--lib",
"--package=duniter"
],
"filter": { "filter": {
"name": "duniter", "name": "duniter",
"kind": "lib" "kind": "lib"
...@@ -23,13 +28,20 @@ ...@@ -23,13 +28,20 @@
"request": "launch", "request": "launch",
"name": "Debug executable 'duniter'", "name": "Debug executable 'duniter'",
"cargo": { "cargo": {
"args": ["build"], "args": [
"build"
],
"filter": { "filter": {
"name": "duniter", "name": "duniter",
"kind": "bin" "kind": "bin"
} }
}, },
"args": ["--tmp", "--dev", "--execution", "Native"], "args": [
"--tmp",
"--dev",
"--execution",
"Native"
],
"cwd": "${workspaceFolder}" "cwd": "${workspaceFolder}"
}, },
{ {
...@@ -37,7 +49,12 @@ ...@@ -37,7 +49,12 @@
"request": "launch", "request": "launch",
"name": "Debug unit tests in executable 'duniter'", "name": "Debug unit tests in executable 'duniter'",
"cargo": { "cargo": {
"args": ["test", "--no-run", "--bin=duniter", "--package=duniter"], "args": [
"test",
"--no-run",
"--bin=duniter",
"--package=duniter"
],
"filter": { "filter": {
"name": "duniter", "name": "duniter",
"kind": "bin" "kind": "bin"
...@@ -51,7 +68,12 @@ ...@@ -51,7 +68,12 @@
"request": "launch", "request": "launch",
"name": "Debug unit tests in library 'gdev-runtime'", "name": "Debug unit tests in library 'gdev-runtime'",
"cargo": { "cargo": {
"args": ["test", "--no-run", "--lib", "--package=gdev-runtime"], "args": [
"test",
"--no-run",
"--lib",
"--package=gdev-runtime"
],
"filter": { "filter": {
"name": "gdev-runtime", "name": "gdev-runtime",
"kind": "lib" "kind": "lib"
...@@ -65,7 +87,12 @@ ...@@ -65,7 +87,12 @@
"request": "launch", "request": "launch",
"name": "Debug unit tests in library 'pallet-certification'", "name": "Debug unit tests in library 'pallet-certification'",
"cargo": { "cargo": {
"args": ["test", "--no-run", "--lib", "--package=pallet-certification"], "args": [
"test",
"--no-run",
"--lib",
"--package=pallet-certification"
],
"filter": { "filter": {
"name": "pallet-certification", "name": "pallet-certification",
"kind": "lib" "kind": "lib"
...@@ -79,7 +106,12 @@ ...@@ -79,7 +106,12 @@
"request": "launch", "request": "launch",
"name": "Debug unit tests in library 'pallet-identity'", "name": "Debug unit tests in library 'pallet-identity'",
"cargo": { "cargo": {
"args": ["test", "--no-run", "--lib", "--package=pallet-identity"], "args": [
"test",
"--no-run",
"--lib",
"--package=pallet-identity"
],
"filter": { "filter": {
"name": "pallet-identity", "name": "pallet-identity",
"kind": "lib" "kind": "lib"
...@@ -108,4 +140,4 @@ ...@@ -108,4 +140,4 @@
"cwd": "${workspaceFolder}" "cwd": "${workspaceFolder}"
} }
] ]
} }
\ No newline at end of file
source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -29,27 +29,28 @@ runtime-benchmarks = [ ...@@ -29,27 +29,28 @@ runtime-benchmarks = [
'gdev-runtime/runtime-benchmarks', 'gdev-runtime/runtime-benchmarks',
#'gtest-runtime', #'gtest-runtime',
#'gtest-runtime/runtime-benchmarks', #'gtest-runtime/runtime-benchmarks',
'sc-client-db/runtime-benchmarks',
] ]
try-runtime = [ try-runtime = [
"g1-runtime/try-runtime", #"g1-runtime/try-runtime",
"gdev-runtime/try-runtime", "gdev-runtime/try-runtime",
"gtest-runtime/try-runtime", #"gtest-runtime/try-runtime",
"try-runtime-cli" "try-runtime-cli"
] ]
[build-dependencies] [build-dependencies]
clap = { version = "3.0" } clap = { version = "4.0" }
#clap_complete = { version = "3.0" } #clap_complete = { version = "4.0" }
substrate-build-script-utils = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26' } substrate-build-script-utils = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32' }
[dev-dependencies] [dev-dependencies]
rusty-hook = "^0.11.2" rusty-hook = "^0.11.2"
# Dependencies for specific targets # Dependencies for specific targets
[target.'cfg(any(target_arch="x86_64", target_arch="aarch64"))'.dependencies] [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-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.26", 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.26", features = ["memory-tracker"] } sp-trie = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", features = ["memory-tracker"] }
[dependencies] [dependencies]
...@@ -59,67 +60,71 @@ g1-runtime = { path = 'runtime/g1', optional = true } ...@@ -59,67 +60,71 @@ g1-runtime = { path = 'runtime/g1', optional = true }
gdev-runtime = { path = 'runtime/gdev', optional = true } gdev-runtime = { path = 'runtime/gdev', optional = true }
gtest-runtime = { path = 'runtime/gtest', optional = true } gtest-runtime = { path = 'runtime/gtest', optional = true }
pallet-certification = { path = 'pallets/certification' } pallet-certification = { path = 'pallets/certification' }
pallet-oneshot-account = { path = 'pallets/oneshot-account' }
sp-membership = { path = 'primitives/membership' } sp-membership = { path = 'primitives/membership' }
# crates.io dependencies # crates.io dependencies
async-io = "1.3" async-io = "1.3"
clap = { version = "3.0", features = ["derive"] } clap = { version = "4.0", features = ["derive"] }
clap_complete = { version = "3" } clap_complete = { version = "4" }
futures = { version = "0.3.1", features = ["compat"] } futures = { version = "0.3.1", features = ["compat"] }
hex = "0.4.3" hex = "0.4.3"
jsonrpsee = { version = "0.14.0", features = ["server"] } jsonrpsee = { version = "0.15.1", features = ["server"] }
lazy_static = "1.4.0" lazy_static = "1.4.0"
log = "0.4" log = "0.4"
maplit = '1.0.2' maplit = '1.0.2'
memmap2 = "0.5.0" memmap2 = "0.5.0"
serde = "1.0" serde = "1.0"
serde_json = "1.0.64" serde_json = "1.0.64"
tracing-core = "=0.1.26" tracing-core = "0.1.28"
# substrate dependencies # substrate dependencies
frame-benchmarking = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" } 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.26" } frame-benchmarking-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
pallet-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" } frame-system = { 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.26" } pallet-grandpa = { 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.26" } pallet-transaction-payment = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false }
sc-basic-authorship = { 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.32" }
sc-chain-spec = { 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.32" }
sc-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26", default-features = false } sc-basic-authorship = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-client-api = { 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.32" }
sc-consensus = { 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.32", default-features = false }
babe = { package = "sc-consensus-babe", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" } sc-client-api = { 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.26" } sc-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-consensus-uncles = { 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.32" }
sc-executor = { 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.32" }
sc-finality-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" } sc-client-db = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32", default-features = false }
sc-keystore = { 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.32" }
sc-network = { 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.32" }
sc-rpc-api = { 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.32" }
sc-service = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26", default-features = false } sc-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
sc-telemetry = { 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.32" }
sc-transaction-pool = { 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.32" }
sc-transaction-pool-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.32", default-features = false }
sp-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.26" } sc-telemetry = { 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.26" } sc-transaction-pool = { 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.26" } sc-transaction-pool-api = { 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.26" } sp-api = { 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.26" } sp-authority-discovery = { 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.26" } sp-block-builder = { 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.26" } sp-blockchain = { 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.26" } sp-consensus = { 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.26" } sp-consensus-babe = { 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.26" } sp-core = { 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.26" } sp-finality-grandpa = { 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.26" } sp-inherents = { 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.26" } sp-io = { 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.26" } sp-offchain = { 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.26" } sp-keyring = { 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.26" } sp-keystore = { 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.26" } sp-runtime = { 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.26" } sp-session = { 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.26" } sp-storage = { 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.26" } sp-timestamp = { 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.26", optional = true } 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] [workspace]
resolver = "2" resolver = "2"
...@@ -204,6 +209,74 @@ zeroize = { opt-level = 3 } ...@@ -204,6 +209,74 @@ zeroize = { opt-level = 3 }
panic = "unwind" panic = "unwind"
[patch.crates-io] [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 #[patch."https://github.com/duniter/substrate"]
#rw-stream-sink = { git = "https://github.com/librelois/rw-stream-sink", branch = "master" } #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 @@ ...@@ -28,6 +28,7 @@
- [setup](./docs/dev/setup.md) - [setup](./docs/dev/setup.md)
- [verify-runtime-code](./docs/dev/verify-runtime-code.md) - [verify-runtime-code](./docs/dev/verify-runtime-code.md)
- [weights-benchmarking](./docs/dev/weights-benchmarking.md) - [weights-benchmarking](./docs/dev/weights-benchmarking.md)
- [upgrade-substrate](./docs/dev/upgrade-substrate.md)
- [test](./docs/test/) - [test](./docs/test/)
- [replay-block](./docs/test/replay-block.md) - [replay-block](./docs/test/replay-block.md)
- [user](./docs/user/) - [user](./docs/user/)
...@@ -35,8 +36,8 @@ ...@@ -35,8 +36,8 @@
- [build-for-arm](./docs/user/build-for-arm.md) - [build-for-arm](./docs/user/build-for-arm.md)
- [rpc](./docs/user/rpc.md) deploy a permanent ǦDev mirror node - [rpc](./docs/user/rpc.md) deploy a permanent ǦDev mirror node
- [smith](./docs/user/smith.md) deploy a permanent ǦDev validator node - [smith](./docs/user/smith.md) deploy a permanent ǦDev validator node
- [end2end-tests](./end2end-tests/) automated end to end tests written with cucumber - [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 - [live-tests](./live-tests/) sanity checks to test the storage of a live chain
## Use ## Use
...@@ -47,7 +48,7 @@ The easiest way is to use the docker image. ...@@ -47,7 +48,7 @@ The easiest way is to use the docker image.
Minimal command to deploy a **temporary** mirror peer: Minimal command to deploy a **temporary** mirror peer:
```docker ```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). 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 ...@@ -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. to develop/test an application that interacts with the blockchain.
```docker ```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. 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 ...@@ -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: 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=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=manual`: produce a block upon receiving an RPC request (method `engine_createBlock`).
### Autocompletion ### Autocompletion
...@@ -278,3 +279,21 @@ A FRAME pallet is compromised of a number of blockchain primitives: ...@@ -278,3 +279,21 @@ A FRAME pallet is compromised of a number of blockchain primitives:
- Errors: When a dispatchable fails, it returns an error. - Errors: When a dispatchable fails, it returns an error.
- Config: The `Config` configuration interface is used to define the types and parameters upon - Config: The `Config` configuration interface is used to define the types and parameters upon
which a FRAME pallet depends. 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: ...@@ -7,7 +7,7 @@ services:
duniter-v2s: duniter-v2s:
container_name: duniter-v2s container_name: duniter-v2s
# choose the version of the image here # choose the version of the image here
image: duniter/duniter-v2s:v0.3.0 image: duniter/duniter-v2s:latest
ports: ports:
# telemetry # telemetry
- 9615:9615 - 9615:9615
...@@ -18,9 +18,8 @@ services: ...@@ -18,9 +18,8 @@ services:
# p2p # p2p
- 30333:30333 - 30333:30333
environment: environment:
DUNITER_INSTANCE_NAME: "duniter_local" DUNITER_NODE_NAME: "duniter_local"
DUNITER_CHAIN_NAME: "dev" DUNITER_CHAIN_NAME: "gdev"
#DUNITER_DISABLE_PROMETHEUS: "false"
volumes: volumes:
- duniter-local-data:/var/lib/duniter - duniter-local-data:/var/lib/duniter
......
...@@ -14,7 +14,7 @@ COPY . . ...@@ -14,7 +14,7 @@ COPY . .
RUN test -x build/duniter || \ RUN test -x build/duniter || \
( \ ( \
apt-get update && \ apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y clang \ DEBIAN_FRONTEND=noninteractive apt-get install -y clang cmake protobuf-compiler \
) )
# build duniter # 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 # 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.5"
version: "3.4"
services: services:
duniter-rpc: duniter-rpc:
image: duniter/duniter-v2s:v0.3.0 image: duniter/duniter-v2s:latest
restart: unless-stopped restart: unless-stopped
ports: ports:
# telemetry # telemetry
...@@ -33,15 +20,8 @@ services: ...@@ -33,15 +20,8 @@ services:
- duniter-rpc-data:/var/lib/duniter/ - duniter-rpc-data:/var/lib/duniter/
environment: environment:
- DUNITER_CHAIN_NAME=gdev - 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 # 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 - DUNITER_PUBLIC_ADDR=/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/ws
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${PEER_ID?PEER_ID should be set}"
- "--rpc-cors"
- "all"
volumes: volumes:
duniter-rpc-data: duniter-rpc-data:
version: "3.4" version: "3.5"
services: services:
duniter-rpc: duniter-rpc:
image: duniter/duniter-v2s:v0.3.0 image: duniter/duniter-v2s:latest
restart: unless-stopped restart: unless-stopped
ports: ports:
# telemetry # telemetry
...@@ -18,18 +18,11 @@ services: ...@@ -18,18 +18,11 @@ services:
- duniter-rpc-data:/var/lib/duniter/ - duniter-rpc-data:/var/lib/duniter/
environment: environment:
- DUNITER_CHAIN_NAME=gdev - DUNITER_CHAIN_NAME=gdev
command: # RPC_SERVER_DOMAIN should be replaced by a domain name that point on your server
- "--node-key-file=/var/lib/duniter/node.key" - DUNITER_PUBLIC_ADDR=/dns/${RPC_SERVER_DOMAIN?RPC_SERVER_DOMAIN should be set}/tcp/30333/ws
- "--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"
duniter-validator: duniter-validator:
image: duniter/duniter-v2s:v0.3.0 image: duniter/duniter-v2s:latest
restart: unless-stopped restart: unless-stopped
ports: ports:
# telemetry # telemetry
...@@ -45,15 +38,8 @@ services: ...@@ -45,15 +38,8 @@ services:
- duniter-validator-data:/var/lib/duniter/ - duniter-validator-data:/var/lib/duniter/
environment: environment:
- DUNITER_CHAIN_NAME=gdev - 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: command:
- "--node-key-file=/var/lib/duniter/node.key"
- "--public-addr"
- "--pruning=14400" - "--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: services:
duniter-rpc: duniter-rpc:
...@@ -14,10 +14,6 @@ services: ...@@ -14,10 +14,6 @@ services:
command: command:
- "--bootnodes" - "--bootnodes"
- "/dns/duniter-validator/tcp/30333/p2p/VALIDATOR_NODE_KEY" - "/dns/duniter-validator/tcp/30333/p2p/VALIDATOR_NODE_KEY"
- "--node-key-file"
- "/var/lib/duniter/node-key"
- "--rpc-cors"
- "all"
duniter-validator: duniter-validator:
image: duniter/duniter-v2s:DUNITER_IMAGE_TAG image: duniter/duniter-v2s:DUNITER_IMAGE_TAG
...@@ -29,12 +25,7 @@ services: ...@@ -29,12 +25,7 @@ services:
- ./duniter-validator/:/var/lib/duniter/ - ./duniter-validator/:/var/lib/duniter/
environment: environment:
- DUNITER_CHAIN_NAME=/var/lib/duniter/CURRENCY-raw.json - DUNITER_CHAIN_NAME=/var/lib/duniter/CURRENCY-raw.json
- DUNITER_VALIDATOR=true
command: command:
- "--bootnodes" - "--bootnodes"
- "/dns/duniter-rpc/tcp/30333/p2p/RPC_NODE_KEY" - "/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 () { ...@@ -12,11 +12,48 @@ function ternary () {
fi fi
} }
if [ -n "$DUNITER_INSTANCE_NAME" ]; then DUNITER_NODE_NAME="${DUNITER_NODE_NAME:-$DUNITER_INSTANCE_NAME}"
set -- "$@" --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 fi
DUNITER_DISABLE_PROMETHEUS=$(boolean "${DUNITER_DISABLE_PROMETHEUS:-false}") 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}" DUNITER_CHAIN_NAME="${DUNITER_CHAIN_NAME:-dev}"
case "$DUNITER_CHAIN_NAME" in case "$DUNITER_CHAIN_NAME" in
...@@ -30,7 +67,6 @@ esac ...@@ -30,7 +67,6 @@ esac
set -- "$@" \ set -- "$@" \
"${chain[@]}" \ "${chain[@]}" \
$(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \
-d /var/lib/duniter --unsafe-rpc-external --unsafe-ws-external -d /var/lib/duniter --unsafe-rpc-external --unsafe-ws-external
echo "Starting duniter with parameters:" "$@" echo "Starting duniter with parameters:" "$@"
......
...@@ -2,196 +2,140 @@ ...@@ -2,196 +2,140 @@
Calls are categorized according to the dispatch origin they require: Calls are categorized according to the dispatch origin they require:
1. User calls: the dispatch origin for this kind of call must be Signed by 1. **User calls**: the dispatch origin for this kind of call must be signed by
the transactor. This is the only call category that can be submitted with an extrinsic. the transactor. This is the only call category that can be submitted with an extrinsic.
1. Root calls: This kind of call requires a special origin that can only be invoked 1. **Root calls**: This kind of call requires a special origin that can only be invoked
through on-chain governance mechanisms. through on-chain governance mechanisms.
1. Inherent calls: This kind of call is invoked by the author of the block itself 1. **Inherent calls**: This kind of call is invoked by the author of the block itself
(usually automatically by the node). (usually automatically by the node).
1. Disabled calls: These calls are disabled for different reasons (to be documented). 1. **Disabled calls**: These calls can not be called directly, they are reserved for internal use by other runtime calls.
## User calls ## User calls
There are **53** user calls organized in **18** pallets. There are **68** user calls from **21** pallets.
### 2: Scheduler ### Scheduler - 2
<details><summary>0: schedule(when, maybe_periodic, priority, call)</summary> #### schedule - 0
<p>
### Index <details><summary><code>schedule(when, maybe_periodic, priority, call)</code></summary>
`0`
### Documentation
Anonymously schedule a task.
### Types of parameters
```rust ```rust
when: T::BlockNumber, when: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>, maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority, priority: schedule::Priority
call: Box<CallOrHashOf<T>> call: Box<CallOrHashOf<T>>
``` ```
</p>
</details> </details>
<details><summary>1: cancel(when, index)</summary>
<p>
### Index
`1` Anonymously schedule a task.
### Documentation
Cancel an anonymously scheduled task. #### cancel - 1
### Types of parameters <details><summary><code>cancel(when, index)</code></summary>
```rust ```rust
when: T::BlockNumber, when: T::BlockNumber
index: u32 index: u32
``` ```
</p>
</details> </details>
<details><summary>2: schedule_named(id, when, maybe_periodic, priority, call)</summary>
<p>
### Index Cancel an anonymously scheduled task.
`2`
### Documentation #### schedule_named - 2
Schedule a named task. <details><summary><code>schedule_named(id, when, maybe_periodic, priority, call)</code></summary>
### Types of parameters
```rust ```rust
id: Vec<u8>, id: Vec<u8>
when: T::BlockNumber, when: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>, maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority, priority: schedule::Priority
call: Box<CallOrHashOf<T>> call: Box<CallOrHashOf<T>>
``` ```
</p>
</details> </details>
<details><summary>3: cancel_named(id)</summary>
<p>
### Index
`3` Schedule a named task.
### Documentation
Cancel a named scheduled task. #### cancel_named - 3
### Types of parameters <details><summary><code>cancel_named(id)</code></summary>
```rust ```rust
id: Vec<u8> id: Vec<u8>
``` ```
</p>
</details> </details>
<details><summary>4: schedule_after(after, maybe_periodic, priority, call)</summary>
<p>
### Index
`4`
### Documentation Cancel a named scheduled task.
Anonymously schedule a task after a delay.
#### schedule_after - 4
### Types of parameters <details><summary><code>schedule_after(after, maybe_periodic, priority, call)</code></summary>
```rust ```rust
after: T::BlockNumber, after: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>, maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority, priority: schedule::Priority
call: Box<CallOrHashOf<T>> call: Box<CallOrHashOf<T>>
``` ```
</p>
</details> </details>
<details><summary>5: schedule_named_after(id, after, maybe_periodic, priority, call)</summary>
<p>
### Index
`5` Anonymously schedule a task after a delay.
### Documentation
Schedule a named task after a delay. #### schedule_named_after - 5
<details><summary><code>schedule_named_after(id, after, maybe_periodic, priority, call)</code></summary>
### Types of parameters
```rust ```rust
id: Vec<u8>, id: Vec<u8>
after: T::BlockNumber, after: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>, maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority, priority: schedule::Priority
call: Box<CallOrHashOf<T>> call: Box<CallOrHashOf<T>>
``` ```
</p>
</details> </details>
### 3: Babe Schedule a named task after a delay.
<details><summary>0: report_equivocation(equivocation_proof, key_owner_proof)</summary>
<p>
### Index
`0`
### Documentation ### Babe - 3
Report authority equivocation/misbehavior. This method will verify #### report_equivocation - 0
the equivocation proof and validate the given key ownership proof
against the extracted offender. If both are valid, the offence will
be reported.
### Types of parameters <details><summary><code>report_equivocation(equivocation_proof, key_owner_proof)</code></summary>
```rust ```rust
equivocation_proof: Box<EquivocationProof<T::Header>>, equivocation_proof: Box<EquivocationProof<T::Header>>
key_owner_proof: T::KeyOwnerProof key_owner_proof: T::KeyOwnerProof
``` ```
</p>
</details> </details>
### 6: Balances Report authority equivocation/misbehavior. This method will verify
the equivocation proof and validate the given key ownership proof
against the extracted offender. If both are valid, the offence will
be reported.
<details><summary>0: transfer(dest, value)</summary> ### Balances - 6
<p>
### Index #### transfer - 0
`0` <details><summary><code>transfer(dest, value)</code></summary>
```rust
dest: <T::Lookup as StaticLookup>::Source
value: T::Balance
```
</details>
### Documentation
Transfer some liquid free balance to another account. Transfer some liquid free balance to another account.
...@@ -202,24 +146,16 @@ of the transfer, the account will be reaped. ...@@ -202,24 +146,16 @@ of the transfer, the account will be reaped.
The dispatch origin for this call must be `Signed` by the transactor. The dispatch origin for this call must be `Signed` by the transactor.
### Types of parameters #### transfer_keep_alive - 3
<details><summary><code>transfer_keep_alive(dest, value)</code></summary>
```rust ```rust
dest: <T::Lookup as StaticLookup>::Source, dest: <T::Lookup as StaticLookup>::Source
value: T::Balance value: T::Balance
``` ```
</p>
</details> </details>
<details><summary>3: transfer_keep_alive(dest, value)</summary>
<p>
### Index
`3`
### Documentation
Same as the [`transfer`] call, but with a check that the transfer will not kill the Same as the [`transfer`] call, but with a check that the transfer will not kill the
origin account. origin account.
...@@ -228,24 +164,16 @@ origin account. ...@@ -228,24 +164,16 @@ origin account.
[`transfer`]: struct.Pallet.html#method.transfer [`transfer`]: struct.Pallet.html#method.transfer
### Types of parameters #### transfer_all - 4
<details><summary><code>transfer_all(dest, keep_alive)</code></summary>
```rust ```rust
dest: <T::Lookup as StaticLookup>::Source, dest: <T::Lookup as StaticLookup>::Source
value: T::Balance keep_alive: bool
``` ```
</p>
</details> </details>
<details><summary>4: transfer_all(dest, keep_alive)</summary>
<p>
### Index
`4`
### Documentation
Transfer the entire transferable balance from the caller account. Transfer the entire transferable balance from the caller account.
...@@ -265,509 +193,555 @@ The dispatch origin of this call must be Signed. ...@@ -265,509 +193,555 @@ The dispatch origin of this call must be Signed.
- O(1). Just like transfer, but reading the user's transferable balance first. - O(1). Just like transfer, but reading the user's transferable balance first.
#</weight> #</weight>
### Types of parameters ### OneshotAccount - 7
#### create_oneshot_account - 0
<details><summary><code>create_oneshot_account(dest, value)</code></summary>
```rust ```rust
dest: <T::Lookup as StaticLookup>::Source, dest: <T::Lookup as StaticLookup>::Source
keep_alive: bool value: <T::Currency as Currency<T::AccountId>>::Balance
``` ```
</p>
</details> </details>
### 10: AuthorityMembers Create an account that can only be consumed once
<details><summary>0: go_offline()</summary> - `dest`: The oneshot account to be created.
<p> - `balance`: The balance to be transfered to this oneshot account.
### Index Origin account is kept alive.
`0` #### consume_oneshot_account - 1
### Documentation <details><summary><code>consume_oneshot_account(block_height, dest)</code></summary>
```rust
block_height: T::BlockNumber
dest: Account<<T::Lookup as StaticLookup>::Source>
```
</details>
Consume a oneshot account and transfer its balance to an account
- `block_height`: Must be a recent block number. The limit is `BlockHashCount` in the past. (this is to prevent replay attacks)
- `dest`: The destination account.
- `dest_is_oneshot`: If set to `true`, then a oneshot account is created at `dest`. Else, `dest` has to be an existing account.
</p> #### consume_oneshot_account_with_remaining - 2
<details><summary><code>consume_oneshot_account_with_remaining(block_height, dest, remaining_to, balance)</code></summary>
```rust
block_height: T::BlockNumber
dest: Account<<T::Lookup as StaticLookup>::Source>
remaining_to: Account<<T::Lookup as StaticLookup>::Source>
balance: <T::Currency as Currency<T::AccountId>>::Balance
```
</details> </details>
<details><summary>1: go_online()</summary>
<p>
### Index Consume a oneshot account then transfer some amount to an account,
and the remaining amount to another account.
`1` - `block_height`: Must be a recent block number.
The limit is `BlockHashCount` in the past. (this is to prevent replay attacks)
- `dest`: The destination account.
- `dest_is_oneshot`: If set to `true`, then a oneshot account is created at `dest`. Else, `dest` has to be an existing account.
- `dest2`: The second destination account.
- `dest2_is_oneshot`: If set to `true`, then a oneshot account is created at `dest2`. Else, `dest2` has to be an existing account.
- `balance1`: The amount transfered to `dest`, the leftover being transfered to `dest2`.
### Documentation ### AuthorityMembers - 10
#### go_offline - 0
<details><summary><code>go_offline()</code></summary>
</p> ```rust
```
</details> </details>
<details><summary>2: set_session_keys(keys)</summary>
<p>
### Index
`2`
### Documentation #### go_online - 1
<details><summary><code>go_online()</code></summary>
```rust
```
</details>
#### set_session_keys - 2
### Types of parameters <details><summary><code>set_session_keys(keys)</code></summary>
```rust ```rust
keys: T::KeysWrapper keys: T::KeysWrapper
``` ```
</p>
</details> </details>
### 15: Grandpa
<details><summary>0: report_equivocation(equivocation_proof, key_owner_proof)</summary>
<p>
### Index ### Grandpa - 15
#### report_equivocation - 0
<details><summary><code>report_equivocation(equivocation_proof, key_owner_proof)</code></summary>
`0` ```rust
equivocation_proof: Box<EquivocationProof<T::Hash, T::BlockNumber>>
key_owner_proof: T::KeyOwnerProof
```
</details>
### Documentation
Report voter equivocation/misbehavior. This method will verify the Report voter equivocation/misbehavior. This method will verify the
equivocation proof and validate the given key ownership proof equivocation proof and validate the given key ownership proof
against the extracted offender. If both are valid, the offence against the extracted offender. If both are valid, the offence
will be reported. will be reported.
### Types of parameters ### UpgradeOrigin - 21
#### dispatch_as_root_unchecked_weight - 1
<details><summary><code>dispatch_as_root_unchecked_weight(call, weight)</code></summary>
```rust ```rust
equivocation_proof: Box<EquivocationProof<T::Hash, T::BlockNumber>>, call: Box<<T as Config>::Call>
key_owner_proof: T::KeyOwnerProof weight: Weight
``` ```
</p>
</details> </details>
### 31: UniversalDividend Dispatches a function call from root origin.
This function does not check the weight of the call, and instead allows the
caller to specify the weight of the call.
<details><summary>0: transfer_ud(dest, value)</summary> The weight of this call is defined by the caller.
<p>
### Index ### Preimage - 22
`0` #### note_preimage - 0
### Documentation <details><summary><code>note_preimage(bytes)</code></summary>
Transfer some liquid free balance to another account, in milliUD.
### Types of parameters
```rust ```rust
dest: <T::Lookup as StaticLookup>::Source, bytes: Vec<u8>
value: BalanceOf<T>
``` ```
</p>
</details> </details>
<details><summary>1: transfer_ud_keep_alive(dest, value)</summary>
<p>
### Index Register a preimage on-chain.
`1` If the preimage was previously requested, no fees or deposits are taken for providing
the preimage. Otherwise, a deposit is taken proportional to the size of the preimage.
### Documentation #### unnote_preimage - 1
Transfer some liquid free balance to another account, in milliUD. <details><summary><code>unnote_preimage(hash)</code></summary>
### Types of parameters
```rust ```rust
dest: <T::Lookup as StaticLookup>::Source, hash: T::Hash
value: BalanceOf<T>
``` ```
</p>
</details> </details>
### 41: Identity Clear an unrequested preimage from the runtime storage.
#### request_preimage - 2
<details><summary>0: create_identity(owner_key)</summary> <details><summary><code>request_preimage(hash)</code></summary>
<p>
### Index ```rust
hash: T::Hash
```
</details>
`0`
### Documentation Request a preimage be uploaded to the chain without paying any fees or deposits.
If the preimage requests has already been provided on-chain, we unreserve any deposit
a user may have paid, and take the control of the preimage out of their hands.
#### unrequest_preimage - 3
### Types of parameters <details><summary><code>unrequest_preimage(hash)</code></summary>
```rust ```rust
owner_key: T::AccountId hash: T::Hash
``` ```
</p>
</details> </details>
<details><summary>1: confirm_identity(idty_name)</summary>
<p>
### Index Clear a previously made request for a preimage.
`1` NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`.
### Documentation ### TechnicalCommittee - 23
#### execute - 1
<details><summary><code>execute(proposal, length_bound)</code></summary>
### Types of parameters
```rust ```rust
idty_name: IdtyName proposal: Box<<T as Config<I>>::Proposal>
length_bound: u32
``` ```
</p>
</details> </details>
<details><summary>2: validate_identity(idty_index)</summary>
<p>
### Index
`2` Dispatch a proposal from a member using the `Member` origin.
### Documentation Origin must be a member of the collective.
#### propose - 2
### Types of parameters <details><summary><code>propose(threshold, proposal, length_bound)</code></summary>
```rust ```rust
idty_index: T::IdtyIndex threshold: MemberCount
proposal: Box<<T as Config<I>>::Proposal>
length_bound: u32
``` ```
</p>
</details> </details>
<details><summary>3: revoke_identity(payload, payload_sig)</summary>
<p>
### Index Add a new proposal to either be voted on or executed directly.
`3` Requires the sender to be member.
### Documentation `threshold` determines whether `proposal` is executed directly (`threshold < 2`)
or put up for voting.
#### vote - 3
### Types of parameters <details><summary><code>vote(proposal, index, approve)</code></summary>
```rust ```rust
payload: RevocationPayload<T::AccountId, T::Hash>, proposal: T::Hash
payload_sig: T::RevocationSignature index: ProposalIndex
approve: bool
``` ```
</p>
</details> </details>
### 42: Membership Add an aye or nay vote for the sender to the given proposal.
<details><summary>1: request_membership(metadata)</summary> Requires the sender to be a member.
<p>
### Index Transaction fees will be waived if the member is voting on any particular proposal
for the first time and the call is successful. Subsequent vote changes will charge a
fee.
`1` #### close - 4
### Documentation <details><summary><code>close(proposal_hash, index, proposal_weight_bound, length_bound)</code></summary>
```rust
proposal_hash: T::Hash
index: ProposalIndex
proposal_weight_bound: Weight
length_bound: u32
```
</details>
### Types of parameters Close a vote that is either approved, disapproved or whose voting period has ended.
```rust May be called by any signed account in order to finish voting and close the proposal.
metadata: T::MetaData
```
</p> If called before the end of the voting period it will only close the vote if it is
</details> has enough votes to be approved or disapproved.
<details><summary>3: renew_membership(maybe_idty_id)</summary> If called after the end of the voting period abstentions are counted as rejections
<p> unless there is a prime member set and the prime member cast an approval.
### Index If the close operation completes successfully with disapproval, the transaction fee will
be waived. Otherwise execution of the approved operation will be charged to the caller.
`3` + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed
proposal.
+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via
`storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
### Documentation
### UniversalDividend - 30
#### claim_uds - 0
### Types of parameters <details><summary><code>claim_uds()</code></summary>
```rust ```rust
maybe_idty_id: Option<T::IdtyId>
``` ```
</p>
</details> </details>
### 43: Cert Claim Universal Dividends
<details><summary>1: add_cert(receiver)</summary> #### transfer_ud - 1
<p>
### Index <details><summary><code>transfer_ud(dest, value)</code></summary>
`1` ```rust
dest: <T::Lookup as StaticLookup>::Source
value: BalanceOf<T>
```
</details>
### Documentation
Transfer some liquid free balance to another account, in milliUD.
#### transfer_ud_keep_alive - 2
### Types of parameters <details><summary><code>transfer_ud_keep_alive(dest, value)</code></summary>
```rust ```rust
receiver: T::AccountId dest: <T::Lookup as StaticLookup>::Source
value: BalanceOf<T>
``` ```
</p>
</details> </details>
### 52: SmithsMembership Transfer some liquid free balance to another account, in milliUD.
#### force_set_first_eligible_ud - 3
<details><summary><code>force_set_first_eligible_ud(who, first_eligible_ud)</code></summary>
<details><summary>1: request_membership(metadata)</summary> ```rust
<p> who: T::AccountId
first_eligible_ud: FirstEligibleUd
```
</details>
### Index
`1`
### Documentation
### Identity - 41
#### create_identity - 0
### Types of parameters <details><summary><code>create_identity(owner_key)</code></summary>
```rust ```rust
metadata: T::MetaData owner_key: T::AccountId
``` ```
</p>
</details> </details>
<details><summary>3: renew_membership(maybe_idty_id)</summary>
<p>
### Index
`3` Create an identity for an existing account
### Documentation - `owner_key`: the public key corresponding to the identity to be created
The origin must be allowed to create an identity.
#### confirm_identity - 1
### Types of parameters <details><summary><code>confirm_identity(idty_name)</code></summary>
```rust ```rust
maybe_idty_id: Option<T::IdtyId> idty_name: IdtyName
``` ```
</p>
</details> </details>
<details><summary>4: revoke_membership(maybe_idty_id)</summary>
<p>
### Index Confirm the creation of an identity and give it a name
`4` - `idty_name`: the name uniquely associated to this identity. Must match the validation rules defined by the runtime.
### Documentation The identity must have been created using `create_identity` before it can be confirmed.
#### validate_identity - 2
<details><summary><code>validate_identity(idty_index)</code></summary>
### Types of parameters
```rust ```rust
maybe_idty_id: Option<T::IdtyId> idty_index: T::IdtyIndex
``` ```
</p>
</details> </details>
### 53: SmithsCert
<details><summary>1: add_cert(receiver)</summary>
<p>
### Index #### change_owner_key - 3
`1` <details><summary><code>change_owner_key(new_key, new_key_sig)</code></summary>
### Documentation ```rust
new_key: T::AccountId
new_key_sig: T::NewOwnerKeySignature
```
</details>
Change identity owner key.
### Types of parameters - `new_key`: the new owner key.
- `new_key_sig`: the signature of the encoded form of `NewOwnerKeyPayload`.
Must be signed by `new_key`.
The origin should be the old identity owner key.
#### revoke_identity - 4
<details><summary><code>revoke_identity(idty_index, revocation_key, revocation_sig)</code></summary>
```rust ```rust
receiver: T::AccountId idty_index: T::IdtyIndex
revocation_key: T::AccountId
revocation_sig: T::RevocationSignature
``` ```
</p>
</details> </details>
### 54: SmithsCollective Revoke an identity using a revocation signature
<details><summary>1: execute(proposal, length_bound)</summary> - `idty_index`: the index of the identity to be revoked.
<p> - `revocation_key`: the key used to sign the revocation payload.
- `revocation_sig`: the signature of the encoded form of `RevocationPayload`.
Must be signed by `revocation_key`.
### Index Any signed origin can execute this call.
`1` #### fix_sufficients - 7
<details><summary><code>fix_sufficients(owner_key, inc)</code></summary>
```rust
owner_key: T::AccountId
inc: bool
```
</details>
### Documentation
Dispatch a proposal from a member using the `Member` origin.
Origin must be a member of the collective.
### Membership - 42
### Types of parameters #### request_membership - 1
<details><summary><code>request_membership(metadata)</code></summary>
```rust ```rust
proposal: Box<<T as Config<I>>::Proposal>, metadata: T::MetaData
length_bound: u32
``` ```
</p>
</details> </details>
<details><summary>2: propose(threshold, proposal, length_bound)</summary>
<p>
### Index
`2`
### Documentation #### renew_membership - 3
<details><summary><code>renew_membership(maybe_idty_id)</code></summary>
```rust
maybe_idty_id: Option<T::IdtyId>
```
</details>
Add a new proposal to either be voted on or executed directly.
Requires the sender to be member.
`threshold` determines whether `proposal` is executed directly (`threshold < 2`)
or put up for voting.
### Cert - 43
### Types of parameters #### add_cert - 1
<details><summary><code>add_cert(issuer, receiver)</code></summary>
```rust ```rust
threshold: MemberCount, issuer: T::IdtyIndex
proposal: Box<<T as Config<I>>::Proposal>, receiver: T::IdtyIndex
length_bound: u32
``` ```
</p>
</details> </details>
<details><summary>3: vote(proposal, index, approve)</summary>
<p>
### Index Add a new certification or renew an existing one
`3` - `receiver`: the account receiving the certification from the origin
### Documentation The origin must be allow to certify.
Add an aye or nay vote for the sender to the given proposal. ### SmithsMembership - 52
Requires the sender to be a member. #### request_membership - 1
Transaction fees will be waived if the member is voting on any particular proposal <details><summary><code>request_membership(metadata)</code></summary>
for the first time and the call is successful. Subsequent vote changes will charge a
fee.
### Types of parameters
```rust ```rust
proposal: T::Hash, metadata: T::MetaData
index: ProposalIndex,
approve: bool
``` ```
</details>
</p>
#### renew_membership - 3
<details><summary><code>renew_membership(maybe_idty_id)</code></summary>
```rust
maybe_idty_id: Option<T::IdtyId>
```
</details> </details>
<details><summary>4: close(proposal_hash, index, proposal_weight_bound, length_bound)</summary>
<p>
### Index
`4`
### Documentation #### revoke_membership - 4
Close a vote that is either approved, disapproved or whose voting period has ended. <details><summary><code>revoke_membership(maybe_idty_id)</code></summary>
May be called by any signed account in order to finish voting and close the proposal. ```rust
maybe_idty_id: Option<T::IdtyId>
```
</details>
If called before the end of the voting period it will only close the vote if it is
has enough votes to be approved or disapproved.
If called after the end of the voting period abstentions are counted as rejections
unless there is a prime member set and the prime member cast an approval.
If the close operation completes successfully with disapproval, the transaction fee will
be waived. Otherwise execution of the approved operation will be charged to the caller.
+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed ### SmithsCert - 53
proposal.
+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via
`storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
#### add_cert - 1
### Types of parameters <details><summary><code>add_cert(issuer, receiver)</code></summary>
```rust ```rust
proposal_hash: T::Hash, issuer: T::IdtyIndex
index: ProposalIndex, receiver: T::IdtyIndex
proposal_weight_bound: Weight,
length_bound: u32
``` ```
</p>
</details> </details>
### 60: AtomicSwap Add a new certification or renew an existing one
<details><summary>0: create_swap(target, hashed_proof, action, duration)</summary> - `receiver`: the account receiving the certification from the origin
<p>
### Index The origin must be allow to certify.
`0` ### AtomicSwap - 60
#### create_swap - 0
<details><summary><code>create_swap(target, hashed_proof, action, duration)</code></summary>
```rust
target: T::AccountId
hashed_proof: HashedProof
action: T::SwapAction
duration: T::BlockNumber
```
</details>
### Documentation
Register a new atomic swap, declaring an intention to send funds from origin to target Register a new atomic swap, declaring an intention to send funds from origin to target
on the current blockchain. The target can claim the fund using the revealed proof. If on the current blockchain. The target can claim the fund using the revealed proof. If
...@@ -782,26 +756,16 @@ The dispatch origin for this call must be _Signed_. ...@@ -782,26 +756,16 @@ The dispatch origin for this call must be _Signed_.
that the revealer uses a shorter duration than the counterparty, to prevent the that the revealer uses a shorter duration than the counterparty, to prevent the
situation where the revealer reveals the proof too late around the end block. situation where the revealer reveals the proof too late around the end block.
### Types of parameters #### claim_swap - 1
<details><summary><code>claim_swap(proof, action)</code></summary>
```rust ```rust
target: T::AccountId, proof: Vec<u8>
hashed_proof: HashedProof, action: T::SwapAction
action: T::SwapAction,
duration: T::BlockNumber
``` ```
</p>
</details> </details>
<details><summary>1: claim_swap(proof, action)</summary>
<p>
### Index
`1`
### Documentation
Claim an atomic swap. Claim an atomic swap.
...@@ -811,24 +775,16 @@ The dispatch origin for this call must be _Signed_. ...@@ -811,24 +775,16 @@ The dispatch origin for this call must be _Signed_.
- `action`: Action defined in the swap, it must match the entry in blockchain. Otherwise - `action`: Action defined in the swap, it must match the entry in blockchain. Otherwise
the operation fails. This is used for weight calculation. the operation fails. This is used for weight calculation.
### Types of parameters #### cancel_swap - 2
<details><summary><code>cancel_swap(target, hashed_proof)</code></summary>
```rust ```rust
proof: Vec<u8>, target: T::AccountId
action: T::SwapAction hashed_proof: HashedProof
``` ```
</p>
</details> </details>
<details><summary>2: cancel_swap(target, hashed_proof)</summary>
<p>
### Index
`2`
### Documentation
Cancel an atomic swap. Only possible after the originally set duration has passed. Cancel an atomic swap. Only possible after the originally set duration has passed.
...@@ -837,28 +793,19 @@ The dispatch origin for this call must be _Signed_. ...@@ -837,28 +793,19 @@ The dispatch origin for this call must be _Signed_.
- `target`: Target of the original atomic swap. - `target`: Target of the original atomic swap.
- `hashed_proof`: Hashed proof of the original atomic swap. - `hashed_proof`: Hashed proof of the original atomic swap.
### Types of parameters ### Multisig - 61
#### as_multi_threshold_1 - 0
<details><summary><code>as_multi_threshold_1(other_signatories, call)</code></summary>
```rust ```rust
target: T::AccountId, other_signatories: Vec<T::AccountId>
hashed_proof: HashedProof call: Box<<T as Config>::Call>
``` ```
</p>
</details> </details>
### 61: Multisig
<details><summary>0: as_multi_threshold_1(other_signatories, call)</summary>
<p>
### Index
`0`
### Documentation
Immediately dispatch a multi-signature call using a single approval from the caller. Immediately dispatch a multi-signature call using a single approval from the caller.
The dispatch origin for this call must be _Signed_. The dispatch origin for this call must be _Signed_.
...@@ -870,24 +817,20 @@ multi-signature, but do not participate in the approval process. ...@@ -870,24 +817,20 @@ multi-signature, but do not participate in the approval process.
Result is equivalent to the dispatched result. Result is equivalent to the dispatched result.
### Types of parameters #### as_multi - 1
<details><summary><code>as_multi(threshold, other_signatories, maybe_timepoint, call, store_call, max_weight)</code></summary>
```rust ```rust
other_signatories: Vec<T::AccountId>, threshold: u16
call: Box<<T as Config>::Call> other_signatories: Vec<T::AccountId>
maybe_timepoint: Option<Timepoint<T::BlockNumber>>
call: OpaqueCall<T>
store_call: bool
max_weight: Weight
``` ```
</p>
</details> </details>
<details><summary>1: as_multi(threshold, other_signatories, maybe_timepoint, call, store_call, max_weight)</summary>
<p>
### Index
`1`
### Documentation
Register approval for a dispatch to be made from a deterministic composite account if Register approval for a dispatch to be made from a deterministic composite account if
approved by a total of `threshold - 1` of `other_signatories`. approved by a total of `threshold - 1` of `other_signatories`.
...@@ -916,28 +859,19 @@ on success, result is `Ok` and the result from the interior call, if it was exec ...@@ -916,28 +859,19 @@ on success, result is `Ok` and the result from the interior call, if it was exec
may be found in the deposited `MultisigExecuted` event. may be found in the deposited `MultisigExecuted` event.
### Types of parameters #### approve_as_multi - 2
<details><summary><code>approve_as_multi(threshold, other_signatories, maybe_timepoint, call_hash, max_weight)</code></summary>
```rust ```rust
threshold: u16, threshold: u16
other_signatories: Vec<T::AccountId>, other_signatories: Vec<T::AccountId>
maybe_timepoint: Option<Timepoint<T::BlockNumber>>, maybe_timepoint: Option<Timepoint<T::BlockNumber>>
call: OpaqueCall<T>, call_hash: [u8; 32]
store_call: bool,
max_weight: Weight max_weight: Weight
``` ```
</p>
</details> </details>
<details><summary>2: approve_as_multi(threshold, other_signatories, maybe_timepoint, call_hash, max_weight)</summary>
<p>
### Index
`2`
### Documentation
Register approval for a dispatch to be made from a deterministic composite account if Register approval for a dispatch to be made from a deterministic composite account if
approved by a total of `threshold - 1` of `other_signatories`. approved by a total of `threshold - 1` of `other_signatories`.
...@@ -959,27 +893,18 @@ transaction index) of the first approval transaction. ...@@ -959,27 +893,18 @@ transaction index) of the first approval transaction.
NOTE: If this is the final approval, you will want to use `as_multi` instead. NOTE: If this is the final approval, you will want to use `as_multi` instead.
### Types of parameters #### cancel_as_multi - 3
<details><summary><code>cancel_as_multi(threshold, other_signatories, timepoint, call_hash)</code></summary>
```rust ```rust
threshold: u16, threshold: u16
other_signatories: Vec<T::AccountId>, other_signatories: Vec<T::AccountId>
maybe_timepoint: Option<Timepoint<T::BlockNumber>>, timepoint: Timepoint<T::BlockNumber>
call_hash: [u8; 32], call_hash: [u8; 32]
max_weight: Weight
``` ```
</p>
</details> </details>
<details><summary>3: cancel_as_multi(threshold, other_signatories, timepoint, call_hash)</summary>
<p>
### Index
`3`
### Documentation
Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously
for this operation will be unreserved on success. for this operation will be unreserved on success.
...@@ -994,54 +919,35 @@ transaction for this dispatch. ...@@ -994,54 +919,35 @@ transaction for this dispatch.
- `call_hash`: The hash of the call to be executed. - `call_hash`: The hash of the call to be executed.
### Types of parameters ### ProvideRandomness - 62
#### request - 0
<details><summary><code>request(randomness_type, salt)</code></summary>
```rust ```rust
threshold: u16, randomness_type: RandomnessType
other_signatories: Vec<T::AccountId>, salt: H256
timepoint: Timepoint<T::BlockNumber>,
call_hash: [u8; 32]
``` ```
</p>
</details> </details>
### 62: ProvideRandomness Request a randomness
<details><summary>0: request(randomness_type, salt)</summary>
<p>
### Index
`0`
### Documentation ### Proxy - 63
Request a randomness #### proxy - 0
### Types of parameters <details><summary><code>proxy(real, force_proxy_type, call)</code></summary>
```rust ```rust
randomness_type: RandomnessType, real: T::AccountId
salt: H256 force_proxy_type: Option<T::ProxyType>
call: Box<<T as Config>::Call>
``` ```
</p>
</details> </details>
### 63: Proxy
<details><summary>0: proxy(real, force_proxy_type, call)</summary>
<p>
### Index
`0`
### Documentation
Dispatch the given `call` from an account that the sender is authorised for through Dispatch the given `call` from an account that the sender is authorised for through
`add_proxy`. `add_proxy`.
...@@ -1055,25 +961,17 @@ Parameters: ...@@ -1055,25 +961,17 @@ Parameters:
- `call`: The call to be made by the `real` account. - `call`: The call to be made by the `real` account.
### Types of parameters #### add_proxy - 1
<details><summary><code>add_proxy(delegate, proxy_type, delay)</code></summary>
```rust ```rust
real: T::AccountId, delegate: T::AccountId
force_proxy_type: Option<T::ProxyType>, proxy_type: T::ProxyType
call: Box<<T as Config>::Call> delay: T::BlockNumber
``` ```
</p>
</details> </details>
<details><summary>1: add_proxy(delegate, proxy_type, delay)</summary>
<p>
### Index
`1`
### Documentation
Register a proxy account for the sender that is able to make calls on its behalf. Register a proxy account for the sender that is able to make calls on its behalf.
...@@ -1086,25 +984,17 @@ Parameters: ...@@ -1086,25 +984,17 @@ Parameters:
zero. zero.
### Types of parameters #### remove_proxy - 2
<details><summary><code>remove_proxy(delegate, proxy_type, delay)</code></summary>
```rust ```rust
delegate: T::AccountId, delegate: T::AccountId
proxy_type: T::ProxyType, proxy_type: T::ProxyType
delay: T::BlockNumber delay: T::BlockNumber
``` ```
</p>
</details> </details>
<details><summary>2: remove_proxy(delegate, proxy_type, delay)</summary>
<p>
### Index
`2`
### Documentation
Unregister a proxy account for the sender. Unregister a proxy account for the sender.
...@@ -1115,25 +1005,14 @@ Parameters: ...@@ -1115,25 +1005,14 @@ Parameters:
- `proxy_type`: The permissions currently enabled for the removed proxy account. - `proxy_type`: The permissions currently enabled for the removed proxy account.
### Types of parameters #### remove_proxies - 3
<details><summary><code>remove_proxies()</code></summary>
```rust ```rust
delegate: T::AccountId,
proxy_type: T::ProxyType,
delay: T::BlockNumber
``` ```
</p>
</details> </details>
<details><summary>3: remove_proxies()</summary>
<p>
### Index
`3`
### Documentation
Unregister all proxy accounts for the sender. Unregister all proxy accounts for the sender.
...@@ -1143,17 +1022,17 @@ WARNING: This may be called on accounts created by `anonymous`, however if done, ...@@ -1143,17 +1022,17 @@ WARNING: This may be called on accounts created by `anonymous`, however if done,
the unreserved fees will be inaccessible. **All access to this account will be lost.** the unreserved fees will be inaccessible. **All access to this account will be lost.**
</p> #### anonymous - 4
</details>
<details><summary>4: anonymous(proxy_type, delay, index)</summary>
<p>
### Index <details><summary><code>anonymous(proxy_type, delay, index)</code></summary>
`4` ```rust
proxy_type: T::ProxyType
delay: T::BlockNumber
index: u16
```
</details>
### Documentation
Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and
initialize it with a proxy of `proxy_type` for `origin` sender. initialize it with a proxy of `proxy_type` for `origin` sender.
...@@ -1175,25 +1054,19 @@ same sender, with the same parameters. ...@@ -1175,25 +1054,19 @@ same sender, with the same parameters.
Fails if there are insufficient funds to pay for deposit. Fails if there are insufficient funds to pay for deposit.
### Types of parameters #### kill_anonymous - 5
<details><summary><code>kill_anonymous(spawner, proxy_type, index, height, ext_index)</code></summary>
```rust ```rust
proxy_type: T::ProxyType, spawner: T::AccountId
delay: T::BlockNumber, proxy_type: T::ProxyType
index: u16 index: u16
height: T::BlockNumber
ext_index: u32
``` ```
</p>
</details> </details>
<details><summary>5: kill_anonymous(spawner, proxy_type, index, height, ext_index)</summary>
<p>
### Index
`5`
### Documentation
Removes a previously spawned anonymous proxy. Removes a previously spawned anonymous proxy.
...@@ -1213,27 +1086,16 @@ Fails with `NoPermission` in case the caller is not a previously created anonymo ...@@ -1213,27 +1086,16 @@ Fails with `NoPermission` in case the caller is not a previously created anonymo
account whose `anonymous` call has corresponding parameters. account whose `anonymous` call has corresponding parameters.
### Types of parameters #### announce - 6
<details><summary><code>announce(real, call_hash)</code></summary>
```rust ```rust
spawner: T::AccountId, real: T::AccountId
proxy_type: T::ProxyType, call_hash: CallHashOf<T>
index: u16,
height: T::BlockNumber,
ext_index: u32
``` ```
</p>
</details> </details>
<details><summary>6: announce(real, call_hash)</summary>
<p>
### Index
`6`
### Documentation
Publish the hash of a proxy-call that will be made in the future. Publish the hash of a proxy-call that will be made in the future.
...@@ -1252,24 +1114,16 @@ Parameters: ...@@ -1252,24 +1114,16 @@ Parameters:
- `call_hash`: The hash of the call to be made by the `real` account. - `call_hash`: The hash of the call to be made by the `real` account.
### Types of parameters #### remove_announcement - 7
<details><summary><code>remove_announcement(real, call_hash)</code></summary>
```rust ```rust
real: T::AccountId, real: T::AccountId
call_hash: CallHashOf<T> call_hash: CallHashOf<T>
``` ```
</p>
</details> </details>
<details><summary>7: remove_announcement(real, call_hash)</summary>
<p>
### Index
`7`
### Documentation
Remove a given announcement. Remove a given announcement.
...@@ -1283,24 +1137,16 @@ Parameters: ...@@ -1283,24 +1137,16 @@ Parameters:
- `call_hash`: The hash of the call to be made by the `real` account. - `call_hash`: The hash of the call to be made by the `real` account.
### Types of parameters #### reject_announcement - 8
<details><summary><code>reject_announcement(delegate, call_hash)</code></summary>
```rust ```rust
real: T::AccountId, delegate: T::AccountId
call_hash: CallHashOf<T> call_hash: CallHashOf<T>
``` ```
</p>
</details> </details>
<details><summary>8: reject_announcement(delegate, call_hash)</summary>
<p>
### Index
`8`
### Documentation
Remove the given announcement of a delegate. Remove the given announcement of a delegate.
...@@ -1314,24 +1160,18 @@ Parameters: ...@@ -1314,24 +1160,18 @@ Parameters:
- `call_hash`: The hash of the call to be made. - `call_hash`: The hash of the call to be made.
### Types of parameters #### proxy_announced - 9
<details><summary><code>proxy_announced(delegate, real, force_proxy_type, call)</code></summary>
```rust ```rust
delegate: T::AccountId, delegate: T::AccountId
call_hash: CallHashOf<T> real: T::AccountId
force_proxy_type: Option<T::ProxyType>
call: Box<<T as Config>::Call>
``` ```
</p>
</details> </details>
<details><summary>9: proxy_announced(delegate, real, force_proxy_type, call)</summary>
<p>
### Index
`9`
### Documentation
Dispatch the given `call` from an account that the sender is authorized for through Dispatch the given `call` from an account that the sender is authorized for through
`add_proxy`. `add_proxy`.
...@@ -1346,30 +1186,18 @@ Parameters: ...@@ -1346,30 +1186,18 @@ Parameters:
- `call`: The call to be made by the `real` account. - `call`: The call to be made by the `real` account.
### Types of parameters ### Utility - 64
#### batch - 0
<details><summary><code>batch(calls)</code></summary>
```rust ```rust
delegate: T::AccountId, calls: Vec<<T as Config>::Call>
real: T::AccountId,
force_proxy_type: Option<T::ProxyType>,
call: Box<<T as Config>::Call>
``` ```
</p>
</details> </details>
### 64: Utility
<details><summary>0: batch(calls)</summary>
<p>
### Index
`0`
### Documentation
Send a batch of dispatch calls. Send a batch of dispatch calls.
May be called from any origin. May be called from any origin.
...@@ -1381,23 +1209,16 @@ If origin is root then call are dispatch without checking origin filter. (This i ...@@ -1381,23 +1209,16 @@ If origin is root then call are dispatch without checking origin filter. (This i
bypassing `frame_system::Config::BaseCallFilter`). bypassing `frame_system::Config::BaseCallFilter`).
### Types of parameters #### as_derivative - 1
<details><summary><code>as_derivative(index, call)</code></summary>
```rust ```rust
calls: Vec<<T as Config>::Call> index: u16
call: Box<<T as Config>::Call>
``` ```
</p>
</details> </details>
<details><summary>1: as_derivative(index, call)</summary>
<p>
### Index
`1`
### Documentation
Send a call through an indexed pseudonym of the sender. Send a call through an indexed pseudonym of the sender.
...@@ -1413,24 +1234,15 @@ NOTE: Prior to version *12, this was called `as_limited_sub`. ...@@ -1413,24 +1234,15 @@ NOTE: Prior to version *12, this was called `as_limited_sub`.
The dispatch origin for this call must be _Signed_. The dispatch origin for this call must be _Signed_.
### Types of parameters #### batch_all - 2
<details><summary><code>batch_all(calls)</code></summary>
```rust ```rust
index: u16, calls: Vec<<T as Config>::Call>
call: Box<<T as Config>::Call>
``` ```
</p>
</details> </details>
<details><summary>2: batch_all(calls)</summary>
<p>
### Index
`2`
### Documentation
Send a batch of dispatch calls and atomically execute them. Send a batch of dispatch calls and atomically execute them.
The whole transaction will rollback and fail if any of the calls failed. The whole transaction will rollback and fail if any of the calls failed.
...@@ -1444,233 +1256,211 @@ If origin is root then call are dispatch without checking origin filter. (This i ...@@ -1444,233 +1256,211 @@ If origin is root then call are dispatch without checking origin filter. (This i
bypassing `frame_system::Config::BaseCallFilter`). bypassing `frame_system::Config::BaseCallFilter`).
### Types of parameters #### force_batch - 4
<details><summary><code>force_batch(calls)</code></summary>
```rust ```rust
calls: Vec<<T as Config>::Call> calls: Vec<<T as Config>::Call>
``` ```
</details>
</p> Send a batch of dispatch calls.
Unlike `batch`, it allows errors and won't interrupt.
May be called from any origin.
- `calls`: The calls to be dispatched from the same origin. The number of call must not
exceed the constant: `batched_calls_limit` (available in constant metadata).
If origin is root then call are dispatch without checking origin filter. (This includes
bypassing `frame_system::Config::BaseCallFilter`).
### Treasury - 65
#### propose_spend - 0
<details><summary><code>propose_spend(value, beneficiary)</code></summary>
```rust
value: BalanceOf<T, I>
beneficiary: <T::Lookup as StaticLookup>::Source
```
</details> </details>
### 65: Treasury Put forward a suggestion for spending. A deposit proportional to the value
is reserved and slashed if the proposal is rejected. It is returned once the
proposal is awarded.
<details><summary>0: propose_spend(value, beneficiary)</summary>
<p>
### Index #### spend - 3
<details><summary><code>spend(amount, beneficiary)</code></summary>
```rust
amount: BalanceOf<T, I>
beneficiary: <T::Lookup as StaticLookup>::Source
```
</details>
`0` Propose and approve a spend of treasury funds.
### Documentation - `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`.
- `amount`: The amount to be transferred from the treasury to the `beneficiary`.
- `beneficiary`: The destination account for the transfer.
Put forward a suggestion for spending. A deposit proportional to the value NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the
is reserved and slashed if the proposal is rejected. It is returned once the beneficiary.
proposal is awarded.
#### remove_approval - 4
### Types of parameters <details><summary><code>remove_approval(proposal_id)</code></summary>
```rust ```rust
value: BalanceOf<T, I>, proposal_id: ProposalIndex
beneficiary: <T::Lookup as StaticLookup>::Source
``` ```
</p>
</details> </details>
Force a previously approved proposal to be removed from the approval queue.
The original deposit will no longer be returned.
## Root calls May only be called from `T::RejectOrigin`.
- `proposal_id`: The index of a proposal
There are **28** root calls organized in **12** pallets.
### 0: System
<details><summary>0: fill_block(ratio)</summary>
<p>
### Index ## Root calls
`0` There are **26** root calls from **12** pallets.
### Documentation ### System - 0
A dispatch that will fill the block weight up to the given ratio. #### fill_block - 0
### Types of parameters <details><summary><code>fill_block(ratio)</code></summary>
```rust ```rust
ratio: Perbill ratio: Perbill
``` ```
</p>
</details> </details>
<details><summary>2: set_heap_pages(pages)</summary>
<p>
### Index
`2`
### Documentation A dispatch that will fill the block weight up to the given ratio.
Set the number of pages in the WebAssembly environment's heap. #### set_heap_pages - 2
### Types of parameters <details><summary><code>set_heap_pages(pages)</code></summary>
```rust ```rust
pages: u64 pages: u64
``` ```
</p>
</details> </details>
<details><summary>3: set_code(code)</summary>
<p>
### Index
`3` Set the number of pages in the WebAssembly environment's heap.
### Documentation
Set the new runtime code.
#### set_code - 3
### Types of parameters <details><summary><code>set_code(code)</code></summary>
```rust ```rust
code: Vec<u8> code: Vec<u8>
``` ```
</p>
</details> </details>
<details><summary>4: set_code_without_checks(code)</summary>
<p>
### Index
`4` Set the new runtime code.
### Documentation
Set the new runtime code without doing any checks of the given `code`.
#### set_code_without_checks - 4
### Types of parameters <details><summary><code>set_code_without_checks(code)</code></summary>
```rust ```rust
code: Vec<u8> code: Vec<u8>
``` ```
</p>
</details> </details>
<details><summary>5: set_storage(items)</summary>
<p>
### Index Set the new runtime code without doing any checks of the given `code`.
`5`
### Documentation
Set some items of storage. #### set_storage - 5
### Types of parameters <details><summary><code>set_storage(items)</code></summary>
```rust ```rust
items: Vec<KeyValue> items: Vec<KeyValue>
``` ```
</p>
</details> </details>
<details><summary>6: kill_storage(keys)</summary>
<p>
### Index
`6`
### Documentation Set some items of storage.
Kill some items from storage. #### kill_storage - 6
### Types of parameters <details><summary><code>kill_storage(keys)</code></summary>
```rust ```rust
keys: Vec<Key> keys: Vec<Key>
``` ```
</p>
</details> </details>
<details><summary>7: kill_prefix(prefix, subkeys)</summary>
<p>
### Index
`7` Kill some items from storage.
### Documentation
Kill all storage items with a key that starts with the given prefix.
**NOTE:** We rely on the Root origin to provide us the number of subkeys under #### kill_prefix - 7
the prefix we are removing to accurately calculate the weight of this function.
### Types of parameters <details><summary><code>kill_prefix(prefix, subkeys)</code></summary>
```rust ```rust
prefix: Key, prefix: Key
subkeys: u32 subkeys: u32
``` ```
</p>
</details> </details>
### 3: Babe Kill all storage items with a key that starts with the given prefix.
<details><summary>2: plan_config_change(config)</summary>
<p>
### Index
`2` **NOTE:** We rely on the Root origin to provide us the number of subkeys under
the prefix we are removing to accurately calculate the weight of this function.
### Documentation ### Babe - 3
Plan an epoch config change. The epoch config change is recorded and will be enacted on #### plan_config_change - 2
the next call to `enact_epoch_change`. The config will be activated one epoch after.
Multiple calls to this method will replace any existing planned config change that had
not been enacted yet.
### Types of parameters <details><summary><code>plan_config_change(config)</code></summary>
```rust ```rust
config: NextConfigDescriptor config: NextConfigDescriptor
``` ```
</p>
</details> </details>
### 6: Balances Plan an epoch config change. The epoch config change is recorded and will be enacted on
the next call to `enact_epoch_change`. The config will be activated one epoch after.
Multiple calls to this method will replace any existing planned config change that had
not been enacted yet.
### Balances - 6
<details><summary>1: set_balance(who, new_free, new_reserved)</summary> #### set_balance - 1
<p>
### Index <details><summary><code>set_balance(who, new_free, new_reserved)</code></summary>
`1` ```rust
who: <T::Lookup as StaticLookup>::Source
new_free: T::Balance
new_reserved: T::Balance
```
</details>
### Documentation
Set the balances of a given account. Set the balances of a given account.
...@@ -1681,537 +1471,334 @@ it will reset the account nonce (`frame_system::AccountNonce`). ...@@ -1681,537 +1471,334 @@ it will reset the account nonce (`frame_system::AccountNonce`).
The dispatch origin for this call is `root`. The dispatch origin for this call is `root`.
### Types of parameters #### force_transfer - 2
```rust
who: <T::Lookup as StaticLookup>::Source,
new_free: T::Balance,
new_reserved: T::Balance
```
</p>
</details>
<details><summary>2: force_transfer(source, dest, value)</summary>
<p>
### Index
`2`
### Documentation
Exactly as `transfer`, except the origin must be root and the source account may be <details><summary><code>force_transfer(source, dest, value)</code></summary>
specified.
### Types of parameters
```rust ```rust
source: <T::Lookup as StaticLookup>::Source, source: <T::Lookup as StaticLookup>::Source
dest: <T::Lookup as StaticLookup>::Source, dest: <T::Lookup as StaticLookup>::Source
value: T::Balance value: T::Balance
``` ```
</p>
</details> </details>
<details><summary>5: force_unreserve(who, amount)</summary>
<p>
### Index Exactly as `transfer`, except the origin must be root and the source account may be
specified.
`5`
### Documentation
Unreserve some balance from a user by force.
Can only be called by ROOT. #### force_unreserve - 5
### Types of parameters <details><summary><code>force_unreserve(who, amount)</code></summary>
```rust ```rust
who: <T::Lookup as StaticLookup>::Source, who: <T::Lookup as StaticLookup>::Source
amount: T::Balance amount: T::Balance
``` ```
</p>
</details> </details>
### 10: AuthorityMembers Unreserve some balance from a user by force.
<details><summary>3: prune_account_id_of(members_ids)</summary>
<p>
### Index
`3`
### Documentation Can only be called by ROOT.
### AuthorityMembers - 10
#### remove_member - 3
### Types of parameters <details><summary><code>remove_member(member_id)</code></summary>
```rust ```rust
members_ids: Vec<T::MemberId> member_id: T::MemberId
``` ```
</p>
</details> </details>
<details><summary>4: remove_member(member_id)</summary>
<p>
### Index
`4`
### Documentation
### Grandpa - 15
#### note_stalled - 2
### Types of parameters <details><summary><code>note_stalled(delay, best_finalized_block_number)</code></summary>
```rust ```rust
member_id: T::MemberId delay: T::BlockNumber
best_finalized_block_number: T::BlockNumber
``` ```
</p>
</details> </details>
### 15: Grandpa Note that the current authority set of the GRANDPA finality gadget has stalled.
<details><summary>2: note_stalled(delay, best_finalized_block_number)</summary> This will trigger a forced authority set change at the beginning of the next session, to
<p> be enacted `delay` blocks after that. The `delay` should be high enough to safely assume
that the block signalling the forced change will not be re-orged e.g. 1000 blocks.
The block production rate (which may be slowed down because of finality lagging) should
be taken into account when choosing the `delay`. The GRANDPA voters based on the new
authority will start voting on top of `best_finalized_block_number` for new finalized
blocks. `best_finalized_block_number` should be the highest of the latest finalized
block of all validators of the new authority set.
### Index Only callable by root.
`2`
### Documentation ### TechnicalCommittee - 23
Note that the current authority set of the GRANDPA finality gadget has #### set_members - 0
stalled. This will trigger a forced authority set change at the beginning
of the next session, to be enacted `delay` blocks after that. The delay
should be high enough to safely assume that the block signalling the
forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters
will start the new authority set using the given finalized block as base.
Only callable by root.
### Types of parameters <details><summary><code>set_members(new_members, prime, old_count)</code></summary>
```rust ```rust
delay: T::BlockNumber, new_members: Vec<T::AccountId>
best_finalized_block_number: T::BlockNumber prime: Option<T::AccountId>
old_count: MemberCount
``` ```
</p>
</details> </details>
### 41: Identity Set the collective's membership.
- `new_members`: The new member list. Be nice to the chain and provide it sorted.
- `prime`: The prime member whose vote sets the default.
- `old_count`: The upper bound for the previous number of members in storage. Used for
weight estimation.
<details><summary>4: remove_identity(idty_index, idty_name)</summary> Requires root origin.
<p>
### Index NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but
the weight estimations rely on it to estimate dispatchable weight.
`4` WARNING:
### Documentation The `pallet-collective` can also be managed by logic outside of the pallet through the
implementation of the trait [`ChangeMembers`].
Any call to `set_members` must be careful that the member set doesn't get out of sync
with other logic managing the member set.
#### disapprove_proposal - 5
### Types of parameters <details><summary><code>disapprove_proposal(proposal_hash)</code></summary>
```rust ```rust
idty_index: T::IdtyIndex, proposal_hash: T::Hash
idty_name: Option<IdtyName>
``` ```
</p>
</details> </details>
<details><summary>5: prune_item_identities_names(names)</summary>
<p>
### Index Disapprove a proposal, close, and remove it from the system, regardless of its current
state.
Must be called by the Root origin.
`5` Parameters:
* `proposal_hash`: The hash of the proposal that should be disapproved.
### Documentation
### Identity - 41
#### remove_identity - 5
### Types of parameters <details><summary><code>remove_identity(idty_index, idty_name)</code></summary>
```rust ```rust
names: Vec<IdtyName> idty_index: T::IdtyIndex
idty_name: Option<IdtyName>
``` ```
</p>
</details> </details>
<details><summary>6: prune_item_identity_index_of(accounts_ids)</summary>
<p>
### Index
`6`
### Documentation #### prune_item_identities_names - 6
<details><summary><code>prune_item_identities_names(names)</code></summary>
### Types of parameters
```rust ```rust
accounts_ids: Vec<T::AccountId> names: Vec<IdtyName>
``` ```
</p>
</details> </details>
### 42: Membership
<details><summary>0: force_request_membership(idty_id, metadata)</summary>
<p>
### Index ### Membership - 42
`0` #### force_request_membership - 0
### Documentation <details><summary><code>force_request_membership(idty_id, metadata)</code></summary>
### Types of parameters
```rust ```rust
idty_id: T::IdtyId, idty_id: T::IdtyId
metadata: T::MetaData metadata: T::MetaData
``` ```
</p>
</details> </details>
### 43: Cert
<details><summary>0: force_add_cert(issuer, receiver, verify_rules)</summary>
<p>
### Index ### Cert - 43
`0` #### force_add_cert - 0
### Documentation <details><summary><code>force_add_cert(issuer, receiver, verify_rules)</code></summary>
### Types of parameters
```rust ```rust
issuer: T::IdtyIndex, issuer: T::IdtyIndex
receiver: T::IdtyIndex, receiver: T::IdtyIndex
verify_rules: bool verify_rules: bool
``` ```
</p>
</details> </details>
<details><summary>2: del_cert(issuer, receiver)</summary>
<p>
### Index
`2`
### Documentation
#### del_cert - 2
<details><summary><code>del_cert(issuer, receiver)</code></summary>
### Types of parameters
```rust ```rust
issuer: T::IdtyIndex, issuer: T::IdtyIndex
receiver: T::IdtyIndex receiver: T::IdtyIndex
``` ```
</p>
</details> </details>
<details><summary>3: remove_all_certs_received_by(idty_index)</summary>
<p>
### Index
`3`
### Documentation #### remove_all_certs_received_by - 3
<details><summary><code>remove_all_certs_received_by(idty_index)</code></summary>
### Types of parameters
```rust ```rust
idty_index: T::IdtyIndex idty_index: T::IdtyIndex
``` ```
</p>
</details> </details>
### 52: SmithsMembership
<details><summary>0: force_request_membership(idty_id, metadata)</summary>
<p>
### Index
`0` ### SmithsMembership - 52
### Documentation #### force_request_membership - 0
<details><summary><code>force_request_membership(idty_id, metadata)</code></summary>
### Types of parameters
```rust ```rust
idty_id: T::IdtyId, idty_id: T::IdtyId
metadata: T::MetaData metadata: T::MetaData
``` ```
</p>
</details> </details>
### 53: SmithsCert
<details><summary>0: force_add_cert(issuer, receiver, verify_rules)</summary>
<p>
### Index
`0` ### SmithsCert - 53
### Documentation #### force_add_cert - 0
<details><summary><code>force_add_cert(issuer, receiver, verify_rules)</code></summary>
### Types of parameters
```rust ```rust
issuer: T::IdtyIndex, issuer: T::IdtyIndex
receiver: T::IdtyIndex, receiver: T::IdtyIndex
verify_rules: bool verify_rules: bool
``` ```
</p>
</details> </details>
<details><summary>2: del_cert(issuer, receiver)</summary>
<p>
### Index
`2`
### Documentation #### del_cert - 2
<details><summary><code>del_cert(issuer, receiver)</code></summary>
### Types of parameters
```rust ```rust
issuer: T::IdtyIndex, issuer: T::IdtyIndex
receiver: T::IdtyIndex receiver: T::IdtyIndex
``` ```
</p>
</details> </details>
<details><summary>3: remove_all_certs_received_by(idty_index)</summary>
<p>
### Index
`3`
### Documentation
#### remove_all_certs_received_by - 3
<details><summary><code>remove_all_certs_received_by(idty_index)</code></summary>
### Types of parameters
```rust ```rust
idty_index: T::IdtyIndex idty_index: T::IdtyIndex
``` ```
</p>
</details>
### 54: SmithsCollective
<details><summary>0: set_members(new_members, prime, old_count)</summary>
<p>
### Index
`0`
### Documentation
Set the collective's membership.
- `new_members`: The new member list. Be nice to the chain and provide it sorted.
- `prime`: The prime member whose vote sets the default.
- `old_count`: The upper bound for the previous number of members in storage. Used for
weight estimation.
Requires root origin.
NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but
the weight estimations rely on it to estimate dispatchable weight.
# WARNING:
The `pallet-collective` can also be managed by logic outside of the pallet through the
implementation of the trait [`ChangeMembers`].
Any call to `set_members` must be careful that the member set doesn't get out of sync
with other logic managing the member set.
### Types of parameters
```rust
new_members: Vec<T::AccountId>,
prime: Option<T::AccountId>,
old_count: MemberCount
```
</p>
</details> </details>
<details><summary>5: disapprove_proposal(proposal_hash)</summary>
<p>
### Index
`5`
### Documentation
Disapprove a proposal, close, and remove it from the system, regardless of its current
state.
Must be called by the Root origin.
Parameters: ### Utility - 64
* `proposal_hash`: The hash of the proposal that should be disapproved.
#### dispatch_as - 3
### Types of parameters <details><summary><code>dispatch_as(as_origin, call)</code></summary>
```rust ```rust
proposal_hash: T::Hash as_origin: Box<T::PalletsOrigin>
call: Box<<T as Config>::Call>
``` ```
</p>
</details> </details>
### 64: Utility
<details><summary>3: dispatch_as(as_origin, call)</summary>
<p>
### Index
`3`
### Documentation
Dispatches a function call with a provided origin. Dispatches a function call with a provided origin.
The dispatch origin for this call must be _Root_. The dispatch origin for this call must be _Root_.
### Types of parameters
```rust
as_origin: Box<T::PalletsOrigin>,
call: Box<<T as Config>::Call>
```
</p>
</details>
## Disabled calls ## Disabled calls
There are **7** disabled calls organized in **4** pallets. There are **7** disabled calls from **4** pallets.
### 0: System
<details><summary>1: remark(remark)</summary>
<p>
### Index ### System - 0
`1` #### remark - 1
### Documentation <details><summary><code>remark(remark)</code></summary>
Make some on-chain remark.
### Types of parameters
```rust ```rust
remark: Vec<u8> remark: Vec<u8>
``` ```
</p>
</details> </details>
<details><summary>8: remark_with_event(remark)</summary>
<p>
### Index
`8` Make some on-chain remark.
### Documentation
Make some on-chain remark and emit event. #### remark_with_event - 8
### Types of parameters <details><summary><code>remark_with_event(remark)</code></summary>
```rust ```rust
remark: Vec<u8> remark: Vec<u8>
``` ```
</p>
</details> </details>
### 14: Session Make some on-chain remark and emit event.
### Session - 14
<details><summary>0: set_keys(keys, proof)</summary> #### set_keys - 0
<p>
### Index <details><summary><code>set_keys(keys, proof)</code></summary>
`0` ```rust
keys: T::Keys
proof: Vec<u8>
```
</details>
### Documentation
Sets the session key(s) of the function caller to `keys`. Sets the session key(s) of the function caller to `keys`.
Allows an account to set its session key prior to becoming a validator. Allows an account to set its session key prior to becoming a validator.
...@@ -2220,24 +1807,14 @@ This doesn't take effect until the next session. ...@@ -2220,24 +1807,14 @@ This doesn't take effect until the next session.
The dispatch origin of this function must be signed. The dispatch origin of this function must be signed.
### Types of parameters #### purge_keys - 1
<details><summary><code>purge_keys()</code></summary>
```rust ```rust
keys: T::Keys,
proof: Vec<u8>
``` ```
</p>
</details> </details>
<details><summary>1: purge_keys()</summary>
<p>
### Index
`1`
### Documentation
Removes any session key(s) of the function caller. Removes any session key(s) of the function caller.
...@@ -2249,72 +1826,43 @@ means being a controller account) or directly convertible into a validator ID (w ...@@ -2249,72 +1826,43 @@ means being a controller account) or directly convertible into a validator ID (w
usually means being a stash account). usually means being a stash account).
</p> ### Membership - 42
</details>
### 42: Membership
<details><summary>2: claim_membership(maybe_idty_id)</summary> #### claim_membership - 2
<p>
### Index <details><summary><code>claim_membership(maybe_idty_id)</code></summary>
`2`
### Documentation
### Types of parameters
```rust ```rust
maybe_idty_id: Option<T::IdtyId> maybe_idty_id: Option<T::IdtyId>
``` ```
</p>
</details> </details>
<details><summary>4: revoke_membership(maybe_idty_id)</summary>
<p>
### Index
`4`
### Documentation
#### revoke_membership - 4
### Types of parameters <details><summary><code>revoke_membership(maybe_idty_id)</code></summary>
```rust ```rust
maybe_idty_id: Option<T::IdtyId> maybe_idty_id: Option<T::IdtyId>
``` ```
</p>
</details> </details>
### 52: SmithsMembership
<details><summary>2: claim_membership(maybe_idty_id)</summary>
<p>
### Index
`2`
### Documentation
### SmithsMembership - 52
#### claim_membership - 2
### Types of parameters <details><summary><code>claim_membership(maybe_idty_id)</code></summary>
```rust ```rust
maybe_idty_id: Option<T::IdtyId> maybe_idty_id: Option<T::IdtyId>
``` ```
</p>
</details> </details>
...@@ -45,6 +45,10 @@ An example of genesis configuration file: `resources/gdev.json` ...@@ -45,6 +45,10 @@ An example of genesis configuration file: `resources/gdev.json`
## 5. Generate raw spec ## 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 ```bash
./scripts/gen-live-network-raw-spec.sh CURRENCY "<path/to/your/genesis/config/file>" ./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 1. Create the benchmarking tests, see commit 31057e37be471e3f27d18c63818d57cc907b4b4f for a
complete real example. complete real example.
...@@ -19,15 +33,27 @@ Note 1: You *must* replace `CURRENCY` by the currency type, or for ĞDev use dir ...@@ -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` 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`. by `--wasm-execution=interpreted-i-know-what-i-do`.
## What is the reference machine? ## Generate base block benchmarking
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: 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 @@ ...@@ -5,19 +5,14 @@
### Duniter part ### Duniter part
- Add this docker-compose template on your server: - 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` - 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 ```bash
SERVER_DOMAIN=YOUR_DOMAIN 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 - Do `docker compose up -d` to start your node
### Reverse-proxy part (with Nginx) ### Reverse-proxy part (with Nginx)
...@@ -63,6 +58,7 @@ server { ...@@ -63,6 +58,7 @@ server {
} }
} }
``` ```
and replace `YOUR_DOMAIN` by your domain each time. and replace `YOUR_DOMAIN` by your domain each time.
- [generate your ssl certificates](https://github.com/acmesh-official/acme.sh) with let's encrypt - [generate your ssl certificates](https://github.com/acmesh-official/acme.sh) with let's encrypt
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
### Duniter part ### Duniter part
- Add this docker-compose on your server : - 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) [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`: - Create a `.env` file that define environment variable `SERVER_DOMAIN`:
- `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` ```bash
- `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` SERVER_DOMAIN=YOUR_DOMAIN
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 up -d` to start your node - `docker compose up -d` to start your node
### Reverse-proxy part (with Nginx) ### Reverse-proxy part (with Nginx)
...@@ -57,6 +57,7 @@ server { ...@@ -57,6 +57,7 @@ server {
} }
} }
``` ```
and replace `YOUR_DOMAIN` by your domain each time. and replace `YOUR_DOMAIN` by your domain each time.
- [generate your ssl certificates](https://github.com/acmesh-official/acme.sh) with let's encrypt - [generate your ssl certificates](https://github.com/acmesh-official/acme.sh) with let's encrypt
......
...@@ -11,7 +11,7 @@ version = '3.0.0' ...@@ -11,7 +11,7 @@ version = '3.0.0'
[dev-dependencies] [dev-dependencies]
anyhow = "1.0" anyhow = "1.0"
async-trait = "0.1" async-trait = "0.1"
clap = { version = "3.0", features = ["derive"] } clap = { version = "3.2.23", features = ["derive"] }
ctrlc = "3.2.2" ctrlc = "3.2.2"
cucumber = "0.11" cucumber = "0.11"
env_logger = "0.9.0" env_logger = "0.9.0"
...@@ -20,8 +20,8 @@ notify = "4.0" ...@@ -20,8 +20,8 @@ notify = "4.0"
parity-scale-codec = "3.1.5" parity-scale-codec = "3.1.5"
portpicker = "0.1.1" portpicker = "0.1.1"
serde_json = "1.0.64" serde_json = "1.0.64"
sp-keyring = { 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.32" }
subxt = { git = 'https://github.com/duniter/subxt.git', branch = 'duniter-substrate-v0.9.26' } subxt = { git = 'https://github.com/duniter/subxt.git', branch = 'duniter-substrate-v0.9.32' }
tokio = { version = "1.15.0", features = ["macros"] } tokio = { version = "1.15.0", features = ["macros"] }
[[test]] [[test]]
......
...@@ -85,7 +85,7 @@ pub async fn get_identity_value(world: &mut DuniterWorld, account: String) -> Re ...@@ -85,7 +85,7 @@ pub async fn get_identity_value(world: &mut DuniterWorld, account: String) -> Re
.unwrap(); .unwrap();
let identity_value = world let identity_value = world
.read(&gdev::storage().identity().identities(&identity_index)) .read(&gdev::storage().identity().identities(identity_index))
.await? .await?
.ok_or_else(|| { .ok_or_else(|| {
anyhow::anyhow!( anyhow::anyhow!(
......