Mjolnir is a load cli & api project which operates on jormungandr node.

Build & Install

In order to build mjolnir in main project folder run:

cd testing/mjolnir
cargo build
cargo install --path . --force

Quick Start


Mjolnir can be used as a cli. It is capable of putting various load on jormungandr node. It has couple of different load types:

  • explorer - Explorer load
  • fragment - Fragment load
  • passive - Passive Nodes bootstrap
  • rest - Rest load

Simplest load configuration is to use rest load with below parameters:

Rest load

    mjolnir.exe rest [FLAGS] [OPTIONS] --duration <duration> --endpoint <endpoint>

    -h, --help       Prints help information
    -m, --measure    Prints post load measurements
    -V, --version    Prints version information

    -c, --count <count>                            Number of threads [default: 3]
        --delay <delay>                            Amount of delay [milliseconds] between sync attempts [default: 50]
    -d, --duration <duration>                      Amount of delay [seconds] between sync attempts
    -e, --endpoint <endpoint>                      Address in format:
    -b, --progress-bar-mode <progress-bar-mode>    Show progress bar [default: Monitor]


Mjolnir main purpose is to serve load api:

fn main() {
use jortestkit::load::{self, ConfigurationBuilder as LoadConfigurationBuilder, Monitor};
use std::time::Duration;

    //node initialization
    let mut jormungandr = ...

    let rest_client = jormungandr.rest();

    // create request generator for rest calls
    let request = mjolnir::generators::RestRequestGen::new(rest_client);

    // duration based load run (40 seconds)
    let config = LoadConfigurationBuilder::duration(Duration::from_secs(40))
        // with 5 threads
        // with delay between each request 0.01 s
        // with monitor thread monitor status of load run each 0.1 s
        // with status printer which prints out status of load run each 1 s

    // initialize load in sync manner
    // (duration of each request is calculated by time difference between receiving response and sending request )
    let stats = load::start_sync(request, config, "Jormungandr rest load test");

    // finally some way to assert expected correctness, like percentage of successful requests
    assert!((stats.calculate_passrate() as u32) > 95);

full list of available commands

Full list of commands is available on mjolnir --help command.

mjolnir 0.1.0
Jormungandr Load CLI toolkit

    mjolnir.exe [FLAGS] [SUBCOMMAND]

        --full-version      display full version details (software version, source version, targets and compiler used)
    -h, --help              Prints help information
        --source-version    display the sources version, allowing to check the source's hash used to compile this
                            executable. this option is useful for scripting retrieving the logs of the version of this
    -V, --version           Prints version information

    explorer    Explorer load
    fragment    Fragment load
    help        Prints this message or the help of the given subcommand(s)
    passive     Passive Nodes bootstrap
    rest        Rest load