Giter Site home page Giter Site logo

tezos-watcher's Introduction

tezos-watcher GoDoc Build Status codecov

Monitor your Tezos node.

Installing

To install the CLI, use the following go get command or check the releases page.

$> go get github.com/bobheadxi/tezos-watcher/cmd/tezos-watcher

Usage

CLI

Get the Tezos Alphanet up and running. Make sure to start up a node with the RPC endpoints exposed - for example:

$> ./alphanet.sh start --rpc-port 8732

Optionally grab some free Tezzies to start off.

You can now start watching your local node:

$> tezos-watcher watch-chain

The -h flag offers documentation on the command line tool.

Library

w, _ := watcher.New(watcher.ConnectOpts{
  Host: "127.0.0.1", Port: "8732"})

quit := make(chan struct{})
defer close(quit)
statusCh, errCh := w.WatchBlock(watcher.BlockOptions{
  Chain: "main",
  Block: "head",
  Rate:  1 * time.Second,
}, quit)

for {
  select {
  case err := <-errCh:
    if err != nil {
      return
    }
  case event := <-statusCh:
    output, _ := json.Marshal(event)
    println(string(output))
  }
}

Development

$> make          # install dependencies, install tezos-watcher CLI
$> make node     # start up Tezos sandbox node
$> make test     # execute tests against sandbox node

Notes

This project was written as part of a pre-task for a job.

tezos-watcher's People

Contributors

bobheadxi avatar

Stargazers

Marek Fořt avatar bonedaddy avatar

Watchers

James Cloos avatar  avatar

tezos-watcher's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.