nai
github.com/m0t0k1ch1/naivechain
go get github.com/m0t0k1ch1/naivechain
nai

github.com/m0t0k1ch1/naivechain

a simple Blockchain inspired by https://github.com/lhartikk/naivechain written in Go

go get github.com/m0t0k1ch1/naivechain
Readme

naivechain

wercker status

a simple Blockchain inspired by https://github.com/lhartikk/naivechain written in Go

Install

$ go get -u github.com/m0t0k1ch1/naivechain

Run

$ naivechain [-api HTTP_SERVER_ADDRESS_FOR_API] [-p2p WEBSOCKET_SERVER_ADDRESS_FOR_P2P] [-origin P2P_ORIGIN]

Example

$ naivechain -api :3001 -p2p :6001

HTTP API

Get chain

$ curl http://127.0.0.1:3001/blocks

Mine block

$ curl http://127.0.0.1:3001/mineBlock -d '{"data":"some data to include in the block"}'

Add peer

$ curl http://127.0.0.1:3001/addPeer -d '{"peer":"ws://127.0.0.1:6002"}'

Get connected peers

$ curl http://127.0.0.1:3001/peers

GitHub Stars

11

LAST COMMIT

1yr ago

MAINTAINERS

0

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20210105144221-3e1dc603abec
1yr ago
No alternatives found
No tutorials found
Add a tutorial