2022-09-30 20:04:34 +00:00
|
|
|
package requests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2022-10-31 02:20:58 +00:00
|
|
|
|
2022-09-30 20:04:34 +00:00
|
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/models"
|
|
|
|
"github.com/ledgerwatch/erigon/p2p"
|
|
|
|
)
|
|
|
|
|
|
|
|
func AdminNodeInfo(reqId int) (p2p.NodeInfo, error) {
|
|
|
|
reqGen := initialiseRequestGenerator(reqId)
|
|
|
|
var b models.AdminNodeInfoResponse
|
|
|
|
|
2022-10-30 12:54:09 +00:00
|
|
|
if res := reqGen.Erigon("admin_nodeInfo", reqGen.GetAdminNodeInfo(), &b); res.Err != nil {
|
2022-09-30 20:04:34 +00:00
|
|
|
return p2p.NodeInfo{}, fmt.Errorf("failed to get admin node info: %v", res.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return b.Result, nil
|
|
|
|
}
|