Documentation ¶
Overview ¶
Package localtxsubmission implements the Ouroboros local-tx-submission protocol
Index ¶
- Constants
- Variables
- func NewMsgFromCbor(msgType uint, data []byte) (protocol.Message, error)
- type Client
- type Config
- type LocalTxSubmission
- type LocalTxSubmissionOptionFunc
- type MsgAcceptTx
- type MsgDone
- type MsgRejectTx
- type MsgSubmitTx
- type MsgSubmitTxTransaction
- type Server
- type SubmitTxFunc
- type TransactionRejectedError
Constants ¶
const ( MessageTypeSubmitTx = 0 MessageTypeAcceptTx = 1 MessageTypeRejectTx = 2 MessageTypeDone = 3 )
Message types
Variables ¶
var StateMap = protocol.StateMap{ // contains filtered or unexported fields }
LocalTxSubmission protocol state machine
Functions ¶
Types ¶
type Client ¶ added in v0.19.0
Client implements the LocalTxSubmission client
func NewClient ¶ added in v0.19.0
func NewClient(protoOptions protocol.ProtocolOptions, cfg *Config) *Client
NewClient returns a new LocalTxSubmission client object
type Config ¶ added in v0.18.0
type Config struct { SubmitTxFunc SubmitTxFunc Timeout time.Duration }
Config is used to configure the LocalTxSubmission protocol instance
func NewConfig ¶ added in v0.25.0
func NewConfig(options ...LocalTxSubmissionOptionFunc) Config
NewConfig returns a new LocalTxSubmission config object with the provided options
type LocalTxSubmission ¶
LocalTxSubmission is a wrapper object that holds the client and server instances
func New ¶
func New(protoOptions protocol.ProtocolOptions, cfg *Config) *LocalTxSubmission
New returns a new LocalTxSubmission object
type LocalTxSubmissionOptionFunc ¶ added in v0.25.0
type LocalTxSubmissionOptionFunc func(*Config)
LocalTxSubmissionOptionFunc represents a function used to modify the LocalTxSubmission protocol config
func WithSubmitTxFunc ¶ added in v0.25.0
func WithSubmitTxFunc(submitTxFunc SubmitTxFunc) LocalTxSubmissionOptionFunc
WithSubmitTxFunc specifies the callback function when a TX is submitted when acting as a server
func WithTimeout ¶ added in v0.25.0
func WithTimeout(timeout time.Duration) LocalTxSubmissionOptionFunc
WithTimeout specifies the timeout for a TX submit operation when acting as a client
type MsgAcceptTx ¶ added in v0.10.0
type MsgAcceptTx struct {
protocol.MessageBase
}
func NewMsgAcceptTx ¶ added in v0.12.1
func NewMsgAcceptTx() *MsgAcceptTx
type MsgDone ¶ added in v0.10.0
type MsgDone struct {
protocol.MessageBase
}
func NewMsgDone ¶ added in v0.10.0
func NewMsgDone() *MsgDone
type MsgRejectTx ¶ added in v0.10.0
type MsgRejectTx struct { protocol.MessageBase // We use RawMessage here because the failure reason can be numerous different // structures, and we'll need to do further processing Reason cbor.RawMessage }
func NewMsgRejectTx ¶ added in v0.12.1
func NewMsgRejectTx(reasonCbor []byte) *MsgRejectTx
type MsgSubmitTx ¶ added in v0.10.0
type MsgSubmitTx struct { protocol.MessageBase Transaction MsgSubmitTxTransaction }
func NewMsgSubmitTx ¶ added in v0.10.0
func NewMsgSubmitTx(eraId uint16, tx []byte) *MsgSubmitTx
type MsgSubmitTxTransaction ¶ added in v0.10.0
type MsgSubmitTxTransaction struct { EraId uint16 Raw cbor.Tag // contains filtered or unexported fields }
type TransactionRejectedError ¶ added in v0.20.0
TransactionRejectedError represents an explicit transaction rejection
func (TransactionRejectedError) Error ¶ added in v0.20.0
func (e TransactionRejectedError) Error() string