diff --git a/cmd/cmd.go b/cmd/cmd.go index 5e730db..b46f201 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -29,6 +29,7 @@ var Commands = []cli.Command{ }, } +// 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() diff --git a/main.go b/main.go new file mode 100644 index 0000000..2da3869 --- /dev/null +++ b/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) + } +} diff --git a/node/node.go b/node/node.go index 0c70e11..f665dbd 100644 --- a/node/node.go +++ b/node/node.go @@ -28,6 +28,10 @@ func NewNode(privK *ecdsa.PrivateKey, bc *core.Blockchain, isMiner bool) (*Node, 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) }