Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddressFromUrl ¶ added in v0.0.3
Types ¶
type ConsEngine ¶
ConsEngine Consensus engine
func NewConsEngine ¶
func NewConsEngine(from, to string) *ConsEngine
NewConsEngine New a consensus engine
func (*ConsEngine) Add2Engine ¶
func (c *ConsEngine) Add2Engine(msg *nats.Msg) error
Add2Engine Add a message to consensus engine
func (*ConsEngine) ConSequence ¶ added in v0.0.3
func (c *ConsEngine) ConSequence() bool
func (*ConsEngine) GetSequenceFromChain ¶ added in v0.0.3
func (c *ConsEngine) GetSequenceFromChain(from, to, inout string) (int64, error)
在to chain上查询 来自/要去 from chain 的 sequence
func (*ConsEngine) SetSequence ¶
func (c *ConsEngine) SetSequence(from, to string, s int64)
SetSequence 设置交易序列号
func (*ConsEngine) StartEngine ¶
func (c *ConsEngine) StartEngine() error
StartEngine 启动共识引擎尝试处理下一个交易
type ConsensusMap ¶ added in v0.0.3
type ConsensusMap struct {
ConsMap map[int64]map[string]string
// contains filtered or unexported fields
}
func (*ConsensusMap) AddConsToMap ¶ added in v0.0.3
func (c *ConsensusMap) AddConsToMap(sequence int64, hash, nodes string) error
func (*ConsensusMap) GetConsFromMap ¶ added in v0.0.3
func (c *ConsensusMap) GetConsFromMap(sequence int64) (*Consensus, error)
type EngineMap ¶ added in v0.0.3
type Ferry ¶
type Ferry struct {
ConsMap *ConsensusMap
// contains filtered or unexported fields
}
Ferry Comsumer tx message and handle(consensus, broadcast...) it.
func (*Ferry) GetSequenceFromChain ¶ added in v0.0.3
在to chain上查询 来自/要去 from chain 的 sequence
func (*Ferry) SetSequence ¶ added in v0.0.3
SetSequence 设置交易序列号
func (*Ferry) StartFerry ¶ added in v0.0.3
StartEngine 启动共识引擎尝试处理下一个交易
Click to show internal directories.
Click to hide internal directories.