17 lines
300 B
Go
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()
|
|
}
|
|
}
|