erigon-pulse/cmd/devnet/requests/admin.go
ledgerwatch c408281d3b
[devnet] separate logging (#7556)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-20 21:57:32 +01:00

21 lines
528 B
Go

package requests
import (
"fmt"
"github.com/ledgerwatch/erigon/cmd/devnet/models"
"github.com/ledgerwatch/erigon/p2p"
"github.com/ledgerwatch/log/v3"
)
func AdminNodeInfo(reqId int, logger log.Logger) (p2p.NodeInfo, error) {
reqGen := initialiseRequestGenerator(reqId, logger)
var b models.AdminNodeInfoResponse
if res := reqGen.Erigon(models.AdminNodeInfo, reqGen.GetAdminNodeInfo(), &b); res.Err != nil {
return p2p.NodeInfo{}, fmt.Errorf("failed to get admin node info: %v", res.Err)
}
return b.Result, nil
}