Documentation
¶
Index ¶
- Constants
- func ArrowVerify(t Arrow) *errors.Error
- func ExpectID(peerID string, hash string, forArrow Arrow) string
- func IsHead(hash string) bool
- func TypeVerify(t Type) *errors.Error
- type Arrow
- type ConsensusPayload
- type Expect
- type ExpectFactory
- func (ef *ExpectFactory) Build(peerID string, hash string, forArrow Arrow, expect int) *Expect
- func (ef *ExpectFactory) GetOrBuild(peerID string, hash string, forArrow Arrow, expect int) (*Expect, bool, *errors.Error)
- func (ef *ExpectFactory) MustGet(peerID string, hash string, forArrow Arrow) (*Expect, *errors.Error)
- func (ef *ExpectFactory) StartGC()
- type ExpectState
- type IListener
- type ITwelveListener
- type ITwelveNode
- type ImmutableTx
- type Job
- type JobDict
- type Letter
- func (l *Letter) GetConsensus() (*ConsensusPayload, *errors.Error)
- func (l *Letter) GetTx() (*kt.Tx, *errors.Error)
- func (l *Letter) Sign(pri ki.PRI) *errors.Error
- func (l *Letter) ToBytes() ([]byte, *errors.Error)
- func (l *Letter) Verify() *errors.Error
- func (l *Letter) WithConsensus(cp *ConsensusPayload) *errors.Error
- func (l *Letter) WithTx(tx *kt.Tx) *errors.Error
- type Line
- type LineFactory
- type Lock
- type MemTwelveListenerBus
- type MemTwelveNode
- type Message
- type Notifier
- type Option
- type Payload
- type Peer
- type Queue
- func (q *Queue) Append(letter *Letter) (*Tx, *errors.Error)
- func (q *Queue) Confirm(hash string) (*ImmutableTx, *errors.Error)
- func (q *Queue) Exists(hash string) (bool, *errors.Error)
- func (q *Queue) ImmutableList(lstHash string, limit pagination.Limit) ([]*ImmutableTx, string, *errors.Error)
- func (q *Queue) ImmutableMustGet(hash string) (*ImmutableTx, *errors.Error)
- func (q *Queue) List(lstHash string, limit pagination.Limit) ([]*Tx, string, *errors.Error)
- func (q *Queue) MustGet(hash string) (*Tx, *errors.Error)
- func (q *Queue) Tail() (*Tx, *errors.Error)
- type ReplyPayload
- type Request
- type RequestPayload
- type Rope
- func (r *Rope) BufExists(hash kt.Hash, callback func(exists bool)) *errors.Error
- func (r *Rope) BufMustGet(hash kt.Hash, callback func(txM *Tx)) *errors.Error
- func (r *Rope) Confirm(hash kt.Hash, callback func(knot *kt.Knot)) *errors.Error
- func (r *Rope) PostTie(letter *Letter, callback func(txM *Tx)) *errors.Error
- func (r *Rope) Tail(callback func(tail *kt.Knot))
- type State
- type SyncDoCheckFunc
- type SyncDoNotifyFunc
- type SyncDoSyncFunc
- type Syncer
- type Twelve
- func (tw *Twelve) ImmutableList(lstHash string, limit pagination.Limit) ([]*ImmutableTx, string, *errors.Error)
- func (tw *Twelve) List(lstHash string, limit pagination.Limit) ([]*Tx, string, *errors.Error)
- func (tw *Twelve) OnCommitted(letter *Letter) *errors.Error
- func (tw *Twelve) OnConfirmed(letter *Letter) *errors.Error
- func (tw *Twelve) OnInvariable(letter *Letter) *errors.Error
- func (tw *Twelve) OnPrepare(letter *Letter) *errors.Error
- func (tw *Twelve) OnRequest(letter *Letter) *errors.Error
- func (tw *Twelve) Start()
- func (tw *Twelve) Tail() (*Tx, *errors.Error)
- type Tx
- type TxCang
- type TxLink
- type TxNode
- type Type
- type Version
Constants ¶
View Source
const ( DefaultExpectVoteCount = 12 DefaultExpectVoteCountRd = 12 DefaultExpectTimeout = 3600 * time.Second )
View Source
const ( LetterType kt.Type = "HOTU.12.LETTER" LetterVersion = kt.DefaultVersion )
View Source
const (
ErrInvalidLetter = "Invalid Letter"
)
View Source
const (
FirstHash = "#"
)
View Source
const (
HeadTxHash = "$"
)
View Source
const (
NotifierMsgBufSize = 102400
)
View Source
const TxCangCount = 100
Variables ¶
This section is empty.
Functions ¶
func ArrowVerify ¶
func TypeVerify ¶
Types ¶
type ConsensusPayload ¶
type Expect ¶
type Expect struct { ID string `json:"id"` Expect uint32 `json:"expect"` // contains filtered or unexported fields }
func (*Expect) SetState ¶
func (e *Expect) SetState(s ExpectState)
type ExpectFactory ¶
type ExpectFactory struct {
// contains filtered or unexported fields
}
func NewExpectFactory ¶
func NewExpectFactory() *ExpectFactory
func (*ExpectFactory) GetOrBuild ¶
func (*ExpectFactory) StartGC ¶
func (ef *ExpectFactory) StartGC()
type ExpectState ¶
type ExpectState int
const ( ExpectInit ExpectState = 0 ExpectWaiting ExpectState = 1 ExpectFinished ExpectState = 2 ExpectTimeout ExpectState = -1 ExpectCanceled ExpectState = -2 )
type ITwelveListener ¶
type ITwelveNode ¶
type JobDict ¶
type JobDict struct {
// contains filtered or unexported fields
}
func NewJobDict ¶
func NewJobDict() *JobDict
type Letter ¶
type Letter struct { Hash kt.Hash `json:"h"` Arrow Arrow `json:"a"` Type kt.Type `json:"t"` Version kt.Version `json:"v"` Chain *kt.Chain `json:"c"` Payload []byte `json:"p"` From nd.ID `json:"f"` Signature *kt.Signature `json:"s"` }
func (*Letter) GetConsensus ¶
func (l *Letter) GetConsensus() (*ConsensusPayload, *errors.Error)
func (*Letter) WithConsensus ¶
func (l *Letter) WithConsensus(cp *ConsensusPayload) *errors.Error
type LineFactory ¶
type LineFactory struct {
// contains filtered or unexported fields
}
func NewLineFactory ¶
func NewLineFactory() *LineFactory
func (*LineFactory) MustGet ¶
func (lf *LineFactory) MustGet(letter *Letter) *Line
type MemTwelveListenerBus ¶
type MemTwelveListenerBus struct {
// contains filtered or unexported fields
}
type MemTwelveNode ¶
type MemTwelveNode struct {
// contains filtered or unexported fields
}
func NewMemTwelveNode ¶
func NewMemTwelveNode(bus *MemTwelveListenerBus, node *nd.Node) *MemTwelveNode
func (*MemTwelveNode) Node ¶
func (m *MemTwelveNode) Node() *nd.Node
func (*MemTwelveNode) Register ¶
func (m *MemTwelveNode) Register(listener ITwelveListener)
type Message ¶
type Message struct { Type Type `json:"t"` Version Version `json:"v"` ID string `json:"i"` Nonce int64 `json:"n"` Timestamp int64 `json:"tp"` Payload []byte `json:"pd"` Signature string `json:"s"` Peer *Peer `json:"pr"` // contains filtered or unexported fields }
func NewMessage ¶
func (*Message) GetReplyPayload ¶
func (msg *Message) GetReplyPayload() (*ReplyPayload, *errors.Error)
func (*Message) GetRequestPayload ¶
func (msg *Message) GetRequestPayload() (*RequestPayload, *errors.Error)
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶
func NewNotifier(node ITwelveNode) *Notifier
func (*Notifier) BindListener ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) ImmutableList ¶
func (q *Queue) ImmutableList(lstHash string, limit pagination.Limit) ([]*ImmutableTx, string, *errors.Error)
func (*Queue) ImmutableMustGet ¶
func (q *Queue) ImmutableMustGet(hash string) (*ImmutableTx, *errors.Error)
type ReplyPayload ¶
type ReplyPayload struct {
ID string `json:"i"` // Request ID
}
func ReplyPayloadOf ¶
func ReplyPayloadOf(byteData []byte) (*ReplyPayload, *errors.Error)
func (*ReplyPayload) Verify ¶
func (p *ReplyPayload) Verify() *errors.Error
type RequestPayload ¶
type RequestPayload struct { Action string `json:"a"` Parameter []byte `json:"p"` // contains filtered or unexported fields }
func RequestPayloadOf ¶
func RequestPayloadOf(byteData []byte) (*RequestPayload, *errors.Error)
func (*RequestPayload) GetHash ¶
func (p *RequestPayload) GetHash() string
func (*RequestPayload) Verify ¶
func (p *RequestPayload) Verify() *errors.Error
type Rope ¶
type Rope struct {
// contains filtered or unexported fields
}
func (*Rope) BufMustGet ¶
type SyncDoCheckFunc ¶
type SyncDoNotifyFunc ¶
type SyncDoSyncFunc ¶
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
func NewSyncer ¶
func NewSyncer( vnID vn.ID, chain kt.Chain, doCheckFunc SyncDoCheckFunc, doSyncFunc SyncDoSyncFunc, doNotifyFunc SyncDoNotifyFunc, ) *Syncer
type Twelve ¶
type Twelve struct {
// contains filtered or unexported fields
}
func (*Twelve) ImmutableList ¶
func (tw *Twelve) ImmutableList(lstHash string, limit pagination.Limit) ([]*ImmutableTx, string, *errors.Error)
type Tx ¶
type Tx struct { Hash kt.Hash `json:"hx"` State State `json:"s"` Chain *kt.Chain `json:"c"` Invariable bid.BID `json:"i"` Timestamp kt.Timestamp `json:"t"` Signer ki.ADR `json:"signer"` Signature []byte `json:"signature"` Pre kt.KID `json:"p"` Height kt.Height `json:"h"` // contains filtered or unexported fields }
func (*Tx) Immutable ¶
func (tx *Tx) Immutable() *ImmutableTx
func (*Tx) ImmutableHash ¶
type TxCang ¶
type TxCang struct {
// contains filtered or unexported fields
}
func (*TxCang) CCollection ¶
func (tc *TxCang) CCollection(hash string) *cang.Collection
CCollection Get Chain Collection
func (*TxCang) QCollection ¶
func (tc *TxCang) QCollection(hash string) *cang.Collection
QCollection Get Queue Collection
Source Files
¶
Click to show internal directories.
Click to hide internal directories.