remove debug message

This commit is contained in:
amalraj.manigmail.com 2019-07-09 11:47:42 +08:00
parent d7cd5a37a7
commit d84c73e39d
6 changed files with 5 additions and 15 deletions

View File

@ -205,7 +205,7 @@ func RegisterPermissionService(ctx *cli.Context, stack *node.Node) {
if permissionConfig, err = permission.ParsePermissionConifg(dataDir); err != nil {
utils.Fatalf("loading of permission-config.json failed", "error", err)
}
log.Info("AJ-permission ctrl new")
// start the permissions management service
pc, err := permission.NewQuorumPermissionCtrl(stack, ctx.GlobalBool(utils.RaftModeFlag.Name), &permissionConfig)
if err != nil {

View File

@ -285,7 +285,6 @@ func geth(ctx *cli.Context) error {
// it unlocks any requested accounts, and starts the RPC/IPC interfaces and the
// miner.
func startNode(ctx *cli.Context, stack *node.Node) {
log.Info("AJ-start node1")
log.DoEmitCheckpoints = ctx.GlobalBool(utils.EmitCheckpointsFlag.Name)
debug.Memsize.Add("node", stack)

View File

@ -79,7 +79,6 @@ func IsPermissionEnabled(ctx *cli.Context) bool {
}
func StartNode(stack *node.Node) {
log.Info("AJ-start node2")
if err := stack.Start(); err != nil {
Fatalf("Error starting protocol stack: %v", err)

View File

@ -150,7 +150,6 @@ func (n *Node) Register(constructor ServiceConstructor) error {
// Start create a live P2P node and starts running it.
func (n *Node) Start() error {
log.Info("AJ-start node3")
n.lock.Lock()
defer n.lock.Unlock()
@ -197,16 +196,14 @@ func (n *Node) Start() error {
for kind, s := range services { // copy needed for threaded access
ctx.services[kind] = s
}
log.Info("AJ-construct service1", "ct", ct, "Cons", constructor)
// Construct and save the service
service, err := constructor(ctx)
log.Info("AJ-construct service2", "service", service)
if err != nil {
return err
}
kind := reflect.TypeOf(service)
log.Info("AJ-construct service3", "ct", ct, "kind", kind)
if _, exists := services[kind]; exists {
return &DuplicateServiceError{Kind: kind}
}
@ -222,7 +219,6 @@ func (n *Node) Start() error {
// Start each of the services
started := []reflect.Type{}
for kind, service := range services {
log.Info("AJ-start service ", "kind", kind, "srv", service)
// Start the next service, stopping all previous upon failure
if err := service.Start(running); err != nil {
for _, kind := range started {

View File

@ -3,22 +3,21 @@ package permission
import (
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
)
// Create an RPC client for the contract interface
func CreateEthClient(stack *node.Node) (*ethclient.Client, *eth.Ethereum, error) {
var e *eth.Ethereum
log.Info("AJ-CreateEthClient permission ethereum service..")
if err := stack.Service(&e); err != nil {
return nil, nil, err
}
log.Info("AJ-CreateEthClient permission stack attach..")
rpcClient, err := stack.Attach()
if err != nil {
return nil, nil, err
}
log.Info("AJ-permission CreateEthClient done")
return ethclient.NewClient(rpcClient), e, nil
}

View File

@ -139,20 +139,17 @@ func ParsePermissionConifg(dir string) (types.PermissionConfig, error) {
// can be brought up only after block syncing is complete. This function
// waits for block syncing before the starting permissions
func waitForSync(e *eth.Ethereum) {
log.Info("AJ-wait for sync")
for !types.GetSyncStatus() {
time.Sleep(10 * time.Millisecond)
}
for e.Downloader().Synchronising() {
time.Sleep(10 * time.Millisecond)
}
log.Info("AJ-wait for sync over")
}
// Creates the controls structure for permissions
func NewQuorumPermissionCtrl(stack *node.Node, isRaft bool, pconfig *types.PermissionConfig) (*PermissionCtrl, error) {
// Create a new ethclient to for interfacing with the contract
log.Info("AJ-permission eth client create")
return &PermissionCtrl{stack, nil, nil, isRaft, stack.GetNodeKey(), stack.DataDir(), nil, nil, nil, nil, nil, nil, pconfig, make(chan struct{}), make(chan struct{}), make(chan struct{}), make(chan struct{}), sync.Mutex{}}, nil
}