Binary Features and Commands - frequency-chain/frequency GitHub Wiki

Build Features

Network Features

frequency

Mainnet on the Polkadot Relay Chain.

frequency-no-relay

Frequency without a relay (instant/manual/interval sealing)

Supports several options:

  • Frequency with manual sealing --sealing=manual (Requires RPC call to engine_createBlock to form a block)
  • Frequency with instant sealing --sealing=instant (Manual sealing + automatic block creation triggered on any transaction in the transaction pool)
  • Frequency with interval sealing --sealing=interval (Blocks are sealed on the specified interval (default is 12s))

frequency-rococo-testnet

Frequency on the Parity run Rococo Testnet Relay Chain.

frequency-rococo-local

  • Frequency on a Rococo Local Relay Chain

frequency-lint-check

Used in development to enable more code coverage for linting and code checking.

WASM Reduction Features

on-chain-release-build

Used to generate smaller WASM binaries. Disables logging for example.

no-metadata-docs

Used to generate smaller WASM binaries. Removes some metadata documentation.

Substrate Features

runtime-benchmarks

Enables benchmarking. Should never be used in a build designed for connecting to an actual network. See Substrate Documentation for more information.

try-runtime

Enables a CLI Command that can do various tests against snapshots and running chain storage. Should never be used in a build designed for connecting to an actual network. See Substrate Documentation for more information.

Rust Features

std

Enables the Rust standard environment which cannot be used in the WASM.

Common Environment Variables

  • RUST_LOG env_logger
  • CARGO_INCREMENTAL Incremental compilation. Often set to 0 when not needing future cached builds in CI
  • RUSTFLAGS Used to pass flags such as RUSTFLAGS="-D warnings"
  • SKIP_WASM_BUILD Used to skip building the WASM

More Complete Lists

CLI Flags

./frequency --help will give the full list of flags available.

Chain Specifications

Frequency has several chain specifications but usually only one is enabled per binary based on the build feature used. This is intentional so that the wrong binary will always fail to connect to the network.

  • frequency for Mainnet
  • frequency-rococo-testnet, frequency-rococo, rococo, testnet for the Rococo Testnet
  • frequency-rococo-local for a Rococo local relay.
  • dev Local development (no relay) with either manual or instant sealing
  • frequency-bench Used to generate benchmarks or other interactions that need a binary generated chain spec.

Remember

  • Chain specs contain the runtime. So a live network chain spec is always going to use the runtime of the genesis until they sync.
  • Generated chain specs will create a new chain spec from the binary. Useful if you want the code "version" of the metadata or runtime from the binary.

Logging Flags

Possible Log Levels: trace, debug, info, warn, error

  • -lruntime=[level] Runtime Logs. Often enabled in development.
  • -lsync=[level] Gossip network and other sync logs.
  • -lcumulus-collator=[level] Collator and block formation logs.

For more logging targets, search the Cumulus, Substrate, and Polkadot code for const LOG_TARGET.

See Substrate Documentation for additional information on logging in the code.

CLI Commands

The following CLI commands are implemented for Frequency as compared to parachain-node-template

  • Export runtime metadata

    ./frequency export-metadata frequency-metadata.json
    
  • Export runtime version

    ./frequency export-runtime-version > frequency-runtime.json
    
  • Run chain in isolated mode (without peer networking)

    # Option 1
    ./frequency --tmp --in-peers 0 --out-peers 0
    # Option 2
    ./frequency --tmp --reserved-only -- --reserved-only