gprc

package
v0.0.0-...-535af14 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockHeightFromOutgoingContext

func BlockHeightFromOutgoingContext(ctx context.Context) (int64, bool)

func NewResponseFormatBroadcastTxCommit

func NewResponseFormatBroadcastTxCommit(res *BroadcastTxCommitResult) *sdk.TxResponse

copied from sdk

Types

type ABCIQueryRequest

type ABCIQueryRequest struct {
	Path   string         `json:"path"`
	Data   bytes.HexBytes `json:"data"`
	Height int64          `json:"height,string"`
	Prove  bool           `json:"prove"`
}

type ABCIQueryResponse

type ABCIQueryResponse struct {
	Code   uint32 `json:"code"`
	Log    string `json:"log"`
	Key    []byte `json:"key"`
	Value  []byte `json:"value"`
	Height int64  `json:"height,string"`
}

func (ABCIQueryResponse) IsOK

func (resp ABCIQueryResponse) IsOK() bool

type ABCIQueryResult

type ABCIQueryResult struct {
	Response ABCIQueryResponse `json:"response"`
}

type Block

type Block struct {
	BlockHeader `json:"header"`
}

type BlockHeader

type BlockHeader struct {
	ChainID string    `json:"chain_id"`
	Height  int64     `json:"height,string"`
	Time    time.Time `json:"time"`
}

type BlockRequest

type BlockRequest struct {
	Height *int64 `json:"height,string,omitempty"`
}

type BlockResult

type BlockResult struct {
	Block *Block `json:"block"`
}

type BlockResultsRequest

type BlockResultsRequest struct {
	Height *int64 `json:"height,string,omitempty"`
}

type BlockResultsResult

type BlockResultsResult struct {
	Height           int64               `json:"height,string"`
	TxsResults       []ResponseDeliverTx `json:"txs_results"`
	BeginBlockEvents []abcitypes.Event   `json:"begin_block_events"`
	EndBlockEvents   []abcitypes.Event   `json:"end_block_events"`
}

type BroadcastTxCommitRequest

type BroadcastTxCommitRequest struct {
	Tx []byte `json:"tx"`
}

type BroadcastTxCommitResult

type BroadcastTxCommitResult struct {
	CheckTx   ResponseCheckTx   `json:"check_tx"`
	DeliverTx ResponseDeliverTx `json:"deliver_tx"`
	Hash      bytes.HexBytes    `json:"hash"`
	Height    int64             `json:"height,string"`
}

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

Connection represents a custom gRPC connection implementation that relies on a RPC connection instead of a gRPC connection

func MustCreateConnection

func MustCreateConnection(rpcAddress string, cdc codec.Codec) *Connection

MustCreateConnection returns a new Connection instance, or panics if any error arises

func NewConnection

func NewConnection(rpcAddress string, cdc codec.Codec) (*Connection, error)

NewConnection a new Connection instance

func (*Connection) Invoke

func (c *Connection) Invoke(ctx context.Context, method string, args, reply any, _ ...grpc.CallOption) error

Invoke implements the grpc.ClientConnInterface interface

func (*Connection) NewStream

NewStream implements the grpc.ClientConnInterface interface

func (*Connection) RunABCIQuery

func (c *Connection) RunABCIQuery(ctx context.Context, path string, data []byte, height int64) (*ABCIQueryResult, error)

RunABCIQuery runs a new query through the ABCI protocol

type NodeInfo

type NodeInfo struct {
	Network string `json:"network"`
}

type ResponseCheckTx

type ResponseCheckTx struct {
	Code      uint32            `json:"code"`
	Data      []byte            `json:"data"`
	Log       string            `json:"log"`
	GasWanted int64             `json:"gas_wanted,string"`
	GasUsed   int64             `json:"gas_used,string"`
	Events    []abcitypes.Event `json:"events"`
}

func (ResponseCheckTx) IsOK

func (resp ResponseCheckTx) IsOK() bool

type ResponseDeliverTx

type ResponseDeliverTx struct {
	Code      uint32            `json:"code"`
	Data      []byte            `json:"data"`
	Log       string            `json:"log"`
	GasWanted int64             `json:"gas_wanted,string"`
	GasUsed   int64             `json:"gas_used,string"`
	Events    []abcitypes.Event `json:"events"`
}

func (ResponseDeliverTx) IsOK

func (resp ResponseDeliverTx) IsOK() bool

type StatusRequest

type StatusRequest struct{}

type StatusResult

type StatusResult struct {
	NodeInfo *NodeInfo `json:"node_info"`
	SyncInfo *SyncInfo `json:"sync_info"`
}

type SyncInfo

type SyncInfo struct {
	LatestBlockHeight int64     `json:"latest_block_height,string"`
	LatestBlockTime   time.Time `json:"latest_block_time"`
}

Jump to

Keyboard shortcuts

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