blockchain_go/cli_createblockchain.go

20 lines
306 B
Go
Raw Normal View History

2017-10-21 21:13:25 -05:00
package bc
2017-09-10 01:53:14 -05:00
import (
"fmt"
"log"
)
func (cli *CLI) createBlockchain(address, nodeID string) {
2017-09-10 01:53:14 -05:00
if !ValidateAddress(address) {
log.Panic("ERROR: Address is not valid")
}
bc := CreateBlockchain(address, nodeID)
defer bc.db.Close()
UTXOSet := UTXOSet{bc}
UTXOSet.Reindex()
fmt.Println("Done!")
}