Skip to content

Latest commit

 

History

History
270 lines (238 loc) · 7.81 KB

temp.md

File metadata and controls

270 lines (238 loc) · 7.81 KB

FUNCTION LIST

1. BLOCKCHAIN

1.1 BLOCKCHAIN

BLOCKCHAIN-INTERFACE FUNCTIONS

  • BLOCKCHAIN
    • GetBlockchain() Gets the blockchain
    • GenesisBlockchain() Creates the blockchain
    • RequestBlockchain() Requests the blockchain and the pendingBlock from a Network Node
      • SEND-BLOCKCHAIN Request
  • BLOCK
    • GetBlock() Gets a block (via Index number) from the blockchain
  • LOCKED BLOCK
    • GetLockedBlock() Gets the lockedBlock
    • AppendLockedBlock() Appends the lockedBlock to the blockchain
  • PENDING BLOCK
    • GetPendingBlock() Gets the pendingBlock
    • ResetPendingBlock() Resets the pendingBlock
    • AddTransactionToPendingBlock() Adds a transaction to the pendingBlock and makes change
    • LockPendingBlock() Moves the pendingBlock to the lockedBlock
  • JEFFCOINS
    • GetAddressBalance() Gets the jeffCoin Address balance
  • TRANSACTIONS
    • ProcessTxRequestMessage() Request to transfer jeffCoins to a jeffCoin Address

GUTS FUNCTIONS

  • BLOCKCHAIN
    • getBlockchain() Gets the blockchain
    • loadBlockchain() Loads the entire blockchain
    • replaceBlockchain() Replaces blockchain with the longer one
  • BLOCK
    • getBlock() Gets a block in the blockchain
    • calculateBlockHash() Calculates SHA256 hash on a block
    • isBlockValid() Checks if block is valid
  • LOCKED BLOCK
    • getLockedBlock() Gets the lockedBlock
    • appendLockedBlock() Appends the lockedBlock to the blockchain
  • PENDING BLOCK
    • getPendingBlock() Gets the pendingBlock
    • loadPendingBlock() Loads the pendingBlock
    • resetPendingBlock() Resets the pendingBlock
    • addTransactionToPendingBlock() Adds a transaction to the pendingBlock and makes change
    • lockPendingBlock() Moves the pendingBlock to the lockedBlock
  • JEFFCOINS
    • getAddressBalance() Gets the jeffCoin Address balance

1.2 TRANSACTIONS

TRANSACTION FUNCTIONS

  • TRANSACTIONS
    • processTxRequestMessage() Request to transfer jeffCoins to a jeffCoin Address
  • SIGNATURE
    • verifySignature() Verifies a ECDSA Digital Signature
  • UNSPENT OUTPUTS
    • pickUnspentOutputs() Pick the Unspent Outputs to use and provide change

2. MINER

MINER-INTERFACE FUNCTIONS

  • MINING
    • tbd() tbd

GUTS FUNCTIONS

  • MINING
    • tbd() tbd

3. ROUTINGNODE

3.1 NODELIST

ROUTINGNODE-INTERFACE FUNCTIONS

  • NODELIST
    • GetNodeList() Gets the nodeList
    • GenesisNodeList() Creates the nodeList
    • RequestsNodeList() Requests the nodeList from a Network Node
      • SEND-NODELIST Request
  • NODE
    • GetNode() Gets a Node (via Index number) from the nodeList
    • AppendNewNode() Appends a new Node to the nodeList
  • THIS NODE
    • GetThisNode() Gets thisNode
    • LoadThisNode() Loads thisNode
    • AppendThisNode() Appends thisNode to the nodeList
    • BroadcastThisNode() Broadcasts thisNode to the Network
      • BROADCAST-ADD-NEW-NODE Request

GUTS FUNCTIONS

  • NODELIST
    • getNodeList() Gets the nodeList
    • loadNodeList() Loads the entire nodeList
  • NODE
    • getNode() Gets a Node in the nodeList
    • appendNewNode() Appends a new Node to the nodeList
  • THIS NODE
    • getThisNode() Gets thisNode
    • loadThisNode() Loads thisNode
    • appendThisNode() Appends thisNode to the nodeList
    • checkIfThisNodeinNodeList() Check if thisNode is already in the nodeList

3.2 TCP REQUESTS & HANDLERS

HANDLERS

  • FROM BLOCKCHAIN I/F
    • handleSendBlockchain() SEND-BLOCKCHAIN (SBC)- Sends the blockchain and pendingBlock to another Node
  • FROM ROUTINGNODE I/F
    • handleBroadcastAddNewNode() BROADCAST-ADD-NEW-NODE (BANN) - Adds a Node to the nodeList
    • handleSendNodeList() SEND-NODELIST (SNL) - Sends the nodeList to another Node
    • handleBroadcastVerifiedBlock() BROADCAST-VERIFIED-BLOCK (BVB) - A Node verified the next block, get block and verify
    • handleBroadcastConsensus() BROADCAST-CONSENSUS (BC) - 51% Consensus reached, get block to add to blockchain
    • handleBroadcastTransactionRequest() BROADCAST-TRANSACTION-REQUEST (BTR) - Request from a Node to transfer jeffCoins to a jeffCoin Address
  • FROM WALLET I/F
    • handleSendAddressBalance() SEND-ADDRESS-BALANCE (SAB) - Sends the jeffCoin balance for a jeffCoin Address
    • handleTransactionRequest() TRANSACTION-REQUEST (TR) - Request from Wallet to transfer jeffCoins to a jeffCoin Address
  • EOF
    • EOF Close Connection

4. WALLET

WALLET-INTERFACE FUNCTIONS

  • WALLET
    • GetWallet() Gets the wallet
    • GenesisWallet() Creates the wallet and writes to file (Keys and jeffCoin Address)
    • ReadWalletFile() Reads the wallet from a file
  • KEYS
    • EncodeKeys() Encodes privateKeyRaw & publicKeyRaw to privateKeyHex & publicKeyHex
    • DecodeKeys() Decodes privateKeyHex & publicKeyHex to privateKeyRaw & publicKeyRaw
  • JEFFCOINS
    • RequestAddressBalance() Requests the jeffCoin balance for a jeffCoin Address
      • SEND-ADDRESS-BALANCE Request
    • TransactionRequest() Request to transfer jeffCoins to a jeffCoin Address
      • TRANSACTION-REQUEST Request
  • SIGNATURE
    • CreateSignature() Creates a ECDSA Digital Signature

GUTS FUNCTIONS

  • WALLET
    • getWallet() Gets the wallet
    • makeWallet() Creates the wallet and writes to file (Keys and jeffCoin Address)
    • readWalletFile() Reads the wallet from a file
  • KEYS
    • generateECDSASKeys() Generate privateKeyHex and publicKeyHex
    • encodeKeys() Encodes privateKeyRaw & publicKeyRaw to privateKeyHex & publicKeyHex
    • decodeKeys() Decodes privateKeyHex & publicKeyHex to privateKeyRaw & publicKeyRaw
  • JEFFCOIN ADDRESS
    • generateJeffCoinAddress() Creates a jeffCoin Address
    • hashPublicKey() Hashes publicKeyHex
    • checksumKeyHash() Checksums verPublicKeyHash
    • encodeKeyHash() Encodes verPublicKeyHash & checkSum
  • SIGNATURE
    • createSignature() Creates a ECDSA Digital Signature

5. WEBSERVER

5.2 REST API

API COMMANDS

  • BLOCKCHAIN
    • /showBlockchain
    • /showBlock/{blockID}
  • LOCKED BLOCK
    • /showlockedblock
    • /appendlockedblock
  • PENDING BLOCK
    • /showpendingblock
    • /resetpendingblock
    • /lockpendingblock
  • NODELIST
    • /shownodelist
    • /shownode/{nodeID}
    • /showthisnode
  • WALLET (THIS NODE)
    • /showwallet
    • /showjeffcoinaddress
    • /showbalance
    • /transactionrequest/{destinationaddress1,destinationaddress2,...}/{value1,value2,...}
  • WALLET (OTHER)
    • /showaddressbalance/{jeffcoinaddress}