Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

streamingfast/node-manager

Repository files navigation

StreamingFast Node Manager

reference License

Important

The code has moved to firehose-core, this repository still exists in read-only form so that older dependencies still resolves correctly.

This service is a wrapping process that operates blockchain nodes as part of StreamingFast.

Installation

Build and run from here:

Overview

  1. Operator (process commands, owns the superviser, owns the http handlers that sends the commands to him)

  2. Superviser is the the one managing the actual blockchain software (nodeos, geth..). It is made of an embedded generic superviser struct, plus specific nodeos/geth embedding it. It owns the plugins.

Shutdown pattern for Node-Manager only:

App creates:

  • Superviser
  • Operator (+superviser)

So, the ownership is app -> operator -> superviser

  • app.OnTerminating(operator.Shutdown())
  • operator.OnTerminating(sendCmd:"maintenance", superviser.Shutdown())
  • superviser.OnTerminating(superviser.Stop() (blocking))

Shutdown pattern for Mindreader:

App creates:

  • Superviser
  • Operator (+superviser)
  • mindreaderPlugin (has call back to set maintenance on operator and stopBlockReached)

App sets:

  • superviser.RegisterLogPlugin(mindreaderPlugin)

So, the ownership is app -> operator -> superviser -> mindreader

  • app.OnTerminating(operator.Shutdown())
  • operator.OnTerminating(sendCmd:"maintenance", superviser.Shutdown())
  • superviser.OnTerminating(mindreader.Shutdown(), then endLogPlugins)
  • superviser.OnTerminated(endLogPlugins)
  • mindreader.OnTerminating(async operator.Shutdown(), wait consumeFlowDone)
    • mindreader::archiver closes consumeFlowDone when superviser.endLogPlugins(+upload completed)
    • mindreader shuts itself down when stopBlockNum reached
  • mindreader.OnTerminated -> app.Shutdown()

Contributing

Issues and PR in this repo related strictly to the core manageos engine

Report any protocol-specific issues in their respective repositories

Please first refer to the general StreamingFast contribution guide, if you wish to contribute to this code base.

This codebase uses unit tests extensively, please write and run tests.

License

Apache 2.0