Documentation
¶
Index ¶
Constants ¶
const ( DefaultDurationCnt = 5 * time.Second DefaultStoreCntDuration = 20 * time.Second )
DefaultDurationCnt default timeout
const SEPARATOR = "|"
SEPARATOR separates fromChain from toChain
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AckMergeTxEvent ¶
type AckMergeTxEvent struct {
// contains filtered or unexported fields
}
AckMergeTxEvent for ack merge msg
type AckMergedTxEvent ¶
type AckMergedTxEvent struct {
// contains filtered or unexported fields
}
AckMergedTxEvent for ack merged msg
type BroadcastAckMergeTxEvent ¶
type BroadcastAckMergeTxEvent struct {
// contains filtered or unexported fields
}
BroadcastAckMergeTxEvent for broadcast ack merge msg to local peers
type ChainCacheTable ¶
type ChainCacheTable struct {
// contains filtered or unexported fields
}
ChainCacheTable manage all tables for sub-chain
func NewChainCacheTable ¶
func NewChainCacheTable(table string) *ChainCacheTable
NewChainCacheTable create instance
func SetChainTable ¶
func SetChainTable(table string, callback func(peerTx *PeerTx)) *ChainCacheTable
SetChainTable table == chainID
func (*ChainCacheTable) AddMergeTxs ¶
func (cct *ChainCacheTable) AddMergeTxs(chainID, peerID string, upload *UploadPayload)
AddMergeTxs send peerTx when get the agreement transaction from all sub-peers delete txHash-count from cct.countDot when get the agreement transaction delete the cache item(peerID+txHash) when timeout = duration * DEFAULT_DURATION_CNT
type CountDot ¶
type CountDot struct {
// contains filtered or unexported fields
}
CountDot store the count and flag of transaction
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper manages merge service
func NewHelper ¶
func NewHelper(ledger *ledger.Ledger, bc *blockchain.Blockchain, pmSender pmHandler, mergeConfig *Config) *Helper
NewHelper create instance
func (*Helper) HandleLocalMsg ¶
HandleLocalMsg handle msg from local peers
func (*Helper) HandleNetMsg ¶
HandleNetMsg handle msg from msg_net
func (*Helper) ProcessEvent ¶
ProcessEvent broadcast msg to peers or msg_net
type PeerTx ¶
type PeerTx struct {
// contains filtered or unexported fields
}
PeerTx for where the transaction should be delivered
type TxEvent ¶
type TxEvent struct {
// contains filtered or unexported fields
}
TxEvent for merge txs msg
type TxMerge ¶
type TxMerge struct {
// contains filtered or unexported fields
}
TxMerge merge transactions
type TxParser ¶
type TxParser struct {
// contains filtered or unexported fields
}
TxParser for parse tx
func NewTxParser ¶
func NewTxParser(bc *blockchain.Blockchain) *TxParser
NewTxParser create txParser instance
type UploadPayload ¶
type UploadPayload struct {
PeerNum uint32
MergeDuration uint32
RepeatMergeTxs types.Transactions
MergeTxs types.Transactions
}
UploadPayload data to upload
func NewUploadPayload ¶
func NewUploadPayload(peerNum, mergeDutation uint32, repeatMergeTxs, mergeTxs types.Transactions) *UploadPayload
NewUploadPayload returns a UploadPayload instance
func (*UploadPayload) Deserialize ¶
func (up *UploadPayload) Deserialize(data []byte) error
Deserialize deserializes updatePayload
func (*UploadPayload) Serialize ¶
func (up *UploadPayload) Serialize() []byte
Serialize serializes updatePayload