Simple-golang-blockchain-example

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

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 11 Imported by: 0

README

Simple Blockchain example

This is the simplest blockchain example possible. it implements only a chain of blocks with data. And does not include any of high order concepts like mining of chain verification.

How to use it

1) First, download the repository

git clone https://github.com/Rufaim/Simple-golang-blockchain-example.git

OR

go get github.com/Rufaim/Simple-golang-blockchain-example

2) Second, run a server

go run . config.json

Message Server is on http://localhost:8080 should appear is console for default config.

3) Then open visualization interface at http://localhost:8080. interface

Direct API requests are also supported.
To add block use

curl -X POST http://localhost:8080/bc -d '{"data":"some_data"}'

To get all blocks use

curl -X GET http://localhost:8080/bc

Please note that a block added via API request is visible on visualization interface after page update.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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