DFSonBlockchain implements a peer-to-peer miner network and a distributed file storage service that runs on top of it. Each miner is capable of serving mutiple clients concurrently and mines the coins needed for file operations requested by its clients; it then floods these operations to the miner network.
go run miner.go </path/to/config.json>go run miner.go settings.jsonfunc (capi *ClientAPI) ReadRecord(recordInfo *rfslib.OperationRecord, minerRes *rfslib.MinerRes) errorThe ReadRecord RPC reads a confirmed record with recordInfo.FileName at position recordInfo.RecordNum into memory pointed to by minerRes
func (capi *ClientAPI) ConfirmOperation(operationRecord *rfslib.OperationRecord, minerRes *rfslib.MinerRes) errorThe ConfirmOperation RPC confirms the operation by checking the OPBlock containing the operation is followed by some fixed number of other blocks in the longest blockchain
func (capi *ClientAPI) GetBalance(caller string, currentBalance *uint32) errorThe GetBalance RPC returns the current balance of the longest local block chain
func (mapi *MinerAPI) GetChainTips(caller string, reply *map[string]int) errorThe GetChainTips RPC returns information about the highest-height block (tip) of each local block chain
func (mapi *MinerAPI) GetBlock(headerHash string, packet *BlockPacket) errorThe GetBlock RPC gets a block with a particular header hash from the local block hash map as a BlockPacket
func (mapi *MinerAPI) AddNode(minerInfo PeerMinerInfo, hasInternalError *bool) errorThe AddNode RPC attempts to try a connection to a Miner node once
func (mapi *MinerAPI) GetPeerInfo(caller string, minerID *string) errorThe GetPeerInfo RPC returns the MinerID of the connected Miner node
func (mapi *MinerAPI) SubmitRecord(newOpRecord *rfslib.OperationRecord, hasInternalError *bool) errorThe SubmitRecord RPC accepts an OperationRecord, verifies it is a valid addition to the block chain, and broadcasts it to the network
func (mapi *MinerAPI) SubmitBlock(packet BlockPacket, hasInternalError *bool) errorThe SubmitBlock RPC accepts a BlockPacket, verifies it is a valid addition to the block chain, and broadcasts it to the network.