types

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 12 Imported by: 3,633

Documentation

Index

Constants

View Source
const (
	CodeTypeOK uint32 = 0
)

Variables

This section is empty.

Functions

func MarshalTxResults added in v0.38.0

func MarshalTxResults(r []*ExecTxResult) ([][]byte, error)

MarshalTxResults encodes the TxResults as a list of byte slices. It strips off the non-deterministic pieces of the TxResults so that the resulting data can be used for hash comparisons and used in Merkle proofs.

func ReadMessage

func ReadMessage(r io.Reader, msg proto.Message) error

ReadMessage reads a varint length-delimited protobuf message.

func RegisterABCIServer added in v0.38.0

func RegisterABCIServer(s grpc.Server, srv ABCIServiceServer)

func WriteMessage

func WriteMessage(msg proto.Message, w io.Writer) error

WriteMessage writes a varint length-delimited protobuf message.

Types

type ABCIServiceClient added in v1.0.0

type ABCIServiceClient = v1.ABCIServiceClient

func NewABCIClient added in v0.38.0

func NewABCIClient(cc grpc.ClientConn) ABCIServiceClient

type ABCIServiceServer added in v1.0.0

type ABCIServiceServer = v1.ABCIServiceServer

type Application

type Application interface {
	// Info/Query Connection
	Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error)    // Return application info
	Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error) // Query for state

	// Mempool Connection
	CheckTx(ctx context.Context, req *CheckTxRequest) (*CheckTxResponse, error) // Validate a tx for the mempool

	// Consensus Connection
	InitChain(ctx context.Context, req *InitChainRequest) (*InitChainResponse, error) // Initialize blockchain w validators/other info from CometBFT
	PrepareProposal(ctx context.Context, req *PrepareProposalRequest) (*PrepareProposalResponse, error)
	ProcessProposal(ctx context.Context, req *ProcessProposalRequest) (*ProcessProposalResponse, error)
	// Deliver the decided block with its txs to the Application
	FinalizeBlock(ctx context.Context, req *FinalizeBlockRequest) (*FinalizeBlockResponse, error)
	// Create application specific vote extension
	ExtendVote(ctx context.Context, req *ExtendVoteRequest) (*ExtendVoteResponse, error)
	// Verify application's vote extension data
	VerifyVoteExtension(ctx context.Context, req *VerifyVoteExtensionRequest) (*VerifyVoteExtensionResponse, error)
	// Commit the state and return the application Merkle root hash
	Commit(ctx context.Context, req *CommitRequest) (*CommitResponse, error)

	// State Sync Connection
	ListSnapshots(ctx context.Context, req *ListSnapshotsRequest) (*ListSnapshotsResponse, error)                // List available snapshots
	OfferSnapshot(ctx context.Context, req *OfferSnapshotRequest) (*OfferSnapshotResponse, error)                // Offer a snapshot to the application
	LoadSnapshotChunk(ctx context.Context, req *LoadSnapshotChunkRequest) (*LoadSnapshotChunkResponse, error)    // Load a snapshot chunk
	ApplySnapshotChunk(ctx context.Context, req *ApplySnapshotChunkRequest) (*ApplySnapshotChunkResponse, error) // Apply a snapshot chunk
}

Application is an interface that enables any finite, deterministic state machine to be driven by a blockchain-based replication engine via the ABCI.

type ApplySnapshotChunkRequest added in v1.0.0

type ApplySnapshotChunkRequest = v1.ApplySnapshotChunkRequest

type ApplySnapshotChunkResponse added in v1.0.0

type ApplySnapshotChunkResponse = v1.ApplySnapshotChunkResponse

type ApplySnapshotChunkResult added in v1.0.0

type ApplySnapshotChunkResult = v1.ApplySnapshotChunkResult
const (
	APPLY_SNAPSHOT_CHUNK_RESULT_UNKNOWN         ApplySnapshotChunkResult = v1.APPLY_SNAPSHOT_CHUNK_RESULT_UNKNOWN
	APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT          ApplySnapshotChunkResult = v1.APPLY_SNAPSHOT_CHUNK_RESULT_ACCEPT
	APPLY_SNAPSHOT_CHUNK_RESULT_ABORT           ApplySnapshotChunkResult = v1.APPLY_SNAPSHOT_CHUNK_RESULT_ABORT
	APPLY_SNAPSHOT_CHUNK_RESULT_RETRY           ApplySnapshotChunkResult = v1.APPLY_SNAPSHOT_CHUNK_RESULT_RETRY
	APPLY_SNAPSHOT_CHUNK_RESULT_RETRY_SNAPSHOT  ApplySnapshotChunkResult = v1.APPLY_SNAPSHOT_CHUNK_RESULT_RETRY_SNAPSHOT
	APPLY_SNAPSHOT_CHUNK_RESULT_REJECT_SNAPSHOT ApplySnapshotChunkResult = v1.APPLY_SNAPSHOT_CHUNK_RESULT_REJECT_SNAPSHOT
)

