Merge remote-tracking branch 'origin/get-network-name' into network-upgrade

This commit is contained in:
StephenButtolph 2020-06-02 17:27:29 -04:00
commit 3828fdd573
1 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import (
"github.com/ava-labs/gecko/api"
"github.com/ava-labs/gecko/chains"
"github.com/ava-labs/gecko/genesis"
"github.com/ava-labs/gecko/ids"
"github.com/ava-labs/gecko/network"
"github.com/ava-labs/gecko/snow/engine/common"
@ -78,6 +79,20 @@ func (service *Admin) GetNetworkID(r *http.Request, args *GetNetworkIDArgs, repl
return nil
}
type GetNetworkNameArgs struct{}
type GetNetworkNameReply struct {
NetworkName string `json:"networkName"`
}
// GetNetworkID returns the network ID this node is running on
func (service *Admin) GetNetworkName(r *http.Request, args *GetNetworkNameArgs, reply *GetNetworkNameReply) error {
service.log.Debug("Admin: GetNetworkName called")
reply.NetworkName = genesis.NetworkName(service.networkID)
return nil
}
// GetBlockchainIDArgs are the arguments for calling GetBlockchainID
type GetBlockchainIDArgs struct {
Alias string `json:"alias"`