This commit is contained in:
arnaucube
2019-04-14 21:16:51 +02:00
parent fd30384b23
commit 583980f546
3 changed files with 30 additions and 0 deletions

View File

@@ -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()

25
main.go Normal file
View File

@@ -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)
}
}

View File

@@ -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)
}