Documentation ¶
Index ¶
- Constants
- Variables
- func DumpNetwork() map[string]func() map[string]*pb.PeerTxState
- func DumpTxNetwork() map[string]func() map[string]uint64
- func GetPrecededTx(digest []byte, tx *pb.Transaction) *pb.Transaction
- func GetTxDigest(tx *pb.Transaction) []byte
- func PeerTxQueueLen() int
- func PeerTxQueueLimit() int
- func PeerTxQueueSoftLimit() int
- func SetPeerTxQueueLen(bits uint)
- func ToStringId(id []byte) string
- func UpdateLocalHotTx(stub *gossip.GossipStub, txs *pb.HotTransactionBlock) error
- type PendingTransaction
- type TxCache
- type TxNetworkEntry
- func (e TxNetworkEntry) BroadCastTransaction(tx *pb.Transaction, endorser cred.TxEndorser) error
- func (e *TxNetworkEntry) DumpStatus() (s *pb.PeerTxState, p int)
- func (e TxNetworkEntry) ExecuteTransaction(ctx context.Context, tx *pb.Transaction, endorser cred.TxEndorser) *pb.Response
- func (e *TxNetworkEntry) GetPeerStatus() (*pb.PeerTxState, string)
- func (e *TxNetworkEntry) GetTxStatus(id string) (uint64, []byte)
- func (e *TxNetworkEntry) InitCred(v cred.TxHandlerFactory)
- func (e *TxNetworkEntry) InitLedger(l *ledger.Ledger)
- func (e *TxNetworkEntry) InitTerminal(t pb.TxPreHandler)
- func (e *TxNetworkEntry) PauseTxNetwork(dopause bool)
- func (e *TxNetworkEntry) ResetPeer(endorser cred.TxEndorserFactory) error
- func (e *TxNetworkEntry) ResetPeerSimple(id []byte) error
- func (e TxNetworkEntry) Start(ctx context.Context, h TxNetworkHandler)
- func (e *TxNetworkEntry) UpdateLocalHotTx(txs *pb.HotTransactionBlock) error
- func (e *TxNetworkEntry) UpdateLocalPeer(s *pb.PeerTxState) error
- type TxNetworkHandler
Constants ¶
View Source
const (
EndorseVerLimit = 128
)
View Source
const (
TxDigestVerifyLen = 16
)
Variables ¶
View Source
var DefaultInitPeer struct { Id string State *pb.PeerTxState }
if this is set, network will be created with default peer status, which is useful in testing and some other purpose (i.e. create a simple instance)
View Source
var SelfIDNotChange = fmt.Errorf("Try to change to an id current used")
Functions ¶
func DumpNetwork ¶
func DumpNetwork() map[string]func() map[string]*pb.PeerTxState
func DumpTxNetwork ¶
func GetPrecededTx ¶
func GetPrecededTx(digest []byte, tx *pb.Transaction) *pb.Transaction
func GetTxDigest ¶
func GetTxDigest(tx *pb.Transaction) []byte
func PeerTxQueueLen ¶
func PeerTxQueueLen() int
func PeerTxQueueLimit ¶
func PeerTxQueueLimit() int
func PeerTxQueueSoftLimit ¶
func PeerTxQueueSoftLimit() int
func SetPeerTxQueueLen ¶
func SetPeerTxQueueLen(bits uint)
func ToStringId ¶
func UpdateLocalHotTx ¶
func UpdateLocalHotTx(stub *gossip.GossipStub, txs *pb.HotTransactionBlock) error
Types ¶
type PendingTransaction ¶
type PendingTransaction struct { *pb.Transaction // contains filtered or unexported fields }
func (*PendingTransaction) GetEndorser ¶
func (t *PendingTransaction) GetEndorser() cred.TxEndorser
func (*PendingTransaction) Respond ¶
func (t *PendingTransaction) Respond(resp *pb.Response)
type TxCache ¶
type TxCache interface { GetCommit(series uint64, tx *pb.Transaction) uint32 AddTxs(from uint64, txs []*pb.Transaction) error Pruning(from uint64, to uint64) }
type TxNetworkEntry ¶
type TxNetworkEntry struct {
// contains filtered or unexported fields
}
func GetNetworkEntry ¶
func GetNetworkEntry(stub *gossip.GossipStub) *TxNetworkEntry
func (TxNetworkEntry) BroadCastTransaction ¶
func (e TxNetworkEntry) BroadCastTransaction(tx *pb.Transaction, endorser cred.TxEndorser) error
func (*TxNetworkEntry) DumpStatus ¶
func (e *TxNetworkEntry) DumpStatus() (s *pb.PeerTxState, p int)
func (TxNetworkEntry) ExecuteTransaction ¶
func (e TxNetworkEntry) ExecuteTransaction(ctx context.Context, tx *pb.Transaction, endorser cred.TxEndorser) *pb.Response
func (*TxNetworkEntry) GetPeerStatus ¶
func (e *TxNetworkEntry) GetPeerStatus() (*pb.PeerTxState, string)
func (*TxNetworkEntry) GetTxStatus ¶
func (e *TxNetworkEntry) GetTxStatus(id string) (uint64, []byte)
func (*TxNetworkEntry) InitCred ¶
func (e *TxNetworkEntry) InitCred(v cred.TxHandlerFactory)
[optional] set the credential for peer in txnetwork
func (*TxNetworkEntry) InitLedger ¶
func (e *TxNetworkEntry) InitLedger(l *ledger.Ledger)
Init method can be only executed before gossip network is running, to override the default settings
func (*TxNetworkEntry) InitTerminal ¶
func (e *TxNetworkEntry) InitTerminal(t pb.TxPreHandler)
set the output for tx received in txnetwork
func (*TxNetworkEntry) PauseTxNetwork ¶
func (e *TxNetworkEntry) PauseTxNetwork(dopause bool)
func (*TxNetworkEntry) ResetPeer ¶
func (e *TxNetworkEntry) ResetPeer(endorser cred.TxEndorserFactory) error
func (*TxNetworkEntry) ResetPeerSimple ¶
func (e *TxNetworkEntry) ResetPeerSimple(id []byte) error
func (TxNetworkEntry) Start ¶
func (e TxNetworkEntry) Start(ctx context.Context, h TxNetworkHandler)
func (*TxNetworkEntry) UpdateLocalHotTx ¶
func (e *TxNetworkEntry) UpdateLocalHotTx(txs *pb.HotTransactionBlock) error
func (*TxNetworkEntry) UpdateLocalPeer ¶
func (e *TxNetworkEntry) UpdateLocalPeer(s *pb.PeerTxState) error
type TxNetworkHandler ¶
type TxNetworkHandler interface { HandleTxs(tx []*PendingTransaction) error Release() }
Click to show internal directories.
Click to hide internal directories.