blockchain_go/cli_createblockchain.go

22 lines
329 B
Go
Raw Normal View History

package main
2017-09-10 01:53:14 -05:00
import (
"fmt"
"log"
2024-06-20 12:26:54 -05:00
"os"
2017-09-10 01:53:14 -05:00
)
func (cli *CLI) createBlockchain(address, nodeID string) {
2017-09-10 01:53:14 -05:00
if !ValidateAddress(address) {
2024-06-20 12:26:54 -05:00
log.Println("ERROR: Address is not valid")
os.Exit(1)
2017-09-10 01:53:14 -05:00
}
bc := CreateBlockchain(address, nodeID)
defer bc.db.Close()
UTXOSet := UTXOSet{bc}
UTXOSet.Reindex()
fmt.Println("Done!")
}