On the 22nd of April 2024, the Logion solochain was stopped and all data were migrated to the parachain. At that time, both runtimes were equivalent feature-wise. Ongoing development continues on the parachain's runtime:
https://github.com/logion-network/logion-collator
This project exposes the Logion network's nodes.
Logion nodes implementation is based on Substrate Node Template v3.0.
The logion chain exposes the following features:
The logion network is permissioned. The list of "well-known" nodes (i.e. nodes that are authorized to validate blocks) is managed by the root user (Alice for the moment). The permissioned network was configured by following this tutorial.
New validators have to generate their node key and communicate the peer ID and owner account to a root user in order
to be added to the
list of well known nodes and start validating blocks. Node keys may be generated
using subkey
, see here.
Finally, here are the general parameters of Logion nodes' Runtime:
- Block time: 6s
- Hash algorithm: Blake2
- Hash size: 256-bits
- Block number: 32 bits
- Account index depth: 32 bits
- Account balance depth: 128 bits
- Transaction chain index depth: 32 bits
- Block authoring: Aura
- Block finalization: GRANDPA
- Database: RocksDb
First, complete the basic Rust setup instructions.
Use the following command to build the node without launching it:
cargo build --release
Below command will run the node in development mode with a temporary storage.
./target/release/logion-node --dev
- The Node is the implementation of the chain.
- The Typescript backend stores data which cannot be exposed publicly, or which wait legal officer's approval.
- The Wallet is the user application.
The following commands can be used to rebuild testnet chainspec files in res
folder ($ENV
is one of dev or test):
./target/release/logion-node build-spec --disable-default-bootnode --chain test > ./res/$ENV-plain.json
./target/release/logion-node build-spec --chain ./res/$ENV-plain.json --raw --disable-default-bootnode > ./res/$ENV-raw.json
try-runtime
tool enables the testing of a new runtime against real data.
Generally, what's tested here is one or several storage migrations activated by the new runtime or any Polkadot upgrade.
If not yet done, the Substrate Try Runtime CLI must be installed:
cargo install --git https://github.com/paritytech/try-runtime-cli --locked
If not yet done, the runtime has to be built with the try-runtime
feature:
cargo build --release --features=try-runtime
It can then be tested by executing the following command:
try-runtime --runtime target/release/wbuild/logion-node-runtime/logion_node_runtime.compact.compressed.wasm on-runtime-upgrade live --uri wss://rpc01.logion.network:443
This will:
- connect to RPC node
- download current state
- execute the upgrade
- run pallets'
post_upgrade
hook
In order to run benchmarks, the runtime has to be built with the right features enabled:
./scripts/build_benchmark.sh
All required benchmarks can be run by executing the following command:
./scripts/benchmark_all.sh
Pallet benchmarks can be run one at a time with the following command:
./scripts/benchmark_one.sh $PALLET
with $PALLET being a pallet name listed in runtime/src/weights
(the file name without extesion .rs
).
./runtime/Cargo.toml
: in section[features]
, add pallet toruntime-benchmarks
array../runtime/src/lib.rs
:
- If not already done, configure pallet with default
WeightInfo
(type WeightInfo = ();
). - Add pallet to
define_benchmarks!
arguments
- Re-build runtime for benchmarks (see above); a failure here may mean that the pallet does not have any benchmark or benchmark code is broken.
- Run
./scripts/list_benchmarks.sh
and make sure that added pallet appears. If it is not the case,cargo clean
then restart from step 3. - Run benchmark for the new pallet (see above); a failure here (no module file produced) may mean that benchmark code is broken. If the bencharmks are not
./runtime/src/weights.rs
: Add newly generated module../runtime/src/lib.rs
: Pass generatedWeightInfo
to pallet (type WeightInfo = weights::PALLET_NAME::WeightInfo<Runtime>;
).- Run
cargo check
; a failure here may mean that pallet benchmarks were not updated following a pallet API change. ./scripts/benchmark_all.sh
: add pallet toPALLETS
array.
- Build using
srtool
cp rust-toolchain.toml runtime/
srtool build --root --package logion-node-runtime --runtime-dir runtime
rm runtime/rust-toolchain.toml
The toolchain file must be copied to prevent an issue about missing rust-src
during build. This step (and clean-up)
may be removed once it is added to srtool's Docker image.