admin

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package admin implements RPC API bindings for methods in the "admin" namespace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPeer

func AddPeer(url *enode.Node) w3types.RPCCallerFactory[bool]

AddPeer adds the given peer to the node's peer set and returns a bool indicating success.

func AddTrustedPeer

func AddTrustedPeer(url *enode.Node) w3types.RPCCallerFactory[bool]

AddTrustedPeer adds the given peer to the trusted peers list and returns a bool indicating success.

func NodeInfo

NodeInfo returns information about the running node.

func RemovePeer

func RemovePeer(url *enode.Node) w3types.RPCCallerFactory[bool]

RemovePeer disconnects from the given peer if the connection exists and returns a bool indicating success.

func RemoveTrustedPeer

func RemoveTrustedPeer(url *enode.Node) w3types.RPCCallerFactory[bool]

RemoveTrustedPeer removes a remote node from the trusted peers list and returns a bool indicating success.

Types

type NodeInfoResponse

type NodeInfoResponse struct {
	Enode      *enode.Node              `json:"enode"`
	ID         string                   `json:"id"`
	IP         net.IP                   `json:"ip"`
	ListenAddr string                   `json:"listenAddr"`
	Name       string                   `json:"name"`
	Ports      *PortsInfo               `json:"ports"`
	Protocols  map[string]*ProtocolInfo `json:"protocols"`
}

type PortsInfo

type PortsInfo struct {
	Discovery int `json:"discovery"`
	Listener  int `json:"listener"`
}

type ProtocolInfo

type ProtocolInfo struct {
	Difficulty *big.Int    `json:"difficulty"`
	Genesis    common.Hash `json:"genesis"`
	Head       common.Hash `json:"head"`
	Network    int         `json:"network"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL