Synopsis
cowboy relay registers CBFS relay nodes in the Relay Registry system actor (0x0B) defined by CIP-9 (Runner Attached Storage). Registration is owner-authorized: the operator wallet first registers an ed25519 owner delegation, and that delegated key then co-signs the relay registration.
Both subcommands sign with the operator wallet found by key auto-discovery, with limits from the node’s POST /estimate_gas.
Global flags:
Subcommands
cowboy relay register-delegation
Register a RasOwnerDelegation binding an ed25519 delegation key to the operator wallet. Run this before relay register.
Behavior:
- Load the operator wallet and the ed25519 delegation key (a file path, or 64 hex chars inline).
- Fetch the chain id and network name, and the current storage epoch (the
/health/detailedheight over the/chain-infostorage epoch length); the delegation is valid from that epoch throughcurrent + valid_epochs(minimum window 1). - Sign the delegation hash with the wallet (recoverable secp256k1) and wrap it in a
Rassystem instruction. - Print the operator address, delegated pubkey, scopes, service class, chain, epoch window, nonce, and transaction hash.
- Submit via the node’s general
POST /submitendpoint (there is no dedicated route).
Example:
cowboy relay register
Register a CBFS relay into the 0x0B relay registry via a RegisterRelay RAS transaction.
Behavior:
- Load the operator wallet, the relay identity ed25519 key, and the owner-delegation ed25519 key.
- Fetch the current storage epoch; authorizations are valid from it through
current + valid_epochs. This must not exceed the on-chain delegation’s ownvalid_until_epoch. - Build
RegisterRelaywith two authorizations over the same payload hash: one signed by the relay identity key (proving control of the node id) and one signed by the delegation key (owner authorization). Both carry random 16-byte nonces. - Read the stake top-up the registration debits (the governed
cbfs.min_relay_stakefromGET /fees/pricing, less any stake this node id already holds), sign the transaction with the wallet, andPOST /ras/relays/register. - Print the operator address, node id, both public keys, epoch window, endpoint, capacity, region, nonce, and transaction hash, then a reminder to verify the relay in the registry after inclusion.
valid_from_epoch is not later than the row’s updated_epoch. A captured registration therefore cannot be resubmitted by anyone to re-activate an exited relay, cancel a pending unstake, or debit the owner’s stake again. Because the CLI starts the window at the current storage epoch, a relay that changed during the current epoch can be re-registered from the next one.
Flags:
Example:
Edge Cases
registerrequires the delegation key to already be registered on chain with scopes covering bothcbfsandREGISTER_RELAY(or*); the executor rejects the registration otherwise.- Ed25519 keys are accepted as a file containing a 64-hex-char secret, or the secret inline; an inline secret is refused on a terminal and in non-interactive mode.
--node-idmust be exactly 64 hex characters (32 bytes,0xoptional).- The epoch window is stamped from the node’s own block height, not a local clock;
register-delegationdefaults to a longer window (60) thanregister(30) so the delegation outlives the authorizations it bounds. registerposts to/ras/relays/register;register-delegationposts to/submit.