package gossip
import "go.dedis.ch/dela/core/txn/pool/gossip"
Package gossip implements a transaction pool that is using a gossip protocol to spread the transactions to other participants.
Index ¶
- type Pool
- func NewPool(gossiper gossip.Gossiper) (*Pool, error)
- func (p *Pool) Add(tx txn.Transaction) error
- func (p *Pool) AddFilter(filter pool.Filter)
- func (p *Pool) Close() error
- func (p *Pool) Gather(ctx context.Context, cfg pool.Config) []txn.Transaction
- func (p *Pool) Remove(tx txn.Transaction) error
- func (p *Pool) ResetStats()
- func (p *Pool) SetPlayers(players mino.Players) error
- func (p *Pool) Stats() pool.Stats
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a transaction pool that is using gossip to send the transactions to the other participants.
- implements pool.Pool
func NewPool ¶
NewPool creates a new empty pool and starts to gossip incoming transaction.
func (*Pool) Add ¶
func (p *Pool) Add(tx txn.Transaction) error
Add implements pool.Pool. It adds the transaction to the pool and gossips it to other participants.
func (*Pool) AddFilter ¶
AddFilter implements pool.Pool. It adds the filter to the gatherer.
func (*Pool) Close ¶
Close stops the gossiper and terminate the routine that listens for rumors.
func (*Pool) Gather ¶
Gather implements pool.Pool. It blocks until the pool has enough transactions according to the configuration and then returns the transactions.
func (*Pool) Remove ¶
func (p *Pool) Remove(tx txn.Transaction) error
Remove implements pool.Pool. It removes the transaction from the pool.
func (*Pool) ResetStats ¶
func (p *Pool) ResetStats()
ResetStats implements pool.Pool. It resets the transaction statistics.
func (*Pool) SetPlayers ¶
SetPlayers implements pool.Pool. It sets the list of participants the transactions should be gossiped to.
func (*Pool) Stats ¶
Stats implements pool.Pool. It gets the transaction statistics.
Source Files ¶
gossip.go
- Version
- v0.1.0 (latest)
- Published
- Apr 10, 2024
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 1 month ago –
Tools for package owners.