GithubHelp home page GithubHelp logo

bam-chain's Introduction

bam-chain

Baby blockchain implementation in rust.

How to use this?

Install rust and relative tool chain as prerequisition.

# Open a terminal
cargo build --release
./target/release/bam-chain 8181

# Open another terminal for spawning another miner node.
./target/release/bam-chain 8282

# Open another terminal for sending http request.
# i.e. use httpie in mac.
http POST http://localhost:8181/add_peers < resource/peers_template.json
http GET http://localhost:8181/list_peers

# Post data, a.k.a. mine a new block.
http POST http://localhost:8181/mine Hello=World
# List blocks.
http GET http://localhost:8181/list
# You can see that the added peers get into a same chain(except genesis block).
http GET http://localhost:8282/list

Supporting routes:

  • GET / : entry msg.
  • GET /list : list the blockchain in this node.
  • POST /mine : post a data and add a block in the node.
  • POST /add_peers : add peers to this node.
  • GET /list_peers : list peers of this node.

Incoming update: easy deployment, stabilized inter-connection service, introduce PoW/PoS and transactions, wallet UI.

Acknowledgement

This project is inspired by naivechain.

License

MIT.

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.