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 theSR25519_KEY
environment variable - ECDSA —
--ecdsa-key
or theECDSA_KEY
environment variable - Ed25519 —
--ed25519-key
or theED25519_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
Name | Description |
---|---|
--node-rpc | The node's RPC address (including port), defaults to ws://127.0.0.1:42069 |
--sr25519-key | Sr25519 keypair, encoded as hex, BIP-39 or a dev phrase like //Charlie |
--ecdsa-key | ECDSA keypair, encoded as hex, BIP-39 or a dev phrase like //Charlie |
--ed25519-key | Ed25519 keypair, encoded as hex, BIP-39 or a dev phrase like //Charlie |
Read more about how cryptographic keys are used in Polkadot — https://wiki.polkadot.network/docs/learn-cryptography.
If a key is passed to the CLI, but the operation called does not require a key, the key will not be used.