Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - Variables
 - func NewMsgFromCbor(msgType uint, data []byte) (protocol.Message, error)
 - type Client
 - type Config
 - type InitFunc
 - type MsgDone
 - type MsgInit
 - type MsgReplyTxIds
 - type MsgReplyTxs
 - type MsgRequestTxIds
 - type MsgRequestTxs
 - type RequestTxIdsFunc
 - type RequestTxsFunc
 - type Server
 - type TxBody
 - type TxId
 - type TxIdAndSize
 - type TxSubmission
 - type TxSubmissionOptionFunc
 
Constants ¶
      View Source
      
  
    const ( MessageTypeRequestTxIds = 0 MessageTypeReplyTxIds = 1 MessageTypeRequestTxs = 2 MessageTypeReplyTxs = 3 MessageTypeDone = 4 MessageTypeInit = 6 )
      View Source
      
  
const ( ProtocolName = "tx-submission" ProtocolId uint16 = 4 )
Variables ¶
      View Source
      
  
var StateMap = protocol.StateMap{ // contains filtered or unexported fields }
Functions ¶
Types ¶
type Config ¶
type Config struct {
	RequestTxIdsFunc RequestTxIdsFunc
	RequestTxsFunc   RequestTxsFunc
	InitFunc         InitFunc
	IdleTimeout      time.Duration
}
    func NewConfig ¶
func NewConfig(options ...TxSubmissionOptionFunc) Config
type MsgDone ¶
type MsgDone struct {
	protocol.MessageBase
}
    func NewMsgDone ¶
func NewMsgDone() *MsgDone
type MsgInit ¶
type MsgInit struct {
	protocol.MessageBase
}
    func NewMsgInit ¶
func NewMsgInit() *MsgInit
type MsgReplyTxIds ¶
type MsgReplyTxIds struct {
	protocol.MessageBase
	TxIds []TxIdAndSize
}
    func NewMsgReplyTxIds ¶
func NewMsgReplyTxIds(txIds []TxIdAndSize) *MsgReplyTxIds
func (*MsgReplyTxIds) MarshalCBOR ¶ added in v0.53.0
func (m *MsgReplyTxIds) MarshalCBOR() ([]byte, error)
type MsgReplyTxs ¶
type MsgReplyTxs struct {
	protocol.MessageBase
	Txs []TxBody
}
    func NewMsgReplyTxs ¶
func NewMsgReplyTxs(txs []TxBody) *MsgReplyTxs
func (*MsgReplyTxs) MarshalCBOR ¶ added in v0.53.0
func (m *MsgReplyTxs) MarshalCBOR() ([]byte, error)
type MsgRequestTxIds ¶
type MsgRequestTxIds struct {
	protocol.MessageBase
	Blocking bool
	Ack      uint16
	Req      uint16
}
    func NewMsgRequestTxIds ¶
func NewMsgRequestTxIds( blocking bool, ack uint16, req uint16, ) *MsgRequestTxIds
type MsgRequestTxs ¶
type MsgRequestTxs struct {
	protocol.MessageBase
	TxIds []TxId
}
    func NewMsgRequestTxs ¶
func NewMsgRequestTxs(txIds []TxId) *MsgRequestTxs
func (*MsgRequestTxs) MarshalCBOR ¶ added in v0.67.1
func (m *MsgRequestTxs) MarshalCBOR() ([]byte, error)
type RequestTxIdsFunc ¶
type RequestTxIdsFunc func(bool, uint16, uint16) ([]TxIdAndSize, error)
Callback function types
type RequestTxsFunc ¶
type Server ¶
func (*Server) RequestTxIds ¶ added in v0.60.0
func (s *Server) RequestTxIds( blocking bool, reqCount int, ) ([]TxIdAndSize, error)
type TxBody ¶
type TxBody struct {
	cbor.StructAsArray
	EraId  uint16
	TxBody []byte
}
    func (*TxBody) MarshalCBOR ¶ added in v0.53.0
type TxIdAndSize ¶
type TxIdAndSize struct {
	cbor.StructAsArray
	TxId TxId
	Size uint32
}
    type TxSubmission ¶
func New ¶
func New(protoOptions protocol.ProtocolOptions, cfg *Config) *TxSubmission
type TxSubmissionOptionFunc ¶
type TxSubmissionOptionFunc func(*Config)
func WithIdleTimeout ¶
func WithIdleTimeout(timeout time.Duration) TxSubmissionOptionFunc
func WithInitFunc ¶
func WithInitFunc(initFunc InitFunc) TxSubmissionOptionFunc
func WithRequestTxIdsFunc ¶
func WithRequestTxIdsFunc( requestTxIdsFunc RequestTxIdsFunc, ) TxSubmissionOptionFunc
func WithRequestTxsFunc ¶
func WithRequestTxsFunc(requestTxsFunc RequestTxsFunc) TxSubmissionOptionFunc
 Click to show internal directories. 
   Click to hide internal directories.