The goal for this repository is to create a binary that can generate linera transactions against a given network according to some test cases.
Note The current repository is based of the
linera-protocol
main
branch at commitd169df69
.
Install the linera binaries in the target/release
folder with:
$ cargo install --git https://github.com/linera-io/linera-protocol.git --branch main --bins --root ./target/release/
linera-service
$ cargo install --git https://github.com/linera-io/linera-protocol.git --branch main --bins --root ./target/release/
linera-storage-service
Also add them to your path if you do not have already installed the linera binaries globally:
export PATH="$PWD/target/release:$PATH"
source /dev/stdin <<<"$(linera net helper 2>/dev/null)"
The current CLI can be ran with the following:
$ cargo run --release -- help
Usage: linera-tx-generator <COMMAND>
Commands:
local Local mode with `storage-address` and `path` arguments
remote Remote mode with `url` argument
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
Warning The current CLI only handles local network
The counter case
leverages the counter example
from the linera-protocol
repository.
It essentially publishes the counter bytecode and service, then proceeds to increase the counter while checking through a node service that it has been properly increased.
To run the test case, you can use the following to run a local linera network:
$ linera net up --testing-prng-seed 37
Once the network is up make sure that you note the path to its /tmp/.tmp*
directory.
Then you can run the test case in another CLI window with:
$ cargo run --release -- local --path <TMP_FOLDER> --case counter
The blob case is meant to test the publication of different blob sizes on a network. It publishes blobs of three different sizes: 500kb, 2mb and 5mb.
To run the test case you will first need to run a local linera network. Different network configuration will result in different results. For example, the default configuration will allow for a maximum blob size of 18446744073709551615mb. While the devnet configuration will allow for a maximum blob size of 1mb.
The configuration can be run with the following:
# Default configuration
$ linera net up --testing-prng-seed 37
# Devnet configuration
$ linera net up --testing-prng-seed 37 --policy-config devnet
Once the network is up make sure that you note the path to its /tmp/.tmp*
directory.
To run the test case, you can use the following:
$ cargo run --release -- local --path <TMP_FOLDER> --case blob