mirror of https://github.com/poanetwork/gecko.git
Merge remote-tracking branch 'origin/get-network-name' into network-upgrade
This commit is contained in:
commit
3828fdd573
|
@ -10,6 +10,7 @@ import (
|
||||||
|
|
||||||
"github.com/ava-labs/gecko/api"
|
"github.com/ava-labs/gecko/api"
|
||||||
"github.com/ava-labs/gecko/chains"
|
"github.com/ava-labs/gecko/chains"
|
||||||
|
"github.com/ava-labs/gecko/genesis"
|
||||||
"github.com/ava-labs/gecko/ids"
|
"github.com/ava-labs/gecko/ids"
|
||||||
"github.com/ava-labs/gecko/network"
|
"github.com/ava-labs/gecko/network"
|
||||||
"github.com/ava-labs/gecko/snow/engine/common"
|
"github.com/ava-labs/gecko/snow/engine/common"
|
||||||
|
@ -78,6 +79,20 @@ func (service *Admin) GetNetworkID(r *http.Request, args *GetNetworkIDArgs, repl
|
||||||
return nil
|
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
|
// GetBlockchainIDArgs are the arguments for calling GetBlockchainID
|
||||||
type GetBlockchainIDArgs struct {
|
type GetBlockchainIDArgs struct {
|
||||||
Alias string `json:"alias"`
|
Alias string `json:"alias"`
|
||||||
|
|
Loading…
Reference in New Issue