Skip to main content

Synopsis

cowboy watchtower init
cowboy watchtower new feed --name <str> [--description <str>]
cowboy watchtower feed <id> publish --data <json>
cowboy watchtower feed <id> subscribers
cowboy watchtower list
cowboy watchtower feeds
All write commands use key auto-discovery for the private key.

Subcommands

cowboy watchtower init

Deploy and initialize the WatchtowerRegistry actor on the chain. Behavior:
  1. Load the private key using key auto-discovery.
  2. Deploy the WatchtowerRegistry system actor.
  3. Store the registry address in .cowboy/config.json.
This is an admin-only command used for initial chain setup. Example:
$ cowboy watchtower init
Deployed WatchtowerRegistry: 0xreg123...
Saved to .cowboy/config.json

cowboy watchtower new feed

Create a new data feed in the Watchtower registry. Behavior:
  1. Load the private key using key auto-discovery.
  2. Register a new feed with the given name and description.
  3. Print the feed ID.
Flags:
FlagDefaultDescription
--nameRequiredFeed name
--description""Feed description
Example:
$ cowboy watchtower new feed --name "ETH/USD Price" --description "Ethereum price feed"
Feed created: 1
  Name: ETH/USD Price
  Owner: 0x7a3B...F92E

cowboy watchtower feed <id> publish

Publish data to an existing feed. Behavior:
  1. Load the private key using key auto-discovery.
  2. Submit the JSON data as a new entry in the specified feed.
  3. The caller must be the feed owner.
Flags:
FlagDefaultDescription
--dataRequiredJSON-encoded data payload
Example:
$ cowboy watchtower feed 1 publish --data '{"symbol":"ETH/USD","price":"3245.67","timestamp":1741500000}'
Published to feed 1
  Transaction: 0xabc123...

cowboy watchtower feed <id> subscribers

List subscribers of a specific feed. Behavior:
  1. Query the registry for all subscribers to the given feed ID.
  2. Print each subscriber’s address and subscription details.
Example:
$ cowboy watchtower feed 1 subscribers
0x1a2B...C3D4  subscribed at block 142
0x5e6F...A7B8  subscribed at block 155

cowboy watchtower list

List all feeds in the Watchtower registry. Behavior:
  1. Query the WatchtowerRegistry for all registered feeds.
  2. Print a summary of each feed.
Example:
$ cowboy watchtower list
  1  ETH/USD Price     Owner: 0x7a3B...F92E  Entries: 1042
  2  BTC/USD Price     Owner: 0x7a3B...F92E  Entries: 987
  3  NBA Game Scores   Owner: 0x9c0D...E1F2  Entries: 45

cowboy watchtower feeds

List feeds created by the current wallet. Behavior:
  1. Load the private key using key auto-discovery.
  2. Derive the wallet address.
  3. Query the registry for feeds owned by this address.
  4. Print a summary of each feed.
Example:
$ cowboy watchtower feeds
  1  ETH/USD Price     Entries: 1042
  2  BTC/USD Price     Entries: 987

Edge Cases

  • publish requires the caller to be the feed owner.
  • list and subscribers are read-only and do not require a private key.
  • feeds requires a private key (to determine the owner address).
  • Feed IDs are sequential integers assigned by the registry.

Further Reading