Created
May 3, 2022 18:52
-
-
Save ITExpert0228/56c7495df6b38ae8a28f02bc9779e5e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main //Import the main package | |
// Create the Block data structure | |
// A block contains this info: | |
type Block struct { | |
Timestamp int64 // the time when the block was created | |
PreviousBlockHash []byte // the hash of the previous block | |
MyBlockHash []byte // the hash of the current block | |
AllData []byte // the data or transactions (body info) | |
} | |
// Prepare the Blockchain data structure : | |
type Blockchain struct { | |
Blocks []*Block // remember a blockchain is a series of blocks | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment