The cosmos-watcher is a standalone process that takes
2 env var running via docker:
- chain_id - blockchain network_id,
- graphql - connection string to graphql hasura api,
- rabbitmq - connection string to rabbitMQ message broker,
- queue - queue name for rabbitMQ message broker,
5 env var running directly & without run.sh script:
- rpc - a zone RPC address,
- height - a starting block number,
- rabbitmq - connection string to rabbitMQ message broker,
- queue - queue name for rabbitMQ message broker,
- chain_id - blockchain network_id to validate rpc address,
and listens to the given zone starting from the given block number.
Running in a container:
docker build -t cosmos-watcher:v1 .
docker run --env chain_id=<network like cosmoshub-4> --env graphql=<graphql endpoint like https://ip:port/v1/graphql> --env rabbitmq=amqp://<login>:<pass>@<ip>:<default_port=5672> --env queue=<message_broker_queue_name> -it --network="host" cosmos-watcher:v1
The watcher listens to the new blocks, parses them, and assembly the information into the zone-neutral data structures.
block {
chain_id: <string>, the zone chain id
block_time: <timestamp>
block_num: <number>
txs: array [transaction]
}
transaction {
hash: <string>
sender: <string>
accepted: <boolean>
msgs: array [message]
}
message {
type: (transfer | ibc_transfer | create_channel | create_connection | create_client | open_channel | close_channel)
<data related to message type>
}
the newly created object of the block
type is sent to the queue.