_testmain.go
cmd/fedd/fedd
-cmd/precog/precog
+cmd/precognitive/precognitive
cmd/vapord/vapord
cmd/vapord/.vapord
cmd/vaporcli/vaporcli
@echo "Building fedd to cmd/fedd/fedd"
@go build $(BUILD_FLAGS) -o cmd/fedd/fedd cmd/fedd/main.go
-precog:
- @echo "Building precog to cmd/precog/precog"
- @go build $(BUILD_FLAGS) -o cmd/precog/precog cmd/precog/main.go
+precognitive:
+ @echo "Building precognitive to cmd/precognitive/precognitive"
+ @go build $(BUILD_FLAGS) -o cmd/precognitive/precognitive cmd/precognitive/main.go
vapord:
@echo "Building vapord to cmd/vapord/vapord"
log "github.com/sirupsen/logrus"
"github.com/vapor/toolbar/common"
- "github.com/vapor/toolbar/precog/api"
- "github.com/vapor/toolbar/precog/config"
- "github.com/vapor/toolbar/precog/monitor"
+ "github.com/vapor/toolbar/precognitive/api"
+ "github.com/vapor/toolbar/precognitive/config"
+ "github.com/vapor/toolbar/precognitive/monitor"
)
func main() {
-# Precog
+# Precognitive
Keep monitoring (leader & candidate) consensus nodes status in vapor network.
## Init
### Database Schema
-[precog_schema.sql](./sql_dump/precog_schema.sql)
+[precognitive_schema.sql](./sql_dump/precognitive_schema.sql)
### Config
-run with [config_example.json](docs/precog/config_example.json)
+run with [config_example.json](docs/precognitive/config_example.json)
```
-go run cmd/precog/main.go docs/precog/config_example.json
+go run cmd/precognitive/main.go docs/precognitive/config_example.json
```
## API
"port": 3306,
"username": "root",
"password": "toor",
- "database": "precog"
+ "database": "precognitive"
},
"log_mode" : true
},
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-CREATE SCHEMA IF NOT EXISTS `precog`;
-DROP DATABASE `precog`;
-CREATE SCHEMA `precog`;
+CREATE SCHEMA IF NOT EXISTS `precognitive`;
+DROP DATABASE `precognitive`;
+CREATE SCHEMA `precognitive`;
-USE `precog`;
+USE `precognitive`;
# Dump of table nodes
# ------------------------------------------------------------
import (
"github.com/gin-gonic/gin"
- "github.com/vapor/toolbar/precog/database/orm"
+ "github.com/vapor/toolbar/precognitive/database/orm"
serverCommon "github.com/vapor/toolbar/server"
)
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
- "github.com/vapor/toolbar/precog/config"
+ "github.com/vapor/toolbar/precognitive/config"
serverCommon "github.com/vapor/toolbar/server"
)
"fmt"
"time"
- "github.com/vapor/toolbar/precog/common"
+ "github.com/vapor/toolbar/precognitive/common"
)
type Node struct {
log "github.com/sirupsen/logrus"
"github.com/vapor/p2p"
- "github.com/vapor/toolbar/precog/database/orm"
+ "github.com/vapor/toolbar/precognitive/database/orm"
)
func (m *monitor) connectionRoutine() {
log "github.com/sirupsen/logrus"
"github.com/vapor/p2p/discover/dht"
- "github.com/vapor/toolbar/precog/config"
+ "github.com/vapor/toolbar/precognitive/config"
)
var (
"github.com/vapor/p2p/discover/mdns"
"github.com/vapor/p2p/signlib"
"github.com/vapor/test/mock"
- "github.com/vapor/toolbar/precog/config"
+ "github.com/vapor/toolbar/precognitive/config"
)
type monitor struct {
"github.com/vapor/netsync/peers"
"github.com/vapor/p2p"
- "github.com/vapor/toolbar/precog/common"
- "github.com/vapor/toolbar/precog/config"
- "github.com/vapor/toolbar/precog/database/orm"
+ "github.com/vapor/toolbar/precognitive/common"
+ "github.com/vapor/toolbar/precognitive/config"
+ "github.com/vapor/toolbar/precognitive/database/orm"
)
func (m *monitor) upsertNode(node *config.Node) error {