package main

import (
	"bufio"
	"fmt"
	"monoblock/chain"
	"monoblock/keymgmt"
	"os"
)

const AMOUNT int = 100

func main() {
	addr1 := keymgmt.GenerateAddress()
	addr2 := keymgmt.GenerateAddress()
	addr3 := keymgmt.GenerateAddress()
	addr4 := keymgmt.GenerateAddress()
	ta1 := chain.NewTransaction(addr3.GetAddress(), addr1.GetAddress(), 100)
	ta2 := chain.NewTransaction(addr2.GetAddress(), addr4.GetAddress(), 100)
	b1 := chain.NewBlock(nil)
	b1.AddTransaction(ta1)
	b1.AddTransaction(ta2)
	hash := b1.GenerateHash(4)
	fmt.Printf("Hash found:\n\n%x\n\n", hash)
	bufio.NewReader(os.Stdin).ReadBytes('\n')
}

func generateKey(ch chan *keymgmt.Address, amount int) {
	for i := 0; i < amount; i++ {
		addr := keymgmt.GenerateAddress()
		ch <- addr
	}

}
