Skip to content

zykron1/Blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain

Custom peer to peer blockchain network made from absolute scratch using raw tcp and a custom JSON RPC system.

Usage

Run main.py to launch the CLI

Quickstart

To start, first start the CLI before then running the following commands: node start 0.0.0.0 5000
node request peers
node request chain
node request height

Commands

General

node start <host> <port>
Launches a server at <host>:<port>

node mempool
Prints out all current uncomfirmed unmined transactions currently in the mempool

Blockchain

node blockchain
Prints out the entire blockchain

node blockchain save
Saves the serialized version of the blockchain into the blockchain file

node blockchain load
Loads the blockchain from the serialized blockchain file

Peer management

node peers list
Lists out all the known peers

node peers add <host> <port>
Adds a peer with the given info into memory

node peers remove <host> <port>
Removes a peer with the given info from memory

node peers save
Saves peer info into the KNOWN_NODES file(autoloads on startup of a node)

Peer requests

node request mempool
Requests the mempool from all known peers to sync up with the rest of the chain

node request chain
Requests the entire blockchain past the last known block on your peer from all peers

node request peers
Requests all the peers known by your known peers and adds them if not already in your list

Block creation and management

node block create
Creates a new block using all the uncomfirmed transactions in the mempool

node block mine
Runs a sha256 based proof of work algorithm to get adequete work for the block

node block broadcast
Broadcasts the newly created block to all known peers

Wallets

node wallet list
Lists all wallets currently saved in the wallets directory with their name, public address, and balance

node wallet balance <wallet_address>
Prints out the balance of the given wallet

node wallet select <wallet_name>
Selects the given wallet into memory

node wallet send <wallet_address> <amount>
Sends the given amount to that address into the public mempool

About

Custom peer to peer blockchain network made from absolute scratch using raw tcp and a custom JSON RPC system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages