2022-11-22 13:28:53 +00:00
|
|
|
package requests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/models"
|
|
|
|
"github.com/ledgerwatch/erigon/p2p"
|
2023-05-20 20:57:32 +00:00
|
|
|
"github.com/ledgerwatch/log/v3"
|
2022-11-22 13:28:53 +00:00
|
|
|
)
|
|
|
|
|
2023-05-20 20:57:32 +00:00
|
|
|
func AdminNodeInfo(reqId int, logger log.Logger) (p2p.NodeInfo, error) {
|
|
|
|
reqGen := initialiseRequestGenerator(reqId, logger)
|
2022-11-22 13:28:53 +00:00
|
|
|
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
|
|
|
|
}
|