File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
1111
1212 coreCommon "github.com/oasisprotocol/oasis-core/go/common"
1313
14+ sdkConfig "github.com/oasisprotocol/oasis-sdk/client-sdk/go/config"
1415 "github.com/oasisprotocol/oasis-sdk/client-sdk/go/connection"
1516
1617 "github.com/oasisprotocol/cli/cmd/common"
@@ -28,6 +29,15 @@ func getParatimeName(cfg *cliConfig.Config, id string) string {
2829 return ("unknown" )
2930}
3031
32+ func getNetworkName (context string ) string {
33+ for key , net := range sdkConfig .DefaultNetworks .All {
34+ if context == net .ChainContext {
35+ return (key )
36+ }
37+ }
38+ return ("unknown" )
39+ }
40+
3141var statusCmd = & cobra.Command {
3242 Use : "status" ,
3343 Short : "Show the current status of the node and the network" ,
@@ -75,7 +85,7 @@ var statusCmd = &cobra.Command{
7585 fmt .Printf ("Version: %s" , consensus .Version .String ())
7686 fmt .Println ()
7787
78- fmt .Printf ("Chain context: %s" , consensus .ChainContext )
88+ fmt .Printf ("Chain context: %s (%s)" , getNetworkName ( consensus . ChainContext ) , consensus .ChainContext )
7989 fmt .Println ()
8090
8191 date := time .Unix (nodeStatus .Consensus .LatestTime .Unix (), 0 )
You can’t perform that action at this time.
0 commit comments