Documentation
¶
Index ¶
- Constants
- type BlockHeader
- type ClientInfo
- type ClientVersion
- type NodeInfo
- type Session
- func (s *Session) BlockByNumber(ctx context.Context, number uint64) (json.RawMessage, error)
- func (s *Session) BlockNumber(ctx context.Context) (uint64, error)
- func (s *Session) Init() error
- func (s *Session) Invoke(ctx context.Context, id, method string, params, result interface{}) error
- func (s *Session) InvokeRequest(ctx context.Context, req *pjrpc.Request, resp *json.RawMessage) error
- func (s *Session) LatestBlock(ctx context.Context) (json.RawMessage, error)
- func (s *Session) Listen() error
- func (s *Session) LoadBlock(number uint64) (*BlockHeader, error)
- func (s *Session) NewHeads() <-chan *json.RawMessage
- func (s *Session) Shutdown() error
- type SubscriptionNotification
Constants ¶
View Source
const (
MethodEthSubscription = "eth_subscription"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockHeader ¶
type BlockHeader struct {
Hash string `json:"hash"`
Number string `json:"number"`
ParentHash string `json:"parentHash"`
Timestamp string `json:"timestamp"`
}
func (*BlockHeader) MustNumberUint64 ¶
func (h *BlockHeader) MustNumberUint64() uint64
func (*BlockHeader) NumberUint64 ¶
func (h *BlockHeader) NumberUint64() (uint64, error)
type ClientInfo ¶
type ClientInfo struct {
NetworkId uint64
ChainId uint64
ClientId string `json:"clientId"`
ClientVersion ClientVersion `json:"clientVersion"`
}
type ClientVersion ¶
type ClientVersion struct {
Name string `json:"name"`
Version string `json:"version"`
OS string `json:"os"`
Language string `json:"language"`
}
func ParseClientVersion ¶
func ParseClientVersion(str string) (ClientVersion, error)
func (ClientVersion) String ¶
func (cv ClientVersion) String() string
type NodeInfo ¶
type NodeInfo struct {
Id string `json:"id"`
Ip string `json:"ip"`
Name string `json:"name"`
Enode string `json:"enode"`
Ports json.RawMessage `json:"ports"`
Protocols json.RawMessage `json:"protocols"`
ListenAddress string `json:"listenAddr"`
}
func (*NodeInfo) ParseClientVersion ¶
func (n *NodeInfo) ParseClientVersion() (ClientVersion, error)
type Session ¶
type Session struct {
ClientInfo *ClientInfo
// contains filtered or unexported fields
}
func (*Session) BlockByNumber ¶
func (*Session) InvokeRequest ¶
func (*Session) LatestBlock ¶
func (*Session) NewHeads ¶
func (s *Session) NewHeads() <-chan *json.RawMessage
type SubscriptionNotification ¶
type SubscriptionNotification struct {
SubscriptionId string `json:"subscription"`
Result json.RawMessage `json:"result"`
}
func (*SubscriptionNotification) UnmarshalResult ¶
func (sn *SubscriptionNotification) UnmarshalResult(result interface{}) error
Click to show internal directories.
Click to hide internal directories.