2017-09-30 20:44:41 -05:00
|
|
|
package main
|
|
|
|
|
2017-10-03 04:21:15 -05:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
)
|
2017-09-30 20:44:41 -05:00
|
|
|
|
2017-10-03 04:21:15 -05:00
|
|
|
func (cli *CLI) startNode(nodeID, minerAddress string) {
|
2017-09-30 22:29:04 -05:00
|
|
|
fmt.Printf("Starting node %s\n", nodeID)
|
2017-10-03 04:21:15 -05:00
|
|
|
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)
|
2017-09-30 20:44:41 -05:00
|
|
|
}
|