Coder Social home page Coder Social logo

heartbeat's Introduction

Corda

Heartbeat CorDapp

This CorDapp is a simple showcase of scheduled activities (i.e. activities started by a node at a specific time without direct input from the node owner).

A node starts its heartbeat by calling the StartHeartbeatFlow. This creates a HeartState on the ledger. This HeartState has a scheduled activity to start the HeatbeatFlow one second later.

When the HeartbeatFlow runs one second later, it consumes the existing HeartState and creates a new HeartState. The new HeartState also has a scheduled activity to start the HeatbeatFlow in one second.

In this way, calling the StartHeartbeatFlow creates an endless chain of HeartbeatFlows one second apart.

Pre-requisites:

See https://docs.corda.net/getting-set-up.html.

Usage

Running the nodes:

The nodes do not expose a front-end or API, so you need to deploy from from the command line and interact with them via the CRaSH shell. See https://docs.corda.net/tutorial-cordapp.html#running-the-example-cordapp.

Interacting with the nodes:

Go to the CRaSH shell for PartyA, and run the StartHeatbeatFlow:

flow start StartHeartbeatFlow

If you now start monitoring the node's flow activity...

flow watch

...you will see the Heartbeat flow running every second until you close the Flow Watch window using ctrl/cmd + c:

xxxxxxxx-xxxx-xxxx-xx Heartbeat xxxxxxxxxxxxxxxxxxxx Lub-dub

heartbeat's People

Contributors

clintonio avatar adagys avatar mikehearn avatar chrisr3 avatar kasiastreich avatar exfalso avatar shamsasari avatar agoldvarg avatar davidleeuk avatar m4ksio avatar rick-r3 avatar andr3ej avatar cburlinchon avatar szymonsztuka avatar tb-pq avatar

Watchers

James Cloos avatar

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.