type BaseApplication

type BaseApplication struct{}

func NewBaseApplication

func NewBaseApplication() *BaseApplication

func (BaseApplication) CheckTx

func (BaseApplication) Commit

func (BaseApplication) ExtendVote added in v0.38.0

func (BaseApplication) FinalizeBlock added in v0.38.0

func (BaseApplication) Info

func (BaseApplication) InitChain

func (BaseApplication) ListSnapshots

func (BaseApplication) OfferSnapshot

func (BaseApplication) PrepareProposal

func (BaseApplication) Query

func (BaseApplication) VerifyVoteExtension added in v0.38.0

type CheckTxRequest added in v1.0.0

type CheckTxRequest = v1.CheckTxRequest

type CheckTxResponse added in v1.0.0

type CheckTxResponse = v1.CheckTxResponse

type CheckTxType

type CheckTxType = v1.CheckTxType
const (
	CHECK_TX_TYPE_UNKNOWN CheckTxType = v1.CHECK_TX_TYPE_UNKNOWN
	CHECK_TX_TYPE_CHECK   CheckTxType = v1.CHECK_TX_TYPE_CHECK
	CHECK_TX_TYPE_RECHECK CheckTxType = v1.CHECK_TX_TYPE_RECHECK
)

type CommitInfo

type CommitInfo = v1.CommitInfo

type CommitRequest added in v1.0.0

type CommitRequest = v1.CommitRequest

type CommitResponse added in v1.0.0

type CommitResponse = v1.CommitResponse

type EchoRequest added in v1.0.0

type EchoRequest = v1.EchoRequest

type EchoResponse added in v1.0.0

type EchoResponse = v1.EchoResponse

type Event

type Event = v1.Event

type EventAttribute

type EventAttribute = v1.EventAttribute

type ExceptionResponse added in v1.0.0

type ExceptionResponse = v1.ExceptionResponse

type ExecTxResult added in v0.38.0

type ExecTxResult = v1.ExecTxResult

func DeterministicExecTxResult added in v1.0.0

func DeterministicExecTxResult(response *ExecTxResult) *ExecTxResult

constructs a copy of response that omits non-deterministic fields. The input response is not modified.

type ExtendVoteRequest added in v1.0.0

type ExtendVoteRequest = v1.ExtendVoteRequest

type ExtendVoteResponse added in v1.0.0

type ExtendVoteResponse = v1.ExtendVoteResponse

type ExtendedCommitInfo

type ExtendedCommitInfo = v1.ExtendedCommitInfo

type ExtendedVoteInfo

type ExtendedVoteInfo = v1.ExtendedVoteInfo

type FinalizeBlockRequest added in v1.0.0

type FinalizeBlockRequest = v1.FinalizeBlockRequest

type FinalizeBlockResponse added in v1.0.0

type FinalizeBlockResponse = v1.FinalizeBlockResponse

type FlushRequest added in v1.0.0

type FlushRequest = v1.FlushRequest

type FlushResponse added in v1.0.0

type FlushResponse = v1.FlushResponse

type InfoRequest added in v1.0.0

type InfoRequest = v1.InfoRequest

type InfoResponse added in v1.0.0

type InfoResponse = v1.InfoResponse

type InitChainRequest added in v1.0.0

type InitChainRequest = v1.InitChainRequest

type InitChainResponse added in v1.0.0

type InitChainResponse = v1.InitChainResponse

type ListSnapshotsRequest added in v1.0.0

type ListSnapshotsRequest = v1.ListSnapshotsRequest

type ListSnapshotsResponse added in v1.0.0

type ListSnapshotsResponse = v1.ListSnapshotsResponse

type LoadSnapshotChunkRequest added in v1.0.0

type LoadSnapshotChunkRequest = v1.LoadSnapshotChunkRequest

type LoadSnapshotChunkResponse added in v1.0.0

type LoadSnapshotChunkResponse = v1.LoadSnapshotChunkResponse

type Misbehavior

type Misbehavior = v1.Misbehavior

type MisbehaviorType

