forked from hyperledger-archives/burrow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.go
37 lines (29 loc) · 854 Bytes
/
start.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package commands
import (
"github.com/hyperledger/burrow/core"
cli "github.com/jawher/mow.cli"
)
// Start launches the burrow daemon
func Start(output Output) func(cmd *cli.Cmd) {
return func(cmd *cli.Cmd) {
configOpts := addConfigOptions(cmd)
cmd.Action = func() {
conf, err := configOpts.obtainBurrowConfig()
if err != nil {
output.Fatalf("could not set up config: %v", err)
}
if err := conf.Verify(); err != nil {
output.Fatalf("cannot continue with config: %v", err)
}
output.Logf("Using validator address: %s", *conf.ValidatorAddress)
kern, err := core.LoadKernelFromConfig(conf)
if err != nil {
output.Fatalf("could not configure Burrow kernel: %v", err)
}
if err = kern.Boot(); err != nil {
output.Fatalf("could not boot Burrow kernel: %v", err)
}
kern.WaitForShutdown()
}
}
}