diff --git a/api/admin/service.go b/api/admin/service.go index ba8cad2..bddc7ba 100644 --- a/api/admin/service.go +++ b/api/admin/service.go @@ -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"`