naivechain

command module
v0.0.0-...-fe8a212 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2017 License: MIT Imports: 11 Imported by: 0

README

naivechain

A naive and simple implementation of blockchains.

Build And Run
  • Download and compile go get -v github.com/kofj/naivechain

  • Start First Node

    naivechain -peers ""
    
  • Start Second Node

    naivechain -api :3002 -p2p :6002 -peers ws://localhost:6001
    
HTTP API
  • query blocks

    curl http://localhost:3001/blocks
    
    
  • mine block

    curl -H "Content-type:application/json" --data '{"data" : "Some data to the first block"}' http://localhost:3001/mine_block
    
    
  • add peer

    curl -H "Content-type:application/json" --data '{"peer" : "ws://localhost:6002"}' http://localhost:3001/add_peer
    
    
  • query peers

    curl http://localhost:3001/peers
    

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL