Skip to content
Snippets Groups Projects

Compare revisions

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

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • nodes/rust/duniter-v2s
  • llaq/lc-core-substrate
  • pini-gh/duniter-v2s
  • vincentux/duniter-v2s
  • mildred/duniter-v2s
  • d0p1/duniter-v2s
  • bgallois/duniter-v2s
  • Nicolas80/duniter-v2s
8 results
Select Git revision
Loading items
Show changes
# Resources
Files used for different purpose like tests.
## metadata.scale
To generate it for GDev:
cargo run -- --dev --tmp
subxt metadata -f bytes > resources/metadata.scale
See [Upgrade metadata](../end2end-tests/README.md#upgrade-metadata) for more details.
[Unit]
Description=Duniter distance oracle.
Requires=duniter-smith.service
After=duniter-smith.service
[Service]
EnvironmentFile=/etc/duniter/env_file
ExecStart=/usr/bin/duniter2 distance-oracle --evaluation-result-dir ${BASE_PATH}/chains/${DUNITER_CHAIN_NAME}/distance --rpc-url ${ORACLE_RPC_URL} --interval ${ORACLE_INTERVAL} --log ${ORACLE_LOG_LEVEL}
User=duniter
Group=duniter
# Inspired from https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/scripts/packaging/polkadot.service
[Unit]
Description=Duniter mirror node.
[Service]
EnvironmentFile=/etc/duniter/env_file
ExecStart=/usr/bin/duniter2 --chain ${DUNITER_CHAIN_NAME} --name ${DUNITER_NODE_NAME}_mirror --listen-addr ${DUNITER_LISTEN_ADDR} --rpc-cors ${DUNITER_RPC_CORS} --state-pruning ${DUNITER_PRUNING_PROFILE} --base-path ${BASE_PATH}
User=duniter
Group=duniter
Restart=always
RestartSec=120
CapabilityBoundingSet=
LockPersonality=true
NoNewPrivileges=true
PrivateDevices=true
PrivateMounts=true
PrivateTmp=true
PrivateUsers=true
ProtectClock=true
ProtectControlGroups=true
ProtectHostname=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=strict
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
RestrictNamespaces=false
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=landlock_add_rule landlock_create_ruleset landlock_restrict_self seccomp mount umount2
SystemCallFilter=~@clock @module @reboot @swap @privileged
SystemCallFilter=pivot_root
UMask=0027
[Install]
WantedBy=multi-user.target
# Inspired from https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/scripts/packaging/polkadot.service
[Unit]
Description=Duniter smith node.
[Service]
EnvironmentFile=/etc/duniter/env_file
ExecStart=/usr/bin/duniter2 --chain ${DUNITER_CHAIN_NAME} --name ${DUNITER_NODE_NAME}_smith --listen-addr ${DUNITER_LISTEN_ADDR} --rpc-cors ${DUNITER_RPC_CORS} --state-pruning ${DUNITER_PRUNING_PROFILE} --base-path ${BASE_PATH} --rpc-methods Unsafe --validator
User=duniter
Group=duniter
Restart=always
RestartSec=120
CapabilityBoundingSet=
LockPersonality=true
NoNewPrivileges=true
PrivateDevices=true
PrivateMounts=true
PrivateTmp=true
PrivateUsers=true
ProtectClock=true
ProtectControlGroups=true
ProtectHostname=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=strict
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
RestrictNamespaces=false
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=landlock_add_rule landlock_create_ruleset landlock_restrict_self seccomp mount umount2
SystemCallFilter=~@clock @module @reboot @swap @privileged
SystemCallFilter=pivot_root
UMask=0027
[Install]
WantedBy=multi-user.target
#Type Name ID GECOS Home directory Shell
u duniter - "Duniter user" /var/lib/duniter /sbin/nologin
# Sets the name of the node.
# This should be a unique identifier for your node within the network.
DUNITER_NODE_NAME=My Node
# Specifies the blockchain network to connect to.
DUNITER_CHAIN_NAME=gdev
# Defines the address and port for node communication.
# The format is /ip4/[IP address]/tcp/[port]/[protocol].
# If SMITH NODE: `/ip4/0.0.0.0/tcp/<port>` and `/ip6/[::]/tcp/<port>`. Otherwise: `/ip4/0.0.0.0/tcp/<port>/ws` and `/ip6/[::]/tcp/<port>/ws`.
DUNITER_LISTEN_ADDR=/ip4/0.0.0.0/tcp/30333
# Specify browser origins allowed to access the HTTP & WS RPC servers.
# A comma-separated list with no space of origins.
# Value of `all` will disable origin validation. Default is to allow localhost and
#<https://polkadot.js.org> origins.
# Default: "http://localhost:*,http://127.0.0.1:*,https://localhost:*,https://127.0.0.1:*,https://polkadot.js.org"
DUNITER_RPC_CORS=http://localhost:*,http://127.0.0.1:*,https://localhost:*,https://127.0.0.1:*,https://polkadot.js.org
# Configures the pruning profile to manage how old blockchain data is stored.
# This setting can only be set on the first creation of the database.
# Options:
# - 'archive': Keep the state of all blocks.
# - 'archive-canonical': Keep only the state of finalized blocks.
# - [number]: Keep the state of the last specified number of finalized blocks.
# Default: 256 for a balanced pruning strategy.
DUNITER_PRUNING_PROFILE=256
# Sets the directory for storing Duniter data.
# This should be a writable path on your system by the duniter user where the node can store its data.
# Default: /home/duniter/.local/share/duniter
BASE_PATH=/home/duniter/.local/share/duniter
# URL for the Oracle RPC server.
# This should point to the RPC endpoint that the oracle will use to communicate with the blockchain.
# Default: ws://127.0.0.1:9944 for a local WebSocket RPC server.
ORACLE_RPC_URL=ws://127.0.0.1:9944
# Interval in seconds at which the oracle is run.
# This should not exceed the evaluation period of the blockchain.
# Default: 600 seconds
ORACLE_INTERVAL=600
# Determines the log level for the Oracle.
# Options include 'error', 'warn', 'info', 'debug', 'trace'.
# 'info' is a good default that provides useful runtime information without too much detail.
# Default: info
ORACLE_LOG_LEVEL=info
#!/bin/sh
set -e
action="$1"
config_file="/etc/duniter/env_file"
if [ "$action" = "configure" ]; then
# Make user and group
getent group duniter >/dev/null 2>&1 || addgroup --system duniter
getent passwd duniter >/dev/null 2>&1 ||
adduser --system --disabled-password \
--ingroup duniter duniter
# Create user home dir
if [ ! -d "/home/duniter/" ]; then
mkdir /home/duniter
chown -R duniter:duniter /home/duniter
chmod 700 /home/duniter
fi
fi
#DEBHELPER#
Source diff could not be displayed: it is too large. Options to address this: view the blob.
{
"first_ud": 10000,
"first_ud_reeval": 100800,
"identities": {
"Elois": {
"balance": 10000,
"certs": [
"poka",
"cgeek",
"vit",
"tuxmain",
"HugoTrentesaux",
"ManUtopiK",
"moul",
"1000i100",
"kapis",
"David B",
"Gamaliel",
"wellno1"
],
"pubkey": "5H95G8bwuf4yyNNNa83hDhj7wpYaSRhZiGezZ9TDbyqNdAhY"
},
"poka": {
"balance": 10000,
"certs": ["cgeek", "vit", "tuxmain", "Elois", "HugoTrentesaux"],
"pubkey": "5CQ8T4qpbYJq7uVsxGPQ5q2df7x3Wa4aRY6HUWMBYjfLZhnn"
},
"tuxmain": {
"balance": 10000,
"certs": [
"cgeek",
"Elois",
"HugoTrentesaux",
"ManUtopiK",
"poka",
"moul",
"1000i100"
],
"pubkey": "5D2DnScFpxoEUXDwZbJH18tRsQMygBSh1F6YCcWvTYzKY2W7"
},
"vit": {
"balance": 10000,
"certs": [
"cgeek",
"Elois",
"HugoTrentesaux",
"ManUtopiK",
"poka",
"tuxmain",
"moul"
],
"pubkey": "5DqkYGjiT5TFm2pGMUBMuZW4sw13vDEZmxqkxmky5AoQvUwd"
},
"cgeek": {
"balance": 10000,
"certs": ["poka", "vit", "tuxmain", "Elois", "HugoTrentesaux", "moul"],
"pubkey": "5DP7ze5cJwtHbqXaP2aNtJ5jkULzcTCqXuMzDvk9JjneFjfq"
},
"HugoTrentesaux": {
"balance": 10000,
"certs": [
"poka",
"vit",
"tuxmain",
"Elois",
"moul",
"1000i100",
"ManUtopiK",
"kapis",
"David B",
"Gamaliel",
"wellno1"
],
"pubkey": "5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz"
},
"ManUtopiK": {
"balance": 10000,
"certs": [
"poka",
"vit",
"tuxmain",
"Elois",
"HugoTrentesaux",
"1000i100"
],
"pubkey": "5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1"
},
"1000i100": {
"balance": 10000,
"certs": [
"Elois",
"poka",
"cgeek",
"vit",
"tuxmain",
"HugoTrentesaux",
"ManUtopiK",
"moul"
],
"pubkey": "5CCrBS67BrpBx3ihGHc72HZp3eHHbETxWFuNfwbbdoGSJFN8"
},
"moul": {
"balance": 10000,
"certs": [
"ManUtopiK",
"vit",
"tuxmain",
"Elois",
"HugoTrentesaux",
"1000i100"
],
"pubkey": "5EPGRtBYLwfDinnaAXsscM3FkffRADpJRrkZETqW8N6uhp22"
},
"Gamaliel": {
"balance": 10000,
"certs": ["David B", "wellno1", "kapis"],
"pubkey": "5DS9iWBXW56N7XbeVyyp6CB7m4LeE5fGJYrUR9HDSStT5JN9"
},
"kapis": {
"balance": 10000,
"certs": ["David B", "wellno1", "Gamaliel"],
"pubkey": "5HJyyim1W8Y1UD8LAbBL7cQQLjGofMoD45RtRSAmhkFQxrvs"
},
"David B": {
"balance": 10000,
"certs": ["kapis", "wellno1", "Gamaliel"],
"pubkey": "5HKTDdXHj3MojiPRcEsVU9JaHyif5gg2br1sy3JZbsjuQebP"
},
"wellno1": {
"balance": 10000,
"certs": ["David B", "kapis", "Gamaliel"],
"pubkey": "5DyEZNkSuK5i8wZiXtvL63zqpye9zPBsPRauCjQkMuVzZYX7"
}
},
"parameters": {
"babe_epoch_duration": 600,
"cert_period": 14400,
"cert_max_by_issuer": 100,
"cert_min_received_cert_to_issue_cert": 5,
"cert_renewable_period": 172800,
"cert_validity_period": 2102400,
"idty_confirm_period": 14400,
"idty_creation_period": 14400,
"membership_period": 1051200,
"membership_renewable_period": 172800,
"pending_membership_period": 172800,
"ud_creation_period": 14400,
"ud_reeval_period": 100800,
"smith_cert_period": 14400,
"smith_cert_max_by_issuer": 12,
"smith_cert_min_received_cert_to_issue_cert": 3,
"smith_cert_renewable_period": 172800,
"smith_cert_validity_period": 2102400,
"smith_membership_period": 1051200,
"smith_membership_renewable_period": 172800,
"smith_pending_membership_period": 172800,
"smiths_wot_first_cert_issuable_on": 14400,
"smiths_wot_min_cert_for_membership": 3,
"wot_first_cert_issuable_on": 0,
"wot_min_cert_for_create_idty_right": 5,
"wot_min_cert_for_membership": 5
},
"smiths": {
"Elois": {
"certs": ["poka", "cgeek", "vit", "tuxmain", "HugoTrentesaux", "kapis"],
"session_keys": "0xb67db3acc0ec68327e9e258aa5247a0f504616142ecb445c2540b9bdb223b5bea0beb8d9dea455ad5591961c868e59e0760e6e819a85c89ea7cbb527a0944241a0beb8d9dea455ad5591961c868e59e0760e6e819a85c89ea7cbb527a0944241a0beb8d9dea455ad5591961c868e59e0760e6e819a85c89ea7cbb527a0944241"
},
"poka": {
"certs": ["cgeek", "vit", "tuxmain", "Elois", "HugoTrentesaux"]
},
"tuxmain": {
"certs": ["cgeek", "Elois", "HugoTrentesaux", "poka", "kapis"]
},
"vit": {
"certs": ["cgeek", "Elois", "HugoTrentesaux", "poka"]
},
"cgeek": {
"certs": ["poka", "vit", "tuxmain", "Elois", "HugoTrentesaux"]
},
"HugoTrentesaux": {
"certs": ["poka", "vit", "tuxmain", "Elois", "kapis"]
},
"1000i100": {
"certs": ["cgeek", "vit", "tuxmain", "Elois", "HugoTrentesaux", "poka"]
},
"kapis": {
"certs": ["Elois","tuxmain","HugoTrentesaux"]
}
},
"sudo_key": "5Co5AWcBiz4HaAEpu8BxLdghnCob89rFGU5yQ65WP3t2jsyB"
}
# 10,00 ĞD per UD
ud: 1000
# null = block#0 + ud_creation_period waiting (ms)
first_ud: null
# null = block#0 + ud_reeval_period waiting (ms)
first_ud_reeval: null
# Parameters used in pallet `duniter-test-parameters`
parameters:
# Epoch (session) duration, in number of blocks. 1h.
babe_epoch_duration: 600
# Time between 2 UDs, in milliseconds. 4 hours.
ud_creation_period: 14400000
# Time between 2 UD reevaluations, in milliseconds. 24 hours.
ud_reeval_period: 86400000
# ----- MAIN WOT -----
# Duration to wait between two emitted certifications 14400 blocks = 24h = 1 day.
cert_period: 14400
# Maximum quantity of currently valid certifications emitted by a same issuer. 100 certs.
cert_max_by_issuer: 100
# Minimum quantity of received certifications to be able to certify someone else. 3 certs.
cert_min_received_cert_to_issue_cert: 3
# Validity duration of a certification, 2102400 blocks = 146 days.
cert_validity_period: 2102400
# Validity duration of a membership. 1051200 blocks = 73 days.
membership_period: 1051200
# Period to wait before membership renewal. 1051200 blocks = 1 days.
membership_renewal_period: 14400
# Delay a new member must observe before being able to emit a certification
wot_first_cert_issuable_on: 0
# Number of required received certs to become a member
wot_min_cert_for_membership: 3
# Duration to wait between two identity creations. 14400 blocks = 24h = 1 day. (equal to cert_period)
idty_creation_period: 14400
# Window to confirm an identity, in blocks. 14400 blocks = 24h = 1 day.
idty_confirm_period: 14400
# Number of required received certs to be able to create identities
wot_min_cert_for_create_idty_right: 3
# ----- SMITH WOT -----
# Maximum quantity of currently valid certifications emitted by a same issuer. 15 certs.
smith_cert_max_by_issuer: 15
# Maximum duration a smith can be offline without being excluded
smith_inactivity_max_duration: 336
# Number of required received smith certs to become a smith member
smith_wot_min_cert_for_membership: 2
# Clique Smith WoT: each smith will certify by each other smith automatically on Genesis
clique_smiths:
- name: "Pini"
- name: "moul"
- name: "HugoTrentesaux"
- name: "tuxmain"
- name: "1000i100"
- name: "vit"
- name: "cgeek"
# This smith will be the first author
session_keys: "0xec6d7141864ca265b1c31a164d258e907e044380ac110c57502135943904137f5a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd285a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd285a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd28"
sudo_key: "5CfodrEFe64MJtWvfhTHYBuUySr4WXLv2B41mZFucTXSGMFA"
# The address which will automatically transfer 1,00 ĞD on Genesis to the Treasury
treasury_funder_pubkey: "2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ"
# The technical committee members, to act as sudo
technical_committee:
["Pini", "moul", "HugoTrentesaux", "tuxmain", "Maaltir", "vit", "cgeek", "poka"]
# 10,00 ĞT per UD
ud: 1000
# FIXME: explain `null` meaning
first_ud: null
# FIXME: explain `null` meaning
first_ud_reeval: null
# Clique Smith WoT: each smith will certify by each other smith automatically on Genesis
clique_smiths:
- name: "Pini"
- name: "moul"
- name: "HugoTrentesaux"
- name: "tuxmain"
- name: "1000i100"
- name: "vit"
- name: "cgeek"
# This smith will be the first author
session_keys: "0xec6d7141864ca265b1c31a164d258e907e044380ac110c57502135943904137f5a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd285a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd285a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd28"
# FIXME
sudo_key: "5Hm8sBbwuLAU99dBezvgtnRmZCrUy9mhqmbQMFyGTaeATYg7"
# The address which will automatically transfer 1,00 ĞD on Genesis to the Treasury
treasury_funder_pubkey: "2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ"
# The technical committee members, to act as sudo
technical_committee: ["Pini", "moul", "HugoTrentesaux", "tuxmain", "1000i100", "vit", "cgeek"]
\ No newline at end of file
No preview for this file type
[package]
name = "weight-analyzer"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
version.workspace = true
[lib]
name = "weightanalyzer"
path = "src/lib.rs"
[dependencies]
convert_case = { workspace = true }
glob = { workspace = true }
serde = { workspace = true, features = ["derive"] }
subweight-core = { workspace = true }
[features]
std = []
use convert_case::{Case, Casing};
use glob::glob;
use serde::Serialize;
use std::{collections::HashMap, ops::Div, path::Path};
use subweight_core::{
parse::{
overhead::Weight,
pallet::{ChromaticExtrinsic, ComponentRange},
storage::Weights,
},
scope::Scope,
term::Term,
};
// Substrate default maximum weight of a block in nanoseconds.
// Since the maximum block weight is one-third of the execution time,
// it corresponds to a block time of 6 seconds.
const MAX_BLOCK_WEIGHT_NS: f64 = 2_000_000_000_000.;
pub struct MaxBlockWeight(f64);
impl Default for MaxBlockWeight {
fn default() -> Self {
MaxBlockWeight(MAX_BLOCK_WEIGHT_NS)
}
}
impl Div<&MaxBlockWeight> for f64 {
type Output = Self;
fn div(self, max_block_weight: &MaxBlockWeight) -> Self::Output {
self / max_block_weight.0
}
}
impl MaxBlockWeight {
pub fn new<T: Into<f64>>(value: T) -> Self {
MaxBlockWeight(value.into())
}
}
#[derive(Clone, Debug, Serialize)]
pub struct WeightInfo {
pub weight: u128,
pub relative_weight: f64,
}
/// Returns a HashMap <pallet_name, <extrinsic_name, weigh_info>>
/// of the analyzed weights.
///
/// # Arguments
///
/// * `folder_path` - A Path to a folder where the weight files are stored.
/// `paritydb_weights.rs` is mandatory and pallet weights should start by
/// `pallet_`.
/// * `max_block_weight` - The maximal weight of a block.
///
/// # Examples
///
/// ```
/// use weightanalyzer::analyze_weight;
/// use std::path::Path;
/// use weightanalyzer::MaxBlockWeight;
/// let weight_by_pallet = analyze_weight(Path::new("../../runtime/gdev/src/weights/"), &MaxBlockWeight::default());
/// println!("{:?}", weight_by_pallet);
/// ```
pub fn analyze_weight(
folder_path: &Path,
max_block_weight: &MaxBlockWeight,
) -> Result<HashMap<String, HashMap<String, WeightInfo>>, String> {
let pallet_weights = read_pallet_weight(folder_path)?;
let db_weight = read_db_weight(folder_path)?;
let overhead_weights = read_overhead_weight(folder_path)?;
// Initialize scope with db weights
let mut scope = Scope::from_substrate();
scope = scope.with_storage_weights(db_weight.weights.read, db_weight.weights.write);
process(pallet_weights, scope, max_block_weight, &overhead_weights)
}
fn read_pallet_weight(folder_path: &Path) -> Result<Vec<Vec<ChromaticExtrinsic>>, String> {
let mut parsed_files = Vec::new();
for path in glob(folder_path.join("*").to_str().expect("Invalid pallet path"))
.expect("Invalid pallet pattern")
.filter_map(Result::ok)
{
let file = subweight_core::parse::pallet::parse_file(&path);
if let Ok(file) = file {
parsed_files.push(file);
}
}
if parsed_files.is_empty() {
return Err("No pallet found".into());
}
Ok(parsed_files)
}
fn read_db_weight(folder_path: &Path) -> Result<Weights, String> {
subweight_core::parse::storage::parse_file(folder_path.join("paritydb_weights.rs").as_path())
}
fn read_overhead_weight(folder_path: &Path) -> Result<Weight, String> {
subweight_core::parse::overhead::parse_file(folder_path.join("extrinsic_weights.rs").as_path())
}
fn evaluate_weight(
extrinsic: ChromaticExtrinsic,
scope: &mut Scope<Term<u128>>,
max_block_weight: &MaxBlockWeight,
overhead: &Weight,
) -> Result<(String, String, WeightInfo), String> {
// Extend the scope with the maximum value of the complexity parameter.
if let Some(params) = extrinsic.comp_ranges {
params
.iter()
.for_each(|(key, val): (&String, &ComponentRange)| {
scope.put_var(key.as_str(), Term::Scalar(val.max.into()));
});
}
// Evaluate the weight
let mut weight = extrinsic
.term
.simplify(subweight_core::Dimension::Time)
.expect("Can't evaluate")
.eval(scope)?;
// Add base extrinsic overhead
if let Weight::ExtrinsicBase(i) = overhead {
weight += i
.simplify(subweight_core::Dimension::Time)
.expect("Can't evaluate")
.eval(scope)?;
}
let relative_weight = (weight as f64) / max_block_weight * 100.;
Ok((
extrinsic
.pallet
.to_case(Case::Title)
.replace("Pallet", "")
.replace(".rs", "")
.chars()
.filter(|c| !c.is_whitespace())
.collect(),
extrinsic.name,
WeightInfo {
weight,
relative_weight,
},
))
}
fn process(
pallet_weights: Vec<Vec<ChromaticExtrinsic>>,
mut scope: Scope<Term<u128>>,
max_block_weight: &MaxBlockWeight,
overhead: &Weight,
) -> Result<HashMap<String, HashMap<String, WeightInfo>>, String> {
let mut weight_by_pallet: HashMap<String, HashMap<String, WeightInfo>> = HashMap::new();
for i in pallet_weights {
for j in i {
let (pallet, extrinsic, weight) =
evaluate_weight(j, &mut scope, max_block_weight, overhead)?;
if let Some(i) = weight_by_pallet.get_mut(&pallet) {
i.insert(extrinsic, weight);
} else {
weight_by_pallet.insert(pallet, HashMap::from([(extrinsic, weight)]));
}
}
}
Ok(weight_by_pallet)
}
#[cfg(test)]
mod tests {
use crate::{analyze_weight, MaxBlockWeight};
use std::path::Path;
#[test]
fn should_works() {
let weight_by_pallet = analyze_weight(
Path::new("../../runtime/gdev/src/weights/"),
&MaxBlockWeight::default(),
);
assert!(
weight_by_pallet
.clone()
.unwrap()
.get("Balances")
.unwrap()
.len()
== 10
); // 8 extrinsics in pallet
println!("{:?}", weight_by_pallet); // cargo test -- --nocapture
}
#[test]
#[should_panic]
fn should_not_works() {
let _ = analyze_weight(Path::new(""), &MaxBlockWeight::default()).unwrap();
}
}
# Runtimes
Duniter client can run several runtimes.
- [ĞDev](https://doc-duniter-org.ipns.pagu.re/gdev_runtime/index.html) is for development purpose
- [ĞTest](https://doc-duniter-org.ipns.pagu.re/gtest_runtime/index.html) is to prepare Ğ1 migration and test features before deploying on Ǧ1
- [Ğ1](https://doc-duniter-org.ipns.pagu.re/g1_runtime/index.html) is the production currency