diff --git a/cmd/console/run.go b/cmd/console/run.go index 7f09446..4ee67b7 100644 --- a/cmd/console/run.go +++ b/cmd/console/run.go @@ -67,7 +67,7 @@ func runCmd(cmd *cobra.Command, args []string) { os.Exit(1) } } - fmt.Println("config: ", cfg.ReadUseCpu()) + runtime.SetCpuCores(configs.SysInit(cfg.ReadUseCpu())) // new chain client @@ -982,7 +982,7 @@ func checkRegistrationInfo(cli *chain.ChainClient, signatureAcc, stakingAcc stri if err.Error() != chain.ERR_Empty { return configs.Unregistered, decTib, &minerInfo, fmt.Errorf("failed to query signature account information: %v", err) } - return configs.Unregistered, decTib, &minerInfo, errors.New("signature account does not exist, possible: 1.balance is empty 2.rpc address error") + return configs.Unregistered, decTib, &minerInfo, errors.New("signature account does not exist, possible cause: 1.balance is empty 2.wrong rpc address") } token_cess, _ := new(big.Int).SetString(fmt.Sprintf("%d%s", token, chain.TokenPrecision_CESS), 10) if stakingAcc == "" || stakingAcc == signatureAcc { @@ -995,7 +995,7 @@ func checkRegistrationInfo(cli *chain.ChainClient, signatureAcc, stakingAcc stri if err.Error() != chain.ERR_Empty { return configs.Unregistered, decTib, &minerInfo, fmt.Errorf("failed to query staking account information: %v", err) } - return configs.Unregistered, decTib, &minerInfo, fmt.Errorf("staking account does not exist, possible: 1.balance is empty 2.rpc address error") + return configs.Unregistered, decTib, &minerInfo, fmt.Errorf("staking account does not exist, possible: 1.balance is empty 2.wrong rpc address") } if stakingAccInfo.Data.Free.CmpAbs(token_cess) < 0 { return configs.Unregistered, decTib, &minerInfo, fmt.Errorf("staking account balance less than %d %s", token, cli.GetTokenSymbol()) diff --git a/cmd/console/stat.go b/cmd/console/stat.go index 9c5cde2..a7f8f3e 100644 --- a/cmd/console/stat.go +++ b/cmd/console/stat.go @@ -12,7 +12,6 @@ import ( "fmt" "math/big" "os" - "strings" cess "github.com/CESSProject/cess-go-sdk" "github.com/CESSProject/cess-go-sdk/chain" @@ -53,7 +52,7 @@ func Command_State_Runfunc(cmd *cobra.Command, args []string) { if err.Error() != chain.ERR_Empty { out.Err(chain.ERR_RPC_CONNECTION.Error()) } else { - out.Err("signature account does not exist, possible: 1.balance is empty 2.rpc address error") + out.Err("you are not registered as a storage miner, possible cause: 1.insufficient balance in signature account 2.wrong rpc address") } os.Exit(1) } @@ -62,11 +61,6 @@ func Command_State_Runfunc(cmd *cobra.Command, args []string) { beneficiaryAcc, _ := sutils.EncodePublicKeyAsCessAccount(minerInfo.BeneficiaryAccount[:]) - name := cli.GetSDKName() - if strings.Contains(name, "bucket") { - name = "storage miner" - } - startBlock, err := cli.QueryStakingStartBlock(cli.GetSignatureAccPulickey(), -1) if err != nil { if err.Error() != chain.ERR_Empty { @@ -83,7 +77,7 @@ func Command_State_Runfunc(cmd *cobra.Command, args []string) { } var tableRows = []table.Row{ - {"name", name}, + {"name", "storage miner"}, {"peer id", base58.Encode([]byte(string(minerInfo.PeerId[:])))}, {"state", string(minerInfo.State)}, {"staking amount", fmt.Sprintf("%v %s", minerInfo.Collaterals, cli.GetTokenSymbol())}, diff --git a/configs/system.go b/configs/system.go index 9fb39f0..a4ffdd9 100644 --- a/configs/system.go +++ b/configs/system.go @@ -24,7 +24,7 @@ const ( // version Version = "v0.7.11 devnet" // Description is the description of the program - Description = "Storage node implementation in CESS networks" + Description = "Storage miner implementation in CESS networks" // NameSpace is the cached namespace NameSpaces = Name // Chain version diff --git a/node/discover.go b/node/discover.go index e8309d3..ea89e4c 100644 --- a/node/discover.go +++ b/node/discover.go @@ -11,7 +11,6 @@ import ( "context" "encoding/json" "fmt" - "log" "strings" "github.com/CESSProject/p2p-go/core" @@ -84,7 +83,7 @@ func Subscribe(ctx context.Context, h host.Host, minerRecord MinerRecord, bootno if err != nil { continue } - log.Println("got a peer: ", findpeer.ID.String()) + //log.Println("got a peer: ", findpeer.ID.String()) minerRecord.SavePeer(findpeer) } }