Storagext CLI

Alongside the pallets, we've also developed a CLI to enable calling extrinsics without Polkadot.js.

The CLI's goal is to ease development and testing and to sidestep some limitations of the Polkadot.js visual interface.

This chapter covers how to use the storagext-cli, along with that, there are several usage examples available throughout the book.

Getting started

The storagext-cli takes two main flags — the node's RPC address and a key1, the latter is split into three kinds, and one is required for most operations (for example, if the operation being called is a signed extrinsic2):

  • Sr25519--sr25519-key or the SR25519_KEY environment variable
  • ECDSA--ecdsa-key or the ECDSA_KEY environment variable
  • Ed25519--ed25519-key or the ED25519_KEY environment variable

For example, to connect to a node at supercooldomain.com:1337 using Charlie's Sr25519 key:

storagext-cli --node-rpc "supercooldomain.com:1337" --sr25519-key "//Charlie" <commands>

Or, retrieving the same key but using the environment variable form:

SR25519_KEY="//Charlie" storagext-cli --node-rpc "supercooldomain.com:1337" <commands>

Flags

NameDescription
--node-rpcThe node's RPC address (including port), defaults to ws://127.0.0.1:42069
--sr25519-keySr25519 keypair, encoded as hex, BIP-39 or a dev phrase like //Charlie
--ecdsa-keyECDSA keypair, encoded as hex, BIP-39 or a dev phrase like //Charlie
--ed25519-keyEd25519 keypair, encoded as hex, BIP-39 or a dev phrase like //Charlie
1

Read more about how cryptographic keys are used in Polkadot — https://wiki.polkadot.network/docs/learn-cryptography.

2

If a key is passed to the CLI, but the operation called does not require a key, the key will not be used.

Sub-chapters