Giter Site home page Giter Site logo

fault-tolerance-demo's Introduction

fault-tolerance-demo

A demo of tendermint's fault tolerance.

Start a testnet with four nodes, monitor it to ensure it's healthy (making blocks). Kill a node, the network should remain healthy. Kill a second node, the network should cease making blocks. Bring a stopped node back online and the network should continue making blocks.

Pre-requisites

  • Install tendermint, mintnet (ports branch), tmsp dummy, tmsp-cli, netmon
  • Launch machines test1, test2, test3, test4
  • jq for pretty printing json

Scripts

  • launch.sh - launch the testnet on the machines and start the netmon to monitor them
  • rm.sh - remove the testnet and all created files. inverse of launch.sh
  • start_mint.sh - start a local tendermint node that syncs with the testnet. acts as a proxy for transactions
  • send_tx.sh - send thousands of random transactions to the local node to broadcast to the network

Commands

  • curl -s http://localhost:46670/get_chain?chainID=\"mynewchain\" | jq . - monitor the health and current state of the chain
  • curl -s http://localhost:46657/unconfirmed_txs | jq . - see the txs in the mempool
  • curl -s http://localhost:46657/unconfirmed_txs | jq .result[1].n_txs - size of the mempool
  • mintnet rm --force --machines "test1" mynewapp - kill a node
  • mintnet start --machines "test1" --seed-machines "test[1-4]" mynewapp mynewchain - start a node

Notes

Send transactions with

curl http://localhost:46657/broadcast_tx_sync?tx=\"$(toHex foo=bar)\"

where toHex is the bash function

function toHex() {
	echo -n $1 | hexdump -ve '1/1 "%.2X"'
}

And query for the result with

tmsp-cli query foo

which should, in this case, return bar

fault-tolerance-demo's People

Contributors

ebuchman 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.