type MisbehaviorType = v1.MisbehaviorType
const (
	MISBEHAVIOR_TYPE_UNKNOWN             MisbehaviorType = v1.MISBEHAVIOR_TYPE_UNKNOWN
	MISBEHAVIOR_TYPE_DUPLICATE_VOTE      MisbehaviorType = v1.MISBEHAVIOR_TYPE_DUPLICATE_VOTE
	MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK MisbehaviorType = v1.MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK
)

type OfferSnapshotRequest added in v1.0.0

type OfferSnapshotRequest = v1.OfferSnapshotRequest

type OfferSnapshotResponse added in v1.0.0

type OfferSnapshotResponse = v1.OfferSnapshotResponse

type OfferSnapshotResult added in v1.0.0

type OfferSnapshotResult = v1.OfferSnapshotResult
const (
	OFFER_SNAPSHOT_RESULT_UNKNOWN       OfferSnapshotResult = v1.OFFER_SNAPSHOT_RESULT_UNKNOWN
	OFFER_SNAPSHOT_RESULT_ACCEPT        OfferSnapshotResult = v1.OFFER_SNAPSHOT_RESULT_ACCEPT
	OFFER_SNAPSHOT_RESULT_ABORT         OfferSnapshotResult = v1.OFFER_SNAPSHOT_RESULT_ABORT
	OFFER_SNAPSHOT_RESULT_REJECT        OfferSnapshotResult = v1.OFFER_SNAPSHOT_RESULT_REJECT
	OFFER_SNAPSHOT_RESULT_REJECT_FORMAT OfferSnapshotResult = v1.OFFER_SNAPSHOT_RESULT_REJECT_FORMAT
	OFFER_SNAPSHOT_RESULT_REJECT_SENDER OfferSnapshotResult = v1.OFFER_SNAPSHOT_RESULT_REJECT_SENDER
)

type PrepareProposalRequest added in v1.0.0

type PrepareProposalRequest = v1.PrepareProposalRequest

type PrepareProposalResponse added in v1.0.0

type PrepareProposalResponse = v1.PrepareProposalResponse

type ProcessProposalRequest added in v1.0.0

type ProcessProposalRequest = v1.ProcessProposalRequest

type ProcessProposalResponse added in v1.0.0

type ProcessProposalResponse = v1.ProcessProposalResponse

type ProcessProposalStatus added in v1.0.0

type ProcessProposalStatus = v1.ProcessProposalStatus
const (
	PROCESS_PROPOSAL_STATUS_UNKNOWN ProcessProposalStatus = v1.PROCESS_PROPOSAL_STATUS_UNKNOWN
	PROCESS_PROPOSAL_STATUS_ACCEPT  ProcessProposalStatus = v1.PROCESS_PROPOSAL_STATUS_ACCEPT
	PROCESS_PROPOSAL_STATUS_REJECT  ProcessProposalStatus = v1.PROCESS_PROPOSAL_STATUS_REJECT
)

type QueryRequest added in v1.0.0

type QueryRequest = v1.QueryRequest

type QueryResponse added in v1.0.0

type QueryResponse = v1.QueryResponse

type Request

type Request = v1.Request

func ToApplySnapshotChunkRequest added in v1.0.0

func ToApplySnapshotChunkRequest(req *ApplySnapshotChunkRequest) *Request

func ToCheckTxRequest added in v1.0.0

func ToCheckTxRequest(req *CheckTxRequest) *Request

func ToCommitRequest added in v1.0.0

func ToCommitRequest() *Request

func ToEchoRequest added in v1.0.0

func ToEchoRequest(message string) *Request

func ToExtendVoteRequest added in v1.0.0

func ToExtendVoteRequest(req *ExtendVoteRequest) *Request

func ToFinalizeBlockRequest added in v1.0.0

func ToFinalizeBlockRequest(req *FinalizeBlockRequest) *Request

func ToFlushRequest added in v1.0.0

func ToFlushRequest() *Request

func ToInfoRequest added in v1.0.0

func ToInfoRequest(req *InfoRequest) *Request

func ToInitChainRequest added in v1.0.0

func ToInitChainRequest(req *InitChainRequest) *Request

func ToListSnapshotsRequest added in v1.0.0

func ToListSnapshotsRequest(req *ListSnapshotsRequest) *Request

func ToLoadSnapshotChunkRequest added in v1.0.0

func ToLoadSnapshotChunkRequest(req *LoadSnapshotChunkRequest) *Request

func ToOfferSnapshotRequest added in v1.0.0

func ToOfferSnapshotRequest(req *OfferSnapshotRequest) *Request

func ToPrepareProposalRequest added in v1.0.0

func ToPrepareProposalRequest(req *PrepareProposalRequest) *Request

func ToProcessProposalRequest added in v1.0.0

