-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
32 lines (27 loc) · 993 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"github.com/maickmachado/blockchain-go/database"
"github.com/maickmachado/blockchain-go/routes"
)
func main() {
database.Connect("root:abc@tcp(127.0.0.1:3306)/bitcoin")
database.Migrate()
routes.HandleRequest()
//criação do primeiro block
//firstBlock := blockchain.CreateBlock("Genesis", []byte{})
//colocando o primeiro block no BlockChain
//chain := &blockchain.BlockChain{Blocks: []*blockchain.Block{firstBlock}}
// chain := InitBlockChain()
// chain.AddBlock("First block after Genesis")
// chain.AddBlock("Second block after Genesis")
// chain.AddBlock("Third block after Genesis")
// for _, value := range chain.Blocks {
// //fmt.Printf("Previous Hash: %x\n", value.PrevHash)
// fmt.Printf("Data in block: %s\n", value.Data)
// fmt.Printf("Hash: %x\n", value.Hash)
// pow := blockchain.NewProof(value)
// //converte o bool em um tipo string
// fmt.Printf("POW: %s\n", strconv.FormatBool(pow.Validate()))
// fmt.Println()
// }
}