tuweni / org.apache.tuweni.plumtree / State / <init>

<init>

State(peerRepository: PeerRepository, messageHashingFunction: MessageHashing, messageSender: MessageSender, messageListener: MessageListener, messageValidator: MessageValidator, peerPruningFunction: PeerPruning)

Constructor using default time constants.

Parameters

peerRepository - the peer repository to use to store and access peer information.

messageHashingFunction - the function to use to hash messages into hashes to compare them.

messageSender - a function abstracting sending messages to other peers.

messageListener - a function consuming messages when they are gossiped.

messageValidator - a function validating messages before they are gossiped to other peers.

peerPruningFunction - a function deciding whether to prune peers.

State(peerRepository: PeerRepository, messageHashingFunction: MessageHashing, messageSender: MessageSender, messageListener: MessageListener, messageValidator: MessageValidator, peerPruningFunction: PeerPruning, graftDelay: Long, lazyQueueInterval: Long)

Default constructor.

Parameters

peerRepository - the peer repository to use to store and access peer information.

messageHashingFunction - the function to use to hash messages into hashes to compare them.

messageSender - a function abstracting sending messages to other peers.

messageListener - a function consuming messages when they are gossiped.

messageValidator - a function validating messages before they are gossiped to other peers.

peerPruningFunction - a function deciding whether to prune peers.

graftDelay - delay in milliseconds to apply before this peer grafts an other peer when it finds that peer has data it misses.

lazyQueueInterval - the interval in milliseconds between sending messages to lazy peers.