mirror of
https://github.com/arnaucube/slowlorisdb.git
synced 2026-02-28 05:46:48 +01:00
add main
This commit is contained in:
@@ -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 {
|
func cmdCreate(c *cli.Context) error {
|
||||||
log.Info("creating new keys of the node")
|
log.Info("creating new keys of the node")
|
||||||
privK, err := core.NewKey()
|
privK, err := core.NewKey()
|
||||||
|
|||||||
25
main.go
Normal file
25
main.go
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,6 +28,10 @@ func NewNode(privK *ecdsa.PrivateKey, bc *core.Blockchain, isMiner bool) (*Node,
|
|||||||
return node, nil
|
return node, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (node *Node) Start() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (node *Node) Sign(m []byte) (*core.Signature, error) {
|
func (node *Node) Sign(m []byte) (*core.Signature, error) {
|
||||||
return core.Sign(node.PrivK, m)
|
return core.Sign(node.PrivK, m)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user