diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 34937948f..bafc3d48c 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -86,6 +86,7 @@ var AppHelpFlagGroups = []flagGroup{ { Name: "SHARDING", Flags: []cli.Flag{ + utils.ActorFlag, utils.DepositFlag, }, }, diff --git a/sharding/node/node.go b/sharding/node/node.go index 4a370e955..73c818cce 100644 --- a/sharding/node/node.go +++ b/sharding/node/node.go @@ -162,7 +162,10 @@ func (n *shardingNode) Register(constructor sharding.ServiceConstructor) error { // Close the RPC client connection. func (n *shardingNode) Close() { - n.rpcClient.Close() + // rpcClient could be nil if the connection failed. + if n.rpcClient != nil { + n.rpcClient.Close() + } } // CreateTXOpts creates a *TransactOpts with a signer using the default account on the keystore. diff --git a/sharding/node/utils.go b/sharding/node/utils.go index 1838d9973..1a701f5b2 100644 --- a/sharding/node/utils.go +++ b/sharding/node/utils.go @@ -26,14 +26,14 @@ func dialRPC(endpoint string) (*rpc.Client, error) { func initSMC(n *shardingNode) (*contracts.SMC, error) { b, err := n.client.CodeAt(context.Background(), sharding.ShardingManagerAddress, nil) if err != nil { - return nil, fmt.Errorf("unable to get contract code at %s: %v", sharding.ShardingManagerAddress, err) + return nil, fmt.Errorf("unable to get contract code at %s: %v", sharding.ShardingManagerAddress.Str(), err) } // Deploy SMC for development only. // TODO: Separate contract deployment from the sharding node. It would only need to be deployed // once on the mainnet, so this code would not need to ship with the node. if len(b) == 0 { - log.Info(fmt.Sprintf("No sharding manager contract found at %s. Deploying new contract.", sharding.ShardingManagerAddress)) + log.Info(fmt.Sprintf("No sharding manager contract found at %s. Deploying new contract.", sharding.ShardingManagerAddress.Str())) txOps, err := n.CreateTXOpts(big.NewInt(0)) if err != nil { @@ -52,7 +52,7 @@ func initSMC(n *shardingNode) (*contracts.SMC, error) { time.Sleep(1 * time.Second) } - log.Info(fmt.Sprintf("New contract deployed at %s", addr)) + log.Info(fmt.Sprintf("New contract deployed at %s", addr.Str())) return contract, nil }