txnetwork

package
v0.0.0-...-667e438 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 PeerTemporaryUnavail = fmt.Errorf("Peer is temporary unavailable")
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 DumpTxNetwork() map[string]func() map[string]uint64

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 ToStringId(id []byte) string

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()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL