Based on
- https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b
- https://github.com/lhartikk/naivechain
You need:
- jdk 11
- maven
- docker
- docker compose
Execute
mvn clean package && docker-compose up
Than you can communicate with nodes on these url:
- guestlist: http://localhost:10000/
- node_one: http://localhost:10001/
- node_two: http://localhost:10002/
- node_three: http://localhost:10003/
Put those urls in you browser to show node's data.
POST /nodes
join the net, body contains the hostnameGET /nodes
retrieve the nodes' hostnames
POST /transactions
create a transaction, body contains the json representationGET /mine
mine a blockGET /blocks
retrieve the blockchainPOST /addPeer
make the peer extabilish a websocket connection. body contains the hostname