Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Intro

Handbook for Spacejam, see Releases for the latest binaries.

Getting Started

curl -fsSL https://sh.spacejam.dev | sh

macOS Installation

brew tap spacejamapp/spacejam
brew install spacejam

Tools

Below are the tools that are available to you.

ToolDescription
testnetRunning a local JAM testnet
fuzzthe fuzz command of spacejam

testnet

$ testnet -h
The command line interface for testnet

Usage: testnet [OPTIONS] <COMMAND>

Commands:
  generate  Generate a new testnet configuration file
  prune     Prune the testnet
  start     Start the testnet
  help      Print this message or the help of the given subcommand(s)

Options:
  -c, --config <CONFIG>  The path to the testnet configuration file
  -n, --noansi           Whether to use ANSI colors in the output
  -h, --help             Print help

Config

[network]
spec = "crates/spacejam/spec/dev/spec.json"
filter = []
watch = []

[node.polkajam-0]
command = "polkajam"
arch = "polkajam"
data = "res/testnet/0"
quic = "0.0.0.0:40000"
rpc = "0.0.0.0:19800"
seed = "0"
env = { RUST_LOG = "jam_node=warn" }

[node.polkajam-1]
command = "polkajam"
arch = "polkajam"
data = "res/testnet/1"
quic = "0.0.0.0:40001"
rpc = "0.0.0.0:19801"
seed = "1"
env = { RUST_LOG = "jam_node=warn" }

[node.polkajam-2]
command = "polkajam"
arch = "polkajam"
data = "res/testnet/2"
quic = "0.0.0.0:40002"
rpc = "0.0.0.0:19802"
seed = "2"
env = { RUST_LOG = "jam_node=trace" }

[node.polkajam-3]
command = "polkajam"
arch = "polkajam"
data = "res/testnet/3"
quic = "0.0.0.0:40003"
rpc = "0.0.0.0:19803"
seed = "3"
env = { RUST_LOG = "jam_node=warn" }

[node.polkajam-4]
command = "polkajam"
arch = "polkajam"
data = "res/testnet/4"
quic = "0.0.0.0:40004"
rpc = "0.0.0.0:19804"
seed = "4"
env = { RUST_LOG = "jam_node=warn" }

[node.spacejam]
command = "target/release/spacejam"
arch = "spacejam"
data = "res/testnet/5"
quic = "0.0.0.0:40005"
rpc = "0.0.0.0:19805"
seed = "5"
env = { RUST_LOG = "spacejam,runtime,network=trace" }

fuzz

$ spacejam fuzz -h
Spacejam fuzz command

Usage: spacejam fuzz [OPTIONS] <COMMAND>

Commands:
  target  Fuzz with local unix socket
  fuzzer  Fuzz with a fuzzer
  tx      Run trace test via the given trace file
  help    Print this message or the help of the given subcommand(s)

Options:
  -v...         The verbosity level (repeat for more verbosity)
  -n, --noansi  Disable ANSI colors
  -h, --help    Print help

Usage

# Start a fuzz target
spacejam fuzz target -v

# Run a fuzzer
spacejam fuzz fuzzer -t jam-test-vectors/traces/storage -v

# Run a trace test
spacejam fuzz tx jam-test-vectors/traces/storage/00000001.json -v