blockchain_go/cli_startnode.go

19 lines
371 B
Go

package main
import (
"fmt"
"log"
)
func (cli *CLI) startNode(nodeID, minerAddress string) {
fmt.Printf("Starting node %s\n", nodeID)
if len(minerAddress) > 0 {
if ValidateAddress(minerAddress) {
fmt.Println("Mining is on. Address to receive rewards: ", minerAddress)
} else {
log.Panic("Wrong miner address!")
}
}
StartServer(nodeID, minerAddress)
}