func ToProcessProposalRequest(req *ProcessProposalRequest) *Request

func ToQueryRequest added in v1.0.0

func ToQueryRequest(req *QueryRequest) *Request

func ToVerifyVoteExtensionRequest added in v1.0.0

func ToVerifyVoteExtensionRequest(req *VerifyVoteExtensionRequest) *Request

type Request_ApplySnapshotChunk

type Request_ApplySnapshotChunk = v1.Request_ApplySnapshotChunk

Discriminated Request variants are defined in the latest proto package.

type Request_CheckTx

type Request_CheckTx = v1.Request_CheckTx

Discriminated Request variants are defined in the latest proto package.

type Request_Commit

type Request_Commit = v1.Request_Commit

Discriminated Request variants are defined in the latest proto package.

type Request_Echo

type Request_Echo = v1.Request_Echo

Discriminated Request variants are defined in the latest proto package.

type Request_ExtendVote added in v0.38.0

type Request_ExtendVote = v1.Request_ExtendVote

Discriminated Request variants are defined in the latest proto package.

type Request_FinalizeBlock added in v0.38.0

type Request_FinalizeBlock = v1.Request_FinalizeBlock

Discriminated Request variants are defined in the latest proto package.

type Request_Flush

type Request_Flush = v1.Request_Flush

Discriminated Request variants are defined in the latest proto package.

type Request_Info

type Request_Info = v1.Request_Info

Discriminated Request variants are defined in the latest proto package.

type Request_InitChain

type Request_InitChain = v1.Request_InitChain

Discriminated Request variants are defined in the latest proto package.

type Request_ListSnapshots

type Request_ListSnapshots = v1.Request_ListSnapshots

Discriminated Request variants are defined in the latest proto package.

type Request_LoadSnapshotChunk

type Request_LoadSnapshotChunk = v1.Request_LoadSnapshotChunk

Discriminated Request variants are defined in the latest proto package.

type Request_OfferSnapshot

type Request_OfferSnapshot = v1.Request_OfferSnapshot

Discriminated Request variants are defined in the latest proto package.

type Request_PrepareProposal

type Request_PrepareProposal = v1.Request_PrepareProposal

Discriminated Request variants are defined in the latest proto package.

type Request_ProcessProposal

type Request_ProcessProposal = v1.Request_ProcessProposal

Discriminated Request variants are defined in the latest proto package.

type Request_Query

type Request_Query = v1.Request_Query

Discriminated Request variants are defined in the latest proto package.

type Request_VerifyVoteExtension added in v0.38.0

type Request_VerifyVoteExtension = v1.Request_VerifyVoteExtension

Discriminated Request variants are defined in the latest proto package.

type Response

type Response = v1.Response

func ToApplySnapshotChunkResponse added in v1.0.0

func ToApplySnapshotChunkResponse(res *ApplySnapshotChunkResponse) *Response

func ToCheckTxResponse added in v1.0.0

func ToCheckTxResponse(res *CheckTxResponse) *Response

func ToCommitResponse added in v1.0.0

func ToCommitResponse(res *CommitResponse) *Response

func ToEchoResponse added in v1.0.0

func ToEchoResponse(message string) *Response

func ToExceptionResponse added in v1.0.0

func ToExceptionResponse(errStr string) *Response

func ToExtendVoteResponse added in v1.0.0

func ToExtendVoteResponse(res *ExtendVoteResponse) *Response

func ToFinalizeBlockResponse added in v1.0.0

func ToFinalizeBlockResponse(res *FinalizeBlockResponse) *Response

func ToFlushResponse added in v1.0.0

func ToFlushResponse() *Response

func ToInfoResponse added in v1.0.0

func ToInfoResponse(res *InfoResponse) *Response

func ToInitChainResponse added in v1.0.0

func ToInitChainResponse(res *InitChainResponse) *Response

func ToListSnapshotsResponse added in v1.0.0

func ToListSnapshotsResponse(res *ListSnapshotsResponse) *Response

func ToLoadSnapshotChunkResponse added in v1.0.0

func ToLoadSnapshotChunkResponse(res *LoadSnapshotChunkResponse) *Response

func ToOfferSnapshotResponse added in v1.0.0

func ToOfferSnapshotResponse(res *OfferSnapshotResponse) *Response

func ToPrepareProposalResponse added in v1.0.0

func ToPrepareProposalResponse(res *PrepareProposalResponse) *Response

func ToProcessProposalResponse added in v1.0.0

func ToProcessProposalResponse(res *ProcessProposalResponse) *Response

func ToQueryResponse added in v1.0.0

func ToQueryResponse(res *QueryResponse) *Response

func ToVerifyVoteExtensionResponse added in v1.0.0

func ToVerifyVoteExtensionResponse(res *VerifyVoteExtensionResponse) *Response

type Response_ApplySnapshotChunk

type Response_ApplySnapshotChunk = v1.Response_ApplySnapshotChunk

Discriminated Response variants are defined in the latest proto package.

type Response_CheckTx

type Response_CheckTx = v1.Response_CheckTx

Discriminated Response variants are defined in the latest proto package.

type Response_Commit

type Response_Commit = v1.Response_Commit

Discriminated Response variants are defined in the latest proto package.

type Response_Echo

type Response_Echo = v1.Response_Echo

Discriminated Response variants are defined in the latest proto package.

type Response_Exception

type Response_Exception = v1.Response_Exception

Discriminated Response variants are defined in the latest proto package.

type Response_ExtendVote added in v0.38.0

type Response_ExtendVote = v1.Response_ExtendVote

Discriminated Response variants are defined in the latest proto package.

type Response_FinalizeBlock added in v0.38.0

type Response_FinalizeBlock = v1.Response_FinalizeBlock

Discriminated Response variants are defined in the latest proto package.

type Response_Flush

type Response_Flush = v1.Response_Flush

Discriminated Response variants are defined in the latest proto package.

type Response_Info

type Response_Info = v1.Response_Info

Discriminated Response variants are defined in the latest proto package.

type Response_InitChain

type Response_InitChain = v1.Response_InitChain

Discriminated Response variants are defined in the latest proto package.

type Response_ListSnapshots

type Response_ListSnapshots = v1.Response_ListSnapshots

Discriminated Response variants are defined in the latest proto package.

type Response_LoadSnapshotChunk

type Response_LoadSnapshotChunk = v1.Response_LoadSnapshotChunk

Discriminated Response variants are defined in the latest proto package.

type Response_OfferSnapshot

type Response_OfferSnapshot = v1.Response_OfferSnapshot

Discriminated Response variants are defined in the latest proto package.

type Response_PrepareProposal

type Response_PrepareProposal = v1.Response_PrepareProposal

Discriminated Response variants are defined in the latest proto package.

type Response_ProcessProposal

type Response_ProcessProposal = v1.Response_ProcessProposal

Discriminated Response variants are defined in the latest proto package.

type Response_Query

type Response_Query = v1.Response_Query

Discriminated Response variants are defined in the latest proto package.

type Response_VerifyVoteExtension added in v0.38.0

type Response_VerifyVoteExtension = v1.Response_VerifyVoteExtension

Discriminated Response variants are defined in the latest proto package.

type Snapshot

type Snapshot = v1.Snapshot

type TxResult

type TxResult = v1.TxResult

type Validator

type Validator = v1.Validator

type ValidatorUpdate

type ValidatorUpdate = v1.ValidatorUpdate

func NewValidatorUpdate added in v1.0.0

func NewValidatorUpdate(pubKey crypto.PubKey, power int64) ValidatorUpdate

NewValidatorUpdate creates a new ValidatorUpdate from the given public key.

type ValidatorUpdates

type ValidatorUpdates []ValidatorUpdate

ValidatorUpdates is a list of validators that implements the Sort interface.

func (ValidatorUpdates) Len

func (v ValidatorUpdates) Len() int

func (ValidatorUpdates) Less

func (v ValidatorUpdates) Less(i, j int) bool

XXX: doesn't distinguish same validator with different power.

func (ValidatorUpdates) Swap

func (v ValidatorUpdates) Swap(i, j int)

type VerifyVoteExtensionRequest added in v1.0.0

type VerifyVoteExtensionRequest = v1.VerifyVoteExtensionRequest

type VerifyVoteExtensionResponse added in v1.0.0

type VerifyVoteExtensionResponse = v1.VerifyVoteExtensionResponse

type VerifyVoteExtensionStatus added in v1.0.0

type VerifyVoteExtensionStatus = v1.VerifyVoteExtensionStatus
const (
	VERIFY_VOTE_EXTENSION_STATUS_UNKNOWN VerifyVoteExtensionStatus = v1.VERIFY_VOTE_EXTENSION_STATUS_UNKNOWN
	VERIFY_VOTE_EXTENSION_STATUS_ACCEPT  VerifyVoteExtensionStatus = v1.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT
	VERIFY_VOTE_EXTENSION_STATUS_REJECT  VerifyVoteExtensionStatus = v1.VERIFY_VOTE_EXTENSION_STATUS_REJECT
)

type VoteInfo

type VoteInfo = v1.VoteInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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