mirror of https://github.com/poanetwork/gecko.git
Merge pull request #70 from ava-labs/log-level-and-format
Change RPC log levels
This commit is contained in:
commit
639ef4b22f
|
@ -57,7 +57,7 @@ type GetNodeVersionReply struct {
|
|||
|
||||
// GetNodeVersion returns the version this node is running
|
||||
func (service *Admin) GetNodeVersion(_ *http.Request, _ *struct{}, reply *GetNodeVersionReply) error {
|
||||
service.log.Debug("Admin: GetNodeVersion called")
|
||||
service.log.Info("Admin: GetNodeVersion called")
|
||||
|
||||
reply.Version = service.version.String()
|
||||
return nil
|
||||
|
@ -70,7 +70,7 @@ type GetNodeIDReply struct {
|
|||
|
||||
// GetNodeID returns the node ID of this node
|
||||
func (service *Admin) GetNodeID(_ *http.Request, _ *struct{}, reply *GetNodeIDReply) error {
|
||||
service.log.Debug("Admin: GetNodeID called")
|
||||
service.log.Info("Admin: GetNodeID called")
|
||||
|
||||
reply.NodeID = service.nodeID
|
||||
return nil
|
||||
|
@ -83,7 +83,7 @@ type GetNetworkIDReply struct {
|
|||
|
||||
// GetNetworkID returns the network ID this node is running on
|
||||
func (service *Admin) GetNetworkID(_ *http.Request, _ *struct{}, reply *GetNetworkIDReply) error {
|
||||
service.log.Debug("Admin: GetNetworkID called")
|
||||
service.log.Info("Admin: GetNetworkID called")
|
||||
|
||||
reply.NetworkID = cjson.Uint32(service.networkID)
|
||||
return nil
|
||||
|
@ -96,7 +96,7 @@ type GetNetworkNameReply struct {
|
|||
|
||||
// GetNetworkName returns the network name this node is running on
|
||||
func (service *Admin) GetNetworkName(_ *http.Request, _ *struct{}, reply *GetNetworkNameReply) error {
|
||||
service.log.Debug("Admin: GetNetworkName called")
|
||||
service.log.Info("Admin: GetNetworkName called")
|
||||
|
||||
reply.NetworkName = genesis.NetworkName(service.networkID)
|
||||
return nil
|
||||
|
@ -114,7 +114,7 @@ type GetBlockchainIDReply struct {
|
|||
|
||||
// GetBlockchainID returns the blockchain ID that resolves the alias that was supplied
|
||||
func (service *Admin) GetBlockchainID(_ *http.Request, args *GetBlockchainIDArgs, reply *GetBlockchainIDReply) error {
|
||||
service.log.Debug("Admin: GetBlockchainID called")
|
||||
service.log.Info("Admin: GetBlockchainID called")
|
||||
|
||||
bID, err := service.chainManager.Lookup(args.Alias)
|
||||
reply.BlockchainID = bID.String()
|
||||
|
@ -128,7 +128,7 @@ type PeersReply struct {
|
|||
|
||||
// Peers returns the list of current validators
|
||||
func (service *Admin) Peers(_ *http.Request, _ *struct{}, reply *PeersReply) error {
|
||||
service.log.Debug("Admin: Peers called")
|
||||
service.log.Info("Admin: Peers called")
|
||||
reply.Peers = service.networking.Peers()
|
||||
return nil
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ type StartCPUProfilerReply struct {
|
|||
|
||||
// StartCPUProfiler starts a cpu profile writing to the specified file
|
||||
func (service *Admin) StartCPUProfiler(_ *http.Request, args *StartCPUProfilerArgs, reply *StartCPUProfilerReply) error {
|
||||
service.log.Debug("Admin: StartCPUProfiler called with %s", args.Filename)
|
||||
service.log.Info("Admin: StartCPUProfiler called with %s", args.Filename)
|
||||
reply.Success = true
|
||||
return service.performance.StartCPUProfiler(args.Filename)
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ type StopCPUProfilerReply struct {
|
|||
|
||||
// StopCPUProfiler stops the cpu profile
|
||||
func (service *Admin) StopCPUProfiler(_ *http.Request, _ *struct{}, reply *StopCPUProfilerReply) error {
|
||||
service.log.Debug("Admin: StopCPUProfiler called")
|
||||
service.log.Info("Admin: StopCPUProfiler called")
|
||||
reply.Success = true
|
||||
return service.performance.StopCPUProfiler()
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ type MemoryProfileReply struct {
|
|||
|
||||
// MemoryProfile runs a memory profile writing to the specified file
|
||||
func (service *Admin) MemoryProfile(_ *http.Request, args *MemoryProfileArgs, reply *MemoryProfileReply) error {
|
||||
service.log.Debug("Admin: MemoryProfile called with %s", args.Filename)
|
||||
service.log.Info("Admin: MemoryProfile called with %s", args.Filename)
|
||||
reply.Success = true
|
||||
return service.performance.MemoryProfile(args.Filename)
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ type LockProfileReply struct {
|
|||
|
||||
// LockProfile runs a mutex profile writing to the specified file
|
||||
func (service *Admin) LockProfile(_ *http.Request, args *LockProfileArgs, reply *LockProfileReply) error {
|
||||
service.log.Debug("Admin: LockProfile called with %s", args.Filename)
|
||||
service.log.Info("Admin: LockProfile called with %s", args.Filename)
|
||||
reply.Success = true
|
||||
return service.performance.LockProfile(args.Filename)
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ type AliasReply struct {
|
|||
|
||||
// Alias attempts to alias an HTTP endpoint to a new name
|
||||
func (service *Admin) Alias(_ *http.Request, args *AliasArgs, reply *AliasReply) error {
|
||||
service.log.Debug("Admin: Alias called with URL: %s, Alias: %s", args.Endpoint, args.Alias)
|
||||
service.log.Info("Admin: Alias called with URL: %s, Alias: %s", args.Endpoint, args.Alias)
|
||||
reply.Success = true
|
||||
return service.httpServer.AddAliasesWithReadLock(args.Endpoint, args.Alias)
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ type AliasChainReply struct {
|
|||
|
||||
// AliasChain attempts to alias a chain to a new name
|
||||
func (service *Admin) AliasChain(_ *http.Request, args *AliasChainArgs, reply *AliasChainReply) error {
|
||||
service.log.Debug("Admin: AliasChain called with Chain: %s, Alias: %s", args.Chain, args.Alias)
|
||||
service.log.Info("Admin: AliasChain called with Chain: %s, Alias: %s", args.Chain, args.Alias)
|
||||
|
||||
chainID, err := service.chainManager.Lookup(args.Chain)
|
||||
if err != nil {
|
||||
|
|
|
@ -74,7 +74,7 @@ type GetLivenessReply struct {
|
|||
|
||||
// GetLiveness returns a summation of the health of the node
|
||||
func (h *Health) GetLiveness(_ *http.Request, _ *GetLivenessArgs, reply *GetLivenessReply) error {
|
||||
h.log.Debug("Health: GetLiveness called")
|
||||
h.log.Info("Health: GetLiveness called")
|
||||
reply.Checks, reply.Healthy = h.health.Results()
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ type PublishBlockchainReply struct {
|
|||
|
||||
// PublishBlockchain publishes the finalized accepted transactions from the blockchainID over the IPC
|
||||
func (ipc *IPCs) PublishBlockchain(r *http.Request, args *PublishBlockchainArgs, reply *PublishBlockchainReply) error {
|
||||
ipc.log.Info("IPCs: PublishBlockchain called with BlockchainID: %s", args.BlockchainID)
|
||||
chainID, err := ipc.chainManager.Lookup(args.BlockchainID)
|
||||
if err != nil {
|
||||
ipc.log.Error("unknown blockchainID: %s", err)
|
||||
|
@ -116,6 +117,7 @@ type UnpublishBlockchainReply struct {
|
|||
|
||||
// UnpublishBlockchain closes publishing of a blockchainID
|
||||
func (ipc *IPCs) UnpublishBlockchain(r *http.Request, args *UnpublishBlockchainArgs, reply *UnpublishBlockchainReply) error {
|
||||
ipc.log.Info("IPCs: UnpublishBlockchain called with BlockchainID: %s", args.BlockchainID)
|
||||
chainID, err := ipc.chainManager.Lookup(args.BlockchainID)
|
||||
if err != nil {
|
||||
ipc.log.Error("unknown blockchainID %s: %s", args.BlockchainID, err)
|
||||
|
|
|
@ -146,7 +146,7 @@ func (ks *Keystore) CreateUser(_ *http.Request, args *CreateUserArgs, reply *Cre
|
|||
ks.lock.Lock()
|
||||
defer ks.lock.Unlock()
|
||||
|
||||
ks.log.Verbo("CreateUser called with %.*s", maxUserPassLen, args.Username)
|
||||
ks.log.Info("Keystore: CreateUser called with %.*s", maxUserPassLen, args.Username)
|
||||
if err := ks.AddUser(args.Username, args.Password); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ func (ks *Keystore) ListUsers(_ *http.Request, args *ListUsersArgs, reply *ListU
|
|||
ks.lock.Lock()
|
||||
defer ks.lock.Unlock()
|
||||
|
||||
ks.log.Verbo("ListUsers called")
|
||||
ks.log.Info("Keystore: ListUsers called")
|
||||
|
||||
reply.Users = []string{}
|
||||
|
||||
|
@ -196,7 +196,7 @@ func (ks *Keystore) ExportUser(_ *http.Request, args *ExportUserArgs, reply *Exp
|
|||
ks.lock.Lock()
|
||||
defer ks.lock.Unlock()
|
||||
|
||||
ks.log.Verbo("ExportUser called for %s", args.Username)
|
||||
ks.log.Info("Keystore: ExportUser called for %s", args.Username)
|
||||
|
||||
usr, err := ks.getUser(args.Username)
|
||||
if err != nil {
|
||||
|
@ -249,7 +249,7 @@ func (ks *Keystore) ImportUser(r *http.Request, args *ImportUserArgs, reply *Imp
|
|||
ks.lock.Lock()
|
||||
defer ks.lock.Unlock()
|
||||
|
||||
ks.log.Verbo("ImportUser called for %s", args.Username)
|
||||
ks.log.Info("Keystore: ImportUser called for %s", args.Username)
|
||||
|
||||
if args.Username == "" {
|
||||
return errEmptyUsername
|
||||
|
@ -309,7 +309,7 @@ func (ks *Keystore) DeleteUser(_ *http.Request, args *DeleteUserArgs, reply *Del
|
|||
ks.lock.Lock()
|
||||
defer ks.lock.Unlock()
|
||||
|
||||
ks.log.Verbo("DeleteUser called with %s", args.Username)
|
||||
ks.log.Info("Keystore: DeleteUser called with %s", args.Username)
|
||||
|
||||
if args.Username == "" {
|
||||
return errEmptyUsername
|
||||
|
|
1
go.sum
1
go.sum
|
@ -2,6 +2,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
|||
github.com/AppsFlyer/go-sundheit v0.2.0 h1:FArqX+HbqZ6U32RC3giEAWRUpkggqxHj91KIvxNgwjU=
|
||||
github.com/AppsFlyer/go-sundheit v0.2.0/go.mod h1:rCRkVTMQo7/krF7xQ9X0XEF1an68viFR6/Gy02q+4ds=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Microsoft/go-winio v0.4.11 h1:zoIOcVf0xPN1tnMVbTtEdI+P8OofVk3NObnwOQ6nK2Q=
|
||||
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/Shopify/sarama v1.26.1/go.mod h1:NbSGBSSndYaIhRcBtY9V0U7AyH+x71bG668AuWys/yU=
|
||||
|
|
|
@ -56,7 +56,7 @@ type IssueTxReply struct {
|
|||
|
||||
// IssueTx attempts to issue a transaction into consensus
|
||||
func (service *Service) IssueTx(r *http.Request, args *IssueTxArgs, reply *IssueTxReply) error {
|
||||
service.vm.ctx.Log.Verbo("IssueTx called with %s", args.Tx)
|
||||
service.vm.ctx.Log.Info("AVM: IssueTx called with %s", args.Tx)
|
||||
|
||||
txID, err := service.vm.IssueTx(args.Tx.Bytes, nil)
|
||||
if err != nil {
|
||||
|
@ -79,7 +79,7 @@ type GetTxStatusReply struct {
|
|||
|
||||
// GetTxStatus returns the status of the specified transaction
|
||||
func (service *Service) GetTxStatus(r *http.Request, args *GetTxStatusArgs, reply *GetTxStatusReply) error {
|
||||
service.vm.ctx.Log.Verbo("GetTxStatus called with %s", args.TxID)
|
||||
service.vm.ctx.Log.Info("AVM: GetTxStatus called with %s", args.TxID)
|
||||
|
||||
if args.TxID.IsZero() {
|
||||
return errNilTxID
|
||||
|
@ -106,7 +106,7 @@ type GetTxReply struct {
|
|||
|
||||
// GetTx returns the specified transaction
|
||||
func (service *Service) GetTx(r *http.Request, args *GetTxArgs, reply *GetTxReply) error {
|
||||
service.vm.ctx.Log.Verbo("GetTx called with %s", args.TxID)
|
||||
service.vm.ctx.Log.Info("AVM: GetTx called with %s", args.TxID)
|
||||
|
||||
if args.TxID.IsZero() {
|
||||
return errNilTxID
|
||||
|
@ -136,7 +136,7 @@ type GetUTXOsReply struct {
|
|||
|
||||
// GetUTXOs creates an empty account with the name passed in
|
||||
func (service *Service) GetUTXOs(r *http.Request, args *GetUTXOsArgs, reply *GetUTXOsReply) error {
|
||||
service.vm.ctx.Log.Verbo("GetUTXOs called with %s", args.Addresses)
|
||||
service.vm.ctx.Log.Info("AVM: GetUTXOs called with %s", args.Addresses)
|
||||
|
||||
addrSet := ids.Set{}
|
||||
for _, addr := range args.Addresses {
|
||||
|
@ -178,7 +178,7 @@ type GetAssetDescriptionReply struct {
|
|||
|
||||
// GetAssetDescription creates an empty account with the name passed in
|
||||
func (service *Service) GetAssetDescription(_ *http.Request, args *GetAssetDescriptionArgs, reply *GetAssetDescriptionReply) error {
|
||||
service.vm.ctx.Log.Verbo("GetAssetDescription called with %s", args.AssetID)
|
||||
service.vm.ctx.Log.Info("AVM: GetAssetDescription called with %s", args.AssetID)
|
||||
|
||||
assetID, err := service.vm.Lookup(args.AssetID)
|
||||
if err != nil {
|
||||
|
@ -222,7 +222,7 @@ type GetBalanceReply struct {
|
|||
|
||||
// GetBalance returns the amount of an asset that an address at least partially owns
|
||||
func (service *Service) GetBalance(r *http.Request, args *GetBalanceArgs, reply *GetBalanceReply) error {
|
||||
service.vm.ctx.Log.Verbo("GetBalance called with address: %s assetID: %s", args.Address, args.AssetID)
|
||||
service.vm.ctx.Log.Info("AVM: GetBalance called with address: %s assetID: %s", args.Address, args.AssetID)
|
||||
|
||||
address, err := service.vm.Parse(args.Address)
|
||||
if err != nil {
|
||||
|
@ -287,7 +287,7 @@ type GetAllBalancesReply struct {
|
|||
// Note that balances include assets that the address only _partially_ owns
|
||||
// (ie is one of several addresses specified in a multi-sig)
|
||||
func (service *Service) GetAllBalances(r *http.Request, args *GetAllBalancesArgs, reply *GetAllBalancesReply) error {
|
||||
service.vm.ctx.Log.Verbo("GetAllBalances called with address: %s", args.Address)
|
||||
service.vm.ctx.Log.Info("AVM: GetAllBalances called with address: %s", args.Address)
|
||||
|
||||
address, err := service.vm.Parse(args.Address)
|
||||
if err != nil {
|
||||
|
@ -360,7 +360,7 @@ type CreateFixedCapAssetReply struct {
|
|||
|
||||
// CreateFixedCapAsset returns ID of the newly created asset
|
||||
func (service *Service) CreateFixedCapAsset(r *http.Request, args *CreateFixedCapAssetArgs, reply *CreateFixedCapAssetReply) error {
|
||||
service.vm.ctx.Log.Verbo("CreateFixedCapAsset called with name: %s symbol: %s number of holders: %d",
|
||||
service.vm.ctx.Log.Info("AVM: CreateFixedCapAsset called with name: %s symbol: %s number of holders: %d",
|
||||
args.Name,
|
||||
args.Symbol,
|
||||
len(args.InitialHolders),
|
||||
|
@ -445,7 +445,7 @@ type CreateVariableCapAssetReply struct {
|
|||
|
||||
// CreateVariableCapAsset returns ID of the newly created asset
|
||||
func (service *Service) CreateVariableCapAsset(r *http.Request, args *CreateVariableCapAssetArgs, reply *CreateVariableCapAssetReply) error {
|
||||
service.vm.ctx.Log.Verbo("CreateFixedCapAsset called with name: %s symbol: %s number of minters: %d",
|
||||
service.vm.ctx.Log.Info("AVM: CreateFixedCapAsset called with name: %s symbol: %s number of minters: %d",
|
||||
args.Name,
|
||||
args.Symbol,
|
||||
len(args.MinterSets),
|
||||
|
@ -523,7 +523,7 @@ type CreateAddressReply struct {
|
|||
|
||||
// CreateAddress creates an address for the user [args.Username]
|
||||
func (service *Service) CreateAddress(r *http.Request, args *CreateAddressArgs, reply *CreateAddressReply) error {
|
||||
service.vm.ctx.Log.Verbo("CreateAddress called for user '%s'", args.Username)
|
||||
service.vm.ctx.Log.Info("AVM: CreateAddress called for user '%s'", args.Username)
|
||||
|
||||
db, err := service.vm.ctx.Keystore.GetDatabase(args.Username, args.Password)
|
||||
if err != nil {
|
||||
|
@ -603,7 +603,7 @@ type ExportKeyReply struct {
|
|||
|
||||
// ExportKey returns a private key from the provided user
|
||||
func (service *Service) ExportKey(r *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error {
|
||||
service.vm.ctx.Log.Verbo("ExportKey called for user '%s'", args.Username)
|
||||
service.vm.ctx.Log.Info("AVM: ExportKey called for user '%s'", args.Username)
|
||||
|
||||
address, err := service.vm.Parse(args.Address)
|
||||
if err != nil {
|
||||
|
@ -645,7 +645,7 @@ type ImportKeyReply struct {
|
|||
|
||||
// ImportKey adds a private key to the provided user
|
||||
func (service *Service) ImportKey(r *http.Request, args *ImportKeyArgs, reply *ImportKeyReply) error {
|
||||
service.vm.ctx.Log.Verbo("ImportKey called for user '%s'", args.Username)
|
||||
service.vm.ctx.Log.Info("AVM: ImportKey called for user '%s'", args.Username)
|
||||
|
||||
db, err := service.vm.ctx.Keystore.GetDatabase(args.Username, args.Password)
|
||||
if err != nil {
|
||||
|
@ -699,7 +699,7 @@ type SendReply struct {
|
|||
|
||||
// Send returns the ID of the newly created transaction
|
||||
func (service *Service) Send(r *http.Request, args *SendArgs, reply *SendReply) error {
|
||||
service.vm.ctx.Log.Verbo("Send called with username: %s", args.Username)
|
||||
service.vm.ctx.Log.Info("AVM: Send called with username: %s", args.Username)
|
||||
|
||||
if args.Amount == 0 {
|
||||
return errInvalidAmount
|
||||
|
@ -880,7 +880,7 @@ type CreateMintTxReply struct {
|
|||
|
||||
// CreateMintTx returns the newly created unsigned transaction
|
||||
func (service *Service) CreateMintTx(r *http.Request, args *CreateMintTxArgs, reply *CreateMintTxReply) error {
|
||||
service.vm.ctx.Log.Verbo("CreateMintTx called")
|
||||
service.vm.ctx.Log.Info("AVM: CreateMintTx called")
|
||||
|
||||
if args.Amount == 0 {
|
||||
return errInvalidMintAmount
|
||||
|
@ -997,7 +997,7 @@ type SignMintTxReply struct {
|
|||
|
||||
// SignMintTx returns the newly signed transaction
|
||||
func (service *Service) SignMintTx(r *http.Request, args *SignMintTxArgs, reply *SignMintTxReply) error {
|
||||
service.vm.ctx.Log.Verbo("SignMintTx called")
|
||||
service.vm.ctx.Log.Info("AVM: SignMintTx called")
|
||||
|
||||
minter, err := service.vm.Parse(args.Minter)
|
||||
if err != nil {
|
||||
|
@ -1123,7 +1123,7 @@ type ImportAVAReply struct {
|
|||
// The AVA must have already been exported from the P-Chain.
|
||||
// Returns the ID of the newly created atomic transaction
|
||||
func (service *Service) ImportAVA(_ *http.Request, args *ImportAVAArgs, reply *ImportAVAReply) error {
|
||||
service.vm.ctx.Log.Verbo("ImportAVA called with username: %s", args.Username)
|
||||
service.vm.ctx.Log.Info("AVM: ImportAVA called with username: %s", args.Username)
|
||||
|
||||
toBytes, err := service.vm.Parse(args.To)
|
||||
if err != nil {
|
||||
|
@ -1275,7 +1275,7 @@ type ExportAVAReply struct {
|
|||
// After this tx is accepted, the AVA must be imported to the P-chain with an importTx.
|
||||
// Returns the ID of the newly created atomic transaction
|
||||
func (service *Service) ExportAVA(_ *http.Request, args *ExportAVAArgs, reply *ExportAVAReply) error {
|
||||
service.vm.ctx.Log.Verbo("ExportAVA called with username: %s", args.Username)
|
||||
service.vm.ctx.Log.Info("AVM: ExportAVA called with username: %s", args.Username)
|
||||
|
||||
if args.Amount == 0 {
|
||||
return errInvalidAmount
|
||||
|
|
|
@ -234,7 +234,7 @@ type GetCurrentValidatorsReply struct {
|
|||
|
||||
// GetCurrentValidators returns the list of current validators
|
||||
func (service *Service) GetCurrentValidators(_ *http.Request, args *GetCurrentValidatorsArgs, reply *GetCurrentValidatorsReply) error {
|
||||
service.vm.Ctx.Log.Debug("GetCurrentValidators called")
|
||||
service.vm.Ctx.Log.Info("Platform: GetCurrentValidators called")
|
||||
|
||||
if args.SubnetID.IsZero() {
|
||||
args.SubnetID = DefaultSubnetID
|
||||
|
@ -298,7 +298,7 @@ type GetPendingValidatorsReply struct {
|
|||
|
||||
// GetPendingValidators returns the list of current validators
|
||||
func (service *Service) GetPendingValidators(_ *http.Request, args *GetPendingValidatorsArgs, reply *GetPendingValidatorsReply) error {
|
||||
service.vm.Ctx.Log.Debug("GetPendingValidators called")
|
||||
service.vm.Ctx.Log.Info("Platform: GetPendingValidators called")
|
||||
|
||||
if args.SubnetID.IsZero() {
|
||||
args.SubnetID = DefaultSubnetID
|
||||
|
@ -360,7 +360,7 @@ type SampleValidatorsReply struct {
|
|||
|
||||
// SampleValidators returns a sampling of the list of current validators
|
||||
func (service *Service) SampleValidators(_ *http.Request, args *SampleValidatorsArgs, reply *SampleValidatorsReply) error {
|
||||
service.vm.Ctx.Log.Debug("Sample called with {Size = %d}", args.Size)
|
||||
service.vm.Ctx.Log.Info("Platform: SampleValidators called with {Size = %d}", args.Size)
|
||||
|
||||
if args.SubnetID.IsZero() {
|
||||
args.SubnetID = DefaultSubnetID
|
||||
|
@ -437,7 +437,7 @@ type ListAccountsReply struct {
|
|||
|
||||
// ListAccounts lists all of the accounts controlled by [args.Username]
|
||||
func (service *Service) ListAccounts(_ *http.Request, args *ListAccountsArgs, reply *ListAccountsReply) error {
|
||||
service.vm.Ctx.Log.Debug("listAccounts called for user '%s'", args.Username)
|
||||
service.vm.Ctx.Log.Info("Platform: ListAccounts called for user '%s'", args.Username)
|
||||
|
||||
// db holds the user's info that pertains to the Platform Chain
|
||||
userDB, err := service.vm.Ctx.Keystore.GetDatabase(args.Username, args.Password)
|
||||
|
@ -499,7 +499,7 @@ type CreateAccountReply struct {
|
|||
// The account's ID is [privKey].PublicKey().Address(), where [privKey] is a
|
||||
// private key controlled by the user.
|
||||
func (service *Service) CreateAccount(_ *http.Request, args *CreateAccountArgs, reply *CreateAccountReply) error {
|
||||
service.vm.Ctx.Log.Debug("createAccount called for user '%s'", args.Username)
|
||||
service.vm.Ctx.Log.Info("Platform: CreateAccount called for user '%s'", args.Username)
|
||||
|
||||
// userDB holds the user's info that pertains to the Platform Chain
|
||||
userDB, err := service.vm.Ctx.Keystore.GetDatabase(args.Username, args.Password)
|
||||
|
@ -569,7 +569,7 @@ type AddDefaultSubnetValidatorArgs struct {
|
|||
// AddDefaultSubnetValidator returns an unsigned transaction to add a validator to the default subnet
|
||||
// The returned unsigned transaction should be signed using Sign()
|
||||
func (service *Service) AddDefaultSubnetValidator(_ *http.Request, args *AddDefaultSubnetValidatorArgs, reply *CreateTxResponse) error {
|
||||
service.vm.Ctx.Log.Debug("AddDefaultSubnetValidator called")
|
||||
service.vm.Ctx.Log.Info("Platform: AddDefaultSubnetValidator called")
|
||||
|
||||
switch {
|
||||
case args.ID.IsZero(): // If ID unspecified, use this node's ID as validator ID
|
||||
|
@ -626,7 +626,7 @@ type AddDefaultSubnetDelegatorArgs struct {
|
|||
// to the default subnet
|
||||
// The returned unsigned transaction should be signed using Sign()
|
||||
func (service *Service) AddDefaultSubnetDelegator(_ *http.Request, args *AddDefaultSubnetDelegatorArgs, reply *CreateTxResponse) error {
|
||||
service.vm.Ctx.Log.Debug("AddDefaultSubnetDelegator called")
|
||||
service.vm.Ctx.Log.Info("Platform: AddDefaultSubnetDelegator called")
|
||||
|
||||
switch {
|
||||
case args.ID.IsZero(): // If ID unspecified, use this node's ID as validator ID
|
||||
|
@ -741,7 +741,7 @@ type CreateSubnetArgs struct {
|
|||
// CreateSubnet returns an unsigned transaction to create a new subnet.
|
||||
// The unsigned transaction must be signed with the key of [args.Payer]
|
||||
func (service *Service) CreateSubnet(_ *http.Request, args *CreateSubnetArgs, response *CreateTxResponse) error {
|
||||
service.vm.Ctx.Log.Debug("platform.createSubnet called")
|
||||
service.vm.Ctx.Log.Info("Platform: CreateSubnet called")
|
||||
|
||||
switch {
|
||||
case args.PayerNonce == 0:
|
||||
|
@ -796,7 +796,7 @@ type ExportAVAArgs struct {
|
|||
// The unsigned transaction must be signed with the key of the account exporting the AVA
|
||||
// and paying the transaction fee
|
||||
func (service *Service) ExportAVA(_ *http.Request, args *ExportAVAArgs, response *CreateTxResponse) error {
|
||||
service.vm.Ctx.Log.Debug("platform.ExportAVA called")
|
||||
service.vm.Ctx.Log.Info("Platform: ExportAVA called")
|
||||
|
||||
switch {
|
||||
case args.PayerNonce == 0:
|
||||
|
@ -858,7 +858,7 @@ type SignResponse struct {
|
|||
|
||||
// Sign [args.bytes]
|
||||
func (service *Service) Sign(_ *http.Request, args *SignArgs, reply *SignResponse) error {
|
||||
service.vm.Ctx.Log.Debug("sign called")
|
||||
service.vm.Ctx.Log.Info("Platform: Sign called")
|
||||
|
||||
if args.Signer == "" {
|
||||
return errNilSigner
|
||||
|
@ -938,7 +938,7 @@ func (service *Service) signAddDefaultSubnetValidatorTx(tx *addDefaultSubnetVali
|
|||
|
||||
// Sign [unsigned] with [key]
|
||||
func (service *Service) signAddDefaultSubnetDelegatorTx(tx *addDefaultSubnetDelegatorTx, key *crypto.PrivateKeySECP256K1R) (*addDefaultSubnetDelegatorTx, error) {
|
||||
service.vm.Ctx.Log.Debug("signAddDefaultSubnetValidatorTx called")
|
||||
service.vm.Ctx.Log.Debug("signAddDefaultSubnetDelegatorTx called")
|
||||
|
||||
// TODO: Should we check if tx is already signed?
|
||||
unsignedIntf := interface{}(&tx.UnsignedAddDefaultSubnetDelegatorTx)
|
||||
|
@ -961,7 +961,7 @@ func (service *Service) signAddDefaultSubnetDelegatorTx(tx *addDefaultSubnetDele
|
|||
|
||||
// Sign [xt] with [key]
|
||||
func (service *Service) signCreateSubnetTx(tx *CreateSubnetTx, key *crypto.PrivateKeySECP256K1R) (*CreateSubnetTx, error) {
|
||||
service.vm.Ctx.Log.Debug("signAddDefaultSubnetValidatorTx called")
|
||||
service.vm.Ctx.Log.Debug("signCreateSubnetTx called")
|
||||
|
||||
// TODO: Should we check if tx is already signed?
|
||||
unsignedIntf := interface{}(&tx.UnsignedCreateSubnetTx)
|
||||
|
@ -984,7 +984,7 @@ func (service *Service) signCreateSubnetTx(tx *CreateSubnetTx, key *crypto.Priva
|
|||
|
||||
// Sign [tx] with [key]
|
||||
func (service *Service) signExportTx(tx *ExportTx, key *crypto.PrivateKeySECP256K1R) (*ExportTx, error) {
|
||||
service.vm.Ctx.Log.Debug("platform.signAddDefaultSubnetValidatorTx called")
|
||||
service.vm.Ctx.Log.Debug("signExportTx called")
|
||||
|
||||
// TODO: Should we check if tx is already signed?
|
||||
unsignedIntf := interface{}(&tx.UnsignedExportTx)
|
||||
|
@ -1075,7 +1075,7 @@ type ImportAVAArgs struct {
|
|||
// The AVA must have already been exported from the X-Chain.
|
||||
// The unsigned transaction must be signed with the key of the tx fee payer.
|
||||
func (service *Service) ImportAVA(_ *http.Request, args *ImportAVAArgs, response *SignResponse) error {
|
||||
service.vm.Ctx.Log.Debug("platform.ImportAVA called")
|
||||
service.vm.Ctx.Log.Info("Platform: ImportAVA called")
|
||||
|
||||
switch {
|
||||
case args.To == "":
|
||||
|
@ -1263,7 +1263,7 @@ type IssueTxResponse struct {
|
|||
|
||||
// IssueTx issues the transaction [args.Tx] to the network
|
||||
func (service *Service) IssueTx(_ *http.Request, args *IssueTxArgs, response *IssueTxResponse) error {
|
||||
service.vm.Ctx.Log.Debug("issueTx called")
|
||||
service.vm.Ctx.Log.Info("Platform: IssueTx called")
|
||||
|
||||
genTx := genericTx{}
|
||||
if err := Codec.Unmarshal(args.Tx.Bytes, &genTx); err != nil {
|
||||
|
@ -1327,7 +1327,7 @@ type CreateBlockchainArgs struct {
|
|||
// CreateBlockchain returns an unsigned transaction to create a new blockchain
|
||||
// Must be signed with the Subnet's control keys and with a key that pays the transaction fee before issuance
|
||||
func (service *Service) CreateBlockchain(_ *http.Request, args *CreateBlockchainArgs, response *CreateTxResponse) error {
|
||||
service.vm.Ctx.Log.Debug("createBlockchain called")
|
||||
service.vm.Ctx.Log.Info("Platform: CreateBlockchain called")
|
||||
|
||||
switch {
|
||||
case args.PayerNonce == 0:
|
||||
|
@ -1410,7 +1410,7 @@ type GetBlockchainStatusReply struct {
|
|||
|
||||
// GetBlockchainStatus gets the status of a blockchain with the ID [args.BlockchainID].
|
||||
func (service *Service) GetBlockchainStatus(_ *http.Request, args *GetBlockchainStatusArgs, reply *GetBlockchainStatusReply) error {
|
||||
service.vm.Ctx.Log.Debug("getBlockchainStatus called")
|
||||
service.vm.Ctx.Log.Info("Platform: GetBlockchainStatus called")
|
||||
|
||||
switch {
|
||||
case args.BlockchainID == "":
|
||||
|
@ -1490,7 +1490,7 @@ type ValidatedByResponse struct {
|
|||
|
||||
// ValidatedBy returns the ID of the Subnet that validates [args.BlockchainID]
|
||||
func (service *Service) ValidatedBy(_ *http.Request, args *ValidatedByArgs, response *ValidatedByResponse) error {
|
||||
service.vm.Ctx.Log.Debug("validatedBy called")
|
||||
service.vm.Ctx.Log.Info("Platform: ValidatedBy called")
|
||||
|
||||
switch {
|
||||
case args.BlockchainID == "":
|
||||
|
@ -1522,7 +1522,7 @@ type ValidatesResponse struct {
|
|||
|
||||
// Validates returns the IDs of the blockchains validated by [args.SubnetID]
|
||||
func (service *Service) Validates(_ *http.Request, args *ValidatesArgs, response *ValidatesResponse) error {
|
||||
service.vm.Ctx.Log.Debug("validates called")
|
||||
service.vm.Ctx.Log.Info("Platform: Validates called")
|
||||
|
||||
switch {
|
||||
case args.SubnetID == "":
|
||||
|
@ -1576,7 +1576,7 @@ type GetBlockchainsResponse struct {
|
|||
|
||||
// GetBlockchains returns all of the blockchains that exist
|
||||
func (service *Service) GetBlockchains(_ *http.Request, args *struct{}, response *GetBlockchainsResponse) error {
|
||||
service.vm.Ctx.Log.Debug("getBlockchains called")
|
||||
service.vm.Ctx.Log.Info("Platform: GetBlockchains called")
|
||||
|
||||
chains, err := service.vm.getChains(service.vm.DB)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue