mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-07 12:30:45 +00:00
* return a command error prior to init * add a pending log entry * Update CHANGELOG_PENDING.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> closes: #3314
27 lines
465 B
Go
27 lines
465 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/tendermint/tendermint/p2p"
|
|
)
|
|
|
|
// ShowNodeIDCmd dumps node's ID to the standard output.
|
|
var ShowNodeIDCmd = &cobra.Command{
|
|
Use: "show_node_id",
|
|
Short: "Show this node's ID",
|
|
RunE: showNodeID,
|
|
}
|
|
|
|
func showNodeID(cmd *cobra.Command, args []string) error {
|
|
nodeKey, err := p2p.LoadNodeKey(config.NodeKeyFile())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Println(nodeKey.ID())
|
|
return nil
|
|
}
|