Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 1.37 KB

README.md

File metadata and controls

29 lines (15 loc) · 1.37 KB

Blockchain

Proof-of-concept of the inner workings of a novel cryptocurrency. Full implementation from blockchain data structure, to new block mining, to P2P networking layer.

Presentation of Implementation

Presentation of Implementation

Installation

docker pull asgaines/blockchain:latest

Run Node

docker run -p 20403:20403 --rm -v ${PWD}/blockchain_storage:/storage -e BLOCKCHAIN_KEY=<your-key> asgaines/blockchain:latest -returnAddr=<your-ip>:20403 -seeds=<peer-ip:port>

BLOCKCHAIN_KEY is your "private" key, used for generating your wallet address and for verifying transactions. It can be whatever you'd like, so long as it's unique in the network.

Remove the volume mounting (-v ${PWD}/blockchain_storage:/storage) if you don't care to analyze the ledger after mining.

Node Client

Submit Transaction

docker run -i --rm --entrypoint="" asgaines/blockchain:latest go run client/main.go node sharetx -s <node-ip:port> <<< '{"tx": {"value": <amount-to-transfer>, "senderKey": "<your-key>", "recipient": "<recipient-pubkey>", "message": "<optional>"}}'

Check Credit

docker run -i --rm --entrypoint="" asgaines/blockchain:latest go run client/main.go node getcredit -s <node-ip:port> <<< '{"key": "<your-key>"}'