Skip to content

jmockbee/CLEblockchain

Repository files navigation

CLEblockchain

image

5/3/2018

This is a basic block. You can see it has been tested in the terminal used "dev-test": "nodemon dev-test". In the package.json

genesis block created succesfully tested

image

first generation tested

image

5/10/18

algorithm SHA-256 secure S, hash H, algorithm A, 256 bits for the hash or 32 bytes or characters generated to represent the hash

makes a unique has value (32-byte for each block )
Its a one way hash from the direction of the data to the hash makes it easy to check blocks see if data has been tampered with 

installed dependencies interminal

     npm i crypto-js  --save

     check to make sure installed  cat package.json 

     const SHA256 = require ('crypto-js/sha256');     is a function that generates a unique hash based of data 

image

 note     const hash = 'todo-hash';
  changed to  const hash = Block.hash(timestamp, lastHash, data); ####

5/12/18

image This is installed to automate testing of the blocks

important change this to to test correctly in package.json

image

5/13/18

    Created block chain test file to make sure genesis block was reproducing next block correctly

Three things needed to do:

    1. validate a valid chain
    2. invalidate a chain with corrupt genesis block
    3. invalidate any corrupt block in the chain 

image

5/14/18

Added more to the blockchain.test.js

    1. Chain is replaced if a given chain is valid.
    2. Chain is not replaced if <= to the length of the current chain 
    3. Chain is replaced if passes validation test

Placed all blockchain files in blockchain folder.

I changed all blockchain file references to index so as not to get confused

I added app folder to get blocks

5/16/18 Creating API HTTP request to view blocks I already have

Added code to index.js/app changed package.json image

used postman for get request

image

Able to now mine blocks. Note the last hash matches genesis block and it now has own time stamp.

image'

created peer to peer server using Web Socket Server. Able to broadcast changes in the blockchain

image

5/21/18 gettting messages from peers continued updated p2p-server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published