blockchain-poc/main.go
Brian Buller 7ffe75002c Step 1 Complete
Create blockchain
- Genesis Block
- Additional Blocks
2017-09-22 11:28:11 -05:00

17 lines
300 B
Go

package main
import "fmt"
func main() {
bc := NewBlockchain()
bc.AddBlock("Data 1")
bc.AddBlock("Data 2")
for _, block := range bc.blocks {
fmt.Printf("Prev. hash: %x\n", block.PrevBlockHash)
fmt.Printf("Data: %s\n", block.Data)
fmt.Printf("Hash: %x\n", block.Hash)
fmt.Println()
}
}