add main
arnaucube arnaucube@gmail.com
Sun, 14 Apr 2019 21:16:51 +0200
3 files changed,
30 insertions(+),
0 deletions(-)
M
cmd/cmd.go
→
cmd/cmd.go
@@ -29,6 +29,7 @@ Action: cmdStart,
}, } +// creates the node, this needs to be executed for first time func cmdCreate(c *cli.Context) error { log.Info("creating new keys of the node") privK, err := core.NewKey()
A
main.go
@@ -0,0 +1,25 @@
+package main + +import ( + "os" + + "github.com/arnaucube/slowlorisdb/cmd" + log "github.com/sirupsen/logrus" + "github.com/urfave/cli" +) + +func main() { + app := cli.NewApp() + app.Name = "slowlorisdb" + app.Version = "0.0.1-alpha" + app.Flags = []cli.Flag{ + cli.StringFlag{Name: "config"}, + } + + app.Commands = []cli.Command{} + app.Commands = append(app.Commands, cmd.Commands...) + err := app.Run(os.Args) + if err != nil { + log.Error(err) + } +}
M
node/node.go
→
node/node.go
@@ -28,6 +28,10 @@ }
return node, nil } +func (node *Node) Start() error { + return nil +} + func (node *Node) Sign(m []byte) (*core.Signature, error) { return core.Sign(node.PrivK, m) }