OSDN Git Service

rename vapord (#277)
authorChengcheng Zhang <943420582@qq.com>
Sat, 13 Jul 2019 06:43:57 +0000 (14:43 +0800)
committerPaladz <yzhu101@uottawa.ca>
Sat, 13 Jul 2019 06:43:57 +0000 (14:43 +0800)
13 files changed:
cmd/vaporcli/commands/transaction.go
cmd/vaporcli/commands/vaporcli.go [moved from cmd/vaporcli/commands/bytomcli.go with 56% similarity]
cmd/vaporcli/commands/version.go
cmd/vapord/commands/root.go
cmd/vapord/commands/run_node.go
docs/Running-in-Docker.md
netsync/sync_manager.go
node/node.go
p2p/discover/mdns/mdns.go
p2p/listener.go
p2p/node_info_test.go
util/util.go
version/version.go

index 2b570d4..308ab94 100644 (file)
@@ -153,7 +153,7 @@ var buildTransactionCmd = &cobra.Command{
                        buildReqStr = fmt.Sprintf(buildControlAddressReqFmt, btmGas, accountInfo, assetInfo, amount, accountInfo, assetInfo, amount, address)
                case "unlock":
                        var err error
-                       usage := "Usage:\n  bytomcli build-transaction <accountID|alias> <assetID|alias> <amount> <outputID> -c <contractName>"
+                       usage := "Usage:\n  vaporcli build-transaction <accountID|alias> <assetID|alias> <amount> <outputID> -c <contractName>"
                        baseCount := 4
                        if len(args) < baseCount {
                                jww.ERROR.Printf("%s <contract_argument> ... [flags]\n\n", usage)
similarity index 56%
rename from cmd/vaporcli/commands/bytomcli.go
rename to cmd/vaporcli/commands/vaporcli.go
index 7beffd1..d90427a 100644 (file)
@@ -10,7 +10,7 @@ import (
        "github.com/vapor/util"
 )
 
-// bytomcli usage template
+// vaporcli usage template
 var usageTemplate = `Usage:{{if .Runnable}}
   {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
   {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
@@ -80,11 +80,11 @@ func isUserError(err error) bool {
        return userErrorRegexp.MatchString(err.Error())
 }
 
-// BytomcliCmd is Bytomcli's root command.
-// Every other command attached to BytomcliCmd is a child command to it.
-var BytomcliCmd = &cobra.Command{
-       Use:   "bytomcli",
-       Short: "Bytomcli is a commond line client for bytom core (a.k.a. bytomd)",
+// VaporCmd is Vaporcli's root command.
+// Every other command attached to VaporcliCmd is a child command to it.
+var VaporcliCmd = &cobra.Command{
+       Use:   "vaporcli",
+       Short: "Vaporcli is a commond line client for vapor (a.k.a. vapord)",
        Run: func(cmd *cobra.Command, args []string) {
                if len(args) < 1 {
                        cmd.SetUsageTemplate(usageTemplate)
@@ -93,90 +93,90 @@ var BytomcliCmd = &cobra.Command{
        },
 }
 
-// Execute adds all child commands to the root command BytomcliCmd and sets flags appropriately.
+// Execute adds all child commands to the root command VaporcliCmd and sets flags appropriately.
 func Execute() {
 
        AddCommands()
        AddTemplateFunc()
 
-       if _, err := BytomcliCmd.ExecuteC(); err != nil {
+       if _, err := VaporcliCmd.ExecuteC(); err != nil {
                os.Exit(util.ErrLocalExe)
        }
 }
 
-// AddCommands adds child commands to the root command BytomcliCmd.
+// AddCommands adds child commands to the root command VaporcliCmd.
 func AddCommands() {
-       BytomcliCmd.AddCommand(createAccessTokenCmd)
-       BytomcliCmd.AddCommand(listAccessTokenCmd)
-       BytomcliCmd.AddCommand(deleteAccessTokenCmd)
-       BytomcliCmd.AddCommand(checkAccessTokenCmd)
-
-       BytomcliCmd.AddCommand(createAccountCmd)
-       BytomcliCmd.AddCommand(deleteAccountCmd)
-       BytomcliCmd.AddCommand(listAccountsCmd)
-       BytomcliCmd.AddCommand(updateAccountAliasCmd)
-       BytomcliCmd.AddCommand(createAccountReceiverCmd)
-       BytomcliCmd.AddCommand(listAddressesCmd)
-       BytomcliCmd.AddCommand(validateAddressCmd)
-       BytomcliCmd.AddCommand(listPubKeysCmd)
-
-       BytomcliCmd.AddCommand(createAssetCmd)
-       BytomcliCmd.AddCommand(getAssetCmd)
-       BytomcliCmd.AddCommand(listAssetsCmd)
-       BytomcliCmd.AddCommand(updateAssetAliasCmd)
-
-       BytomcliCmd.AddCommand(getTransactionCmd)
-       BytomcliCmd.AddCommand(listTransactionsCmd)
-
-       BytomcliCmd.AddCommand(getUnconfirmedTransactionCmd)
-       BytomcliCmd.AddCommand(listUnconfirmedTransactionsCmd)
-       BytomcliCmd.AddCommand(decodeRawTransactionCmd)
-
-       BytomcliCmd.AddCommand(listUnspentOutputsCmd)
-       BytomcliCmd.AddCommand(listBalancesCmd)
-
-       BytomcliCmd.AddCommand(rescanWalletCmd)
-       BytomcliCmd.AddCommand(walletInfoCmd)
-
-       BytomcliCmd.AddCommand(buildTransactionCmd)
-       BytomcliCmd.AddCommand(signTransactionCmd)
-       BytomcliCmd.AddCommand(submitTransactionCmd)
-       BytomcliCmd.AddCommand(estimateTransactionGasCmd)
-
-       BytomcliCmd.AddCommand(getBlockCountCmd)
-       BytomcliCmd.AddCommand(getBlockHashCmd)
-       BytomcliCmd.AddCommand(getBlockCmd)
-       BytomcliCmd.AddCommand(getBlockHeaderCmd)
-       BytomcliCmd.AddCommand(getDifficultyCmd)
-       BytomcliCmd.AddCommand(getHashRateCmd)
-
-       BytomcliCmd.AddCommand(createKeyCmd)
-       BytomcliCmd.AddCommand(deleteKeyCmd)
-       BytomcliCmd.AddCommand(listKeysCmd)
-       BytomcliCmd.AddCommand(updateKeyAliasCmd)
-       BytomcliCmd.AddCommand(resetKeyPwdCmd)
-       BytomcliCmd.AddCommand(checkKeyPwdCmd)
-
-       BytomcliCmd.AddCommand(signMsgCmd)
-       BytomcliCmd.AddCommand(verifyMsgCmd)
-       BytomcliCmd.AddCommand(decodeProgCmd)
-
-       BytomcliCmd.AddCommand(createTransactionFeedCmd)
-       BytomcliCmd.AddCommand(listTransactionFeedsCmd)
-       BytomcliCmd.AddCommand(deleteTransactionFeedCmd)
-       BytomcliCmd.AddCommand(getTransactionFeedCmd)
-       BytomcliCmd.AddCommand(updateTransactionFeedCmd)
-
-       BytomcliCmd.AddCommand(isMiningCmd)
-       BytomcliCmd.AddCommand(setMiningCmd)
-
-       BytomcliCmd.AddCommand(netInfoCmd)
-       BytomcliCmd.AddCommand(gasRateCmd)
-
-       BytomcliCmd.AddCommand(versionCmd)
+       VaporcliCmd.AddCommand(createAccessTokenCmd)
+       VaporcliCmd.AddCommand(listAccessTokenCmd)
+       VaporcliCmd.AddCommand(deleteAccessTokenCmd)
+       VaporcliCmd.AddCommand(checkAccessTokenCmd)
+
+       VaporcliCmd.AddCommand(createAccountCmd)
+       VaporcliCmd.AddCommand(deleteAccountCmd)
+       VaporcliCmd.AddCommand(listAccountsCmd)
+       VaporcliCmd.AddCommand(updateAccountAliasCmd)
+       VaporcliCmd.AddCommand(createAccountReceiverCmd)
+       VaporcliCmd.AddCommand(listAddressesCmd)
+       VaporcliCmd.AddCommand(validateAddressCmd)
+       VaporcliCmd.AddCommand(listPubKeysCmd)
+
+       VaporcliCmd.AddCommand(createAssetCmd)
+       VaporcliCmd.AddCommand(getAssetCmd)
+       VaporcliCmd.AddCommand(listAssetsCmd)
+       VaporcliCmd.AddCommand(updateAssetAliasCmd)
+
+       VaporcliCmd.AddCommand(getTransactionCmd)
+       VaporcliCmd.AddCommand(listTransactionsCmd)
+
+       VaporcliCmd.AddCommand(getUnconfirmedTransactionCmd)
+       VaporcliCmd.AddCommand(listUnconfirmedTransactionsCmd)
+       VaporcliCmd.AddCommand(decodeRawTransactionCmd)
+
+       VaporcliCmd.AddCommand(listUnspentOutputsCmd)
+       VaporcliCmd.AddCommand(listBalancesCmd)
+
+       VaporcliCmd.AddCommand(rescanWalletCmd)
+       VaporcliCmd.AddCommand(walletInfoCmd)
+
+       VaporcliCmd.AddCommand(buildTransactionCmd)
+       VaporcliCmd.AddCommand(signTransactionCmd)
+       VaporcliCmd.AddCommand(submitTransactionCmd)
+       VaporcliCmd.AddCommand(estimateTransactionGasCmd)
+
+       VaporcliCmd.AddCommand(getBlockCountCmd)
+       VaporcliCmd.AddCommand(getBlockHashCmd)
+       VaporcliCmd.AddCommand(getBlockCmd)
+       VaporcliCmd.AddCommand(getBlockHeaderCmd)
+       VaporcliCmd.AddCommand(getDifficultyCmd)
+       VaporcliCmd.AddCommand(getHashRateCmd)
+
+       VaporcliCmd.AddCommand(createKeyCmd)
+       VaporcliCmd.AddCommand(deleteKeyCmd)
+       VaporcliCmd.AddCommand(listKeysCmd)
+       VaporcliCmd.AddCommand(updateKeyAliasCmd)
+       VaporcliCmd.AddCommand(resetKeyPwdCmd)
+       VaporcliCmd.AddCommand(checkKeyPwdCmd)
+
+       VaporcliCmd.AddCommand(signMsgCmd)
+       VaporcliCmd.AddCommand(verifyMsgCmd)
+       VaporcliCmd.AddCommand(decodeProgCmd)
+
+       VaporcliCmd.AddCommand(createTransactionFeedCmd)
+       VaporcliCmd.AddCommand(listTransactionFeedsCmd)
+       VaporcliCmd.AddCommand(deleteTransactionFeedCmd)
+       VaporcliCmd.AddCommand(getTransactionFeedCmd)
+       VaporcliCmd.AddCommand(updateTransactionFeedCmd)
+
+       VaporcliCmd.AddCommand(isMiningCmd)
+       VaporcliCmd.AddCommand(setMiningCmd)
+
+       VaporcliCmd.AddCommand(netInfoCmd)
+       VaporcliCmd.AddCommand(gasRateCmd)
+
+       VaporcliCmd.AddCommand(versionCmd)
 }
 
-// AddTemplateFunc adds usage template to the root command BytomcliCmd.
+// AddTemplateFunc adds usage template to the root command VaporcliCmd.
 func AddTemplateFunc() {
        walletEnableCmd := []string{
                createAccountCmd.Name(),
index 5bfa3fd..9ce7585 100644 (file)
@@ -11,8 +11,8 @@ import (
 
 var versionCmd = &cobra.Command{
        Use:   "version",
-       Short: "Print the version number of Bytomcli",
+       Short: "Print the version number of vaporcli",
        Run: func(cmd *cobra.Command, args []string) {
-               jww.FEEDBACK.Printf("Bytomcli v%s %s/%s\n", version.Version, runtime.GOOS, runtime.GOARCH)
+               jww.FEEDBACK.Printf("vaporcli v%s %s/%s\n", version.Version, runtime.GOOS, runtime.GOARCH)
        },
 }
index dc43b08..6f75655 100644 (file)
@@ -16,7 +16,7 @@ var (
 )
 
 var RootCmd = &cobra.Command{
-       Use:   "bytomd",
+       Use:   "vapord",
        Short: "Multiple asset management.",
        PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
                err := viper.Unmarshal(config)
index fb84166..8df7f00 100644 (file)
@@ -14,12 +14,12 @@ const logModule = "cmd"
 
 var runNodeCmd = &cobra.Command{
        Use:   "node",
-       Short: "Run the bytomd",
+       Short: "Run the vapord",
        RunE:  runNode,
 }
 
 func init() {
-       runNodeCmd.Flags().String("prof_laddr", config.ProfListenAddress, "Use http to profile bytomd programs")
+       runNodeCmd.Flags().String("prof_laddr", config.ProfListenAddress, "Use http to profile vapord programs")
        runNodeCmd.Flags().Bool("mining", config.Mining, "Enable mining")
 
        runNodeCmd.Flags().Bool("auth.disable", config.Auth.Disable, "Disable rpc access authenticate")
index 580e39c..2340f77 100644 (file)
@@ -18,7 +18,7 @@ vapor data directory has three config files:
 - `federation.json`
 - `node_key.txt`
 
-Then you can use bytomd and bytomcli following [Bytom Wiki](https://github.com/Bytom/bytom/wiki/Command-Line-Options).
+Then you can use bytomd and vaporcli following [Bytom Wiki](https://github.com/Bytom/bytom/wiki/Command-Line-Options).
 
 Use `exit` to exit Docker's iterative mode.
 
@@ -45,7 +45,7 @@ $ docker ps
 __To execute a command inside a containner, for example:__
 
 ```bash
-$ docker exec -it <containerId> bytomcli create-access-token <tokenId>
+$ docker exec -it <containerId> vaporcli create-access-token <tokenId>
 ```
 
 __To stop a running containner:__
index 2451749..95ffbb4 100644 (file)
@@ -101,7 +101,7 @@ func (sm *SyncManager) Stop() {
 
 }
 
-// IsListening check if the bytomd service port is open?
+// IsListening check if the vapord service port is open?
 func (sm *SyncManager) IsListening() bool {
        if sm.config.VaultMode {
                return false
index d4c7fd5..6994823 100644 (file)
@@ -135,7 +135,7 @@ func NewNode(config *cfg.Config) *Node {
        // run the profile server
        profileHost := config.ProfListenAddress
        if profileHost != "" {
-               // Profiling bytomd programs.see (https://blog.golang.org/profiling-go-programs)
+               // Profiling vapord programs.see (https://blog.golang.org/profiling-go-programs)
                // go tool pprof http://profileHose/debug/pprof/heap
                go func() {
                        if err = http.ListenAndServe(profileHost, nil); err != nil {
index c061be9..2c9ca7b 100644 (file)
@@ -7,7 +7,7 @@ import (
 )
 
 const (
-       instanceName = "bytomd"
+       instanceName = "vapord"
        serviceName  = "lanDiscover"
        domainName   = "local"
 )
index fcd9df0..2c3e92e 100644 (file)
@@ -70,11 +70,11 @@ func getUPNPExternalAddress(externalPort, internalPort int) (*NetAddress, error)
        if externalPort == 0 {
                externalPort = defaultExternalPort
        }
-       externalPort, err = nat.AddPortMapping("tcp", externalPort, internalPort, "bytomd tcp", 0)
+       externalPort, err = nat.AddPortMapping("tcp", externalPort, internalPort, "vapord tcp", 0)
        if err != nil {
                return nil, errors.Wrap(err, "could not add tcp UPNP port mapping")
        }
-       externalPort, err = nat.AddPortMapping("udp", externalPort, internalPort, "bytomd udp", 0)
+       externalPort, err = nat.AddPortMapping("udp", externalPort, internalPort, "vapord udp", 0)
        if err != nil {
                return nil, errors.Wrap(err, "could not add udp UPNP port mapping")
        }
@@ -93,7 +93,7 @@ func splitHostPort(addr string) (host string, port int) {
        return host, port
 }
 
-//DefaultListener Implements bytomd server Listener
+//DefaultListener Implements vapord server Listener
 type DefaultListener struct {
        cmn.BaseService
 
index 6e1c4b7..0f3e5be 100644 (file)
@@ -47,7 +47,7 @@ func TestNodeInfoWriteRead(t *testing.T) {
        if err != nil {
                t.Fatal("create pubkey err.", err)
        }
-       nodeInfo := &NodeInfo{PubKey: pubKey.String(), Moniker: "bytomd", Network: "mainnet", NetworkID: 0x888, RemoteAddr: "127.0.0.2:0", ListenAddr: "127.0.0.1:0", Version: "1.1.0-test", ServiceFlag: 10, Other: []string{"abc", "bcd"}}
+       nodeInfo := &NodeInfo{PubKey: pubKey.String(), Moniker: "vapord", Network: "mainnet", NetworkID: 0x888, RemoteAddr: "127.0.0.2:0", ListenAddr: "127.0.0.1:0", Version: "1.1.0-test", ServiceFlag: 10, Other: []string{"abc", "bcd"}}
        n, err1, err2 := new(int), new(error), new(error)
        buf := new(bytes.Buffer)
 
index f7e06fa..e77696b 100644 (file)
@@ -14,12 +14,12 @@ const (
        Success = iota
        // ErrLocalExe indicates error occurs before the rpc calling.
        ErrLocalExe
-       // ErrConnect indicates error occurs connecting to the bytomd, e.g.,
-       // bytomd can't parse the received arguments.
+       // ErrConnect indicates error occurs connecting to the vapord, e.g.,
+       // vapord can't parse the received arguments.
        ErrConnect
        // ErrLocalParse indicates error occurs locally when parsing the response.
        ErrLocalParse
-       // ErrRemote indicates error occurs in bytomd.
+       // ErrRemote indicates error occurs in vapord.
        ErrRemote
 )
 
@@ -51,7 +51,7 @@ func ClientCall(path string, req ...interface{}) (interface{}, int) {
                jww.ERROR.Println(response.Msg)
                return nil, ErrRemote
        case "":
-               jww.ERROR.Println("Unable to connect to the bytomd")
+               jww.ERROR.Println("Unable to connect to the vapord")
                return nil, ErrConnect
        }
 
index 31e2e91..1ed6743 100644 (file)
@@ -127,7 +127,7 @@ func (s *UpdateStatus) CheckUpdate(localVerStr string, remoteVerStr string, remo
                        "Current version": localVerStr,
                        "Newer version":   remoteVerStr,
                        "seed":            remoteAddr,
-               }).Warn("Please update your bytomd via https://github.com/Bytom/bytom/releases/ or http://bytom.io/wallet/")
+               }).Warn("Please update your vapord via https://github.com/Bytom/bytom/releases/ or http://bytom.io/wallet/")
                s.notified = true
        }
        return nil