Skip to content

Latest commit

 

History

History
115 lines (80 loc) · 3.03 KB

README.md

File metadata and controls

115 lines (80 loc) · 3.03 KB

Blockchain in Scala

Travis branch Coveralls github branch

A simplified Blockchain implementation in Scala based on the specifications of Bitcoin.

This project is still under development. APIs are not fully completed according to the cores.

Inspired by:

This project is meant to learn and understand Bitcoin and Blockchain. I personally also in the process of learning. So, what's a better the approach of learning it by building one ! Because of this is a continuous learning process, there might be something I do not understand earlier. Now when I understand it, the code will also be changed according. I am happy to discuss with you, which will make this learning process quicker and efficient.

Start the service, run this Class:

com.github.fluency03.blockchain.api.Server

REST APIs

REST API service is built on the open source projects akka and akka-http.

Please see the full API Documentation on Postman: blockchain-in-scala

Summary:

Default hostname and port is localhost:9090.

root

/

blockchain

GET  /blockchain
POST /blockchain
DEL  /blockchain
GET  /blockchain/validity
GET  /blockchain/last-block
DEL  /blockchain/last-block
POST /blockchain/new-block
POST /blockchain/next-block
GET  /blockchain/block/:hash
GET  /blockchain/block/:hash/transaction/:id

block

GET  /block-pool/blocks
GET  /block-pool/block/:hash
POST /block-pool/block
POST /block-pool/next-block
DEL  /block-pool/block/:hash
GET  /block-pool/block/:hash/transaction/:id

transaction

GET  /tx-pool/transactions
GET  /tx-pool/transaction/:id
POST /tx-pool/transaction
PUT  /tx-pool/transaction/:id
DEL  /tx-pool/transaction/:id

network

GET  /network
POST /peer
GET  /peers
GET  /peers?names=name1,name2
GET  /peer/:name

generic

POST /generic/to-sha256
POST /generic/to-base64
POST /generic/from-base64
POST /generic/to-epoch-time
POST /generic/time-from-epoch

References

Todos

  • Complete APIs' Todos
  • API tests
  • Make states in actor persistent (using Akka Persistent)
  • Concurrent collections?
  • Make data distributed within cluster of peer (using Akka Cluster)
  • Block propagation among peers
  • etc.