type Block struct {
Height int64
PreBlockHash []byte
Transactions []byte
Timestamp int64
Hash []byte
Nonce int64
}
func GenesisBlock(data string) *Block {
return NewBlock(
data,
1,
[]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
)
}
type Blockchain struct {
Blocks []*Block
}
func GenesisBlockChain() *Blockchain {
gensisBlock := GenesisBlock("Geneis Block")
return &Blockchain{[]*Block{gensisBlock}}
}