ecadlabs / tez-cli

An experimental tezos command line interface
MIT License
3 stars 1 forks source link

Implement ability to `--watch` for blocks or operations #8

Open jevonearth opened 5 years ago

jevonearth commented 5 years ago

Add a global option;

-w, --watch=false: After listing/getting the requested block or operation, watch for changes.

Examples;

tez block head will print the latest head block, and exit

tez block head --watch or tez block head -w

Should not detach from the terminal, but instead will wait for the next block from head, and print it. Continuing until it gets SIGINT from the users terminal.

We can extend this to operations and kinds

tez block operations head --kind tx,ballot -w would print transactions and ballots to the console as they are received.

jevonearth commented 5 years ago

https://github.com/ecadlabs/tezos-bot has an implementation that listens on the monitor head endpoint and filters for specific operations. Inspiration can be taken from that implementation for this feature.