Browse Source

add main

master
arnaucube 5 years ago
parent
commit
583980f546
3 changed files with 30 additions and 0 deletions
  1. +1
    -0
      cmd/cmd.go
  2. +25
    -0
      main.go
  3. +4
    -0
      node/node.go

+ 1
- 0
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()

+ 25
- 0
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)
}
}

+ 4
- 0
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)
}

Loading…
Cancel
Save