Categorygithub.com/DXPlus/go-libp2p-pubsub-abci
modulepackage
1.2.0
Repository: https://github.com/dxplus/go-libp2p-pubsub-abci.git
Documentation: pkg.go.dev

# README

go-libp2p-pubsub-abci

This repository is forked from go-libp2p-pubsub, and some logic has been modified to support only gossip topic.

We only modified the gossipsub.go file.

Install

go get github.com/DXPlus/go-libp2p-pubsub-abci

Usage

If you want to use the only-gossip topic, please change your topic name like this:

flag := "GossipOnlyTopic"
topicName := topic + flag // "topic" is the original name of your topic 

License

The go-libp2p-pubsub-abci project is dual-licensed under Apache 2.0 and MIT terms:

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

DefaultGossipSubParams returns the default gossip sub parameters as a config.
DefaultGossipSubRouter returns a new GossipSubRouter with default parameters.
DefaultMsgIdFn returns a unique ID of the passed Message.
DefaultPeerFilter accepts all peers on all topics.
DefaultPeerGaterParams creates a new PeerGaterParams struct using default values.
FilterSubscriptions filters (and deduplicates) a list of subscriptions.
GossipSubDefaultFeatures is the feature test function for the default gossipsub protocols.
No description provided by the author
MinTopicSize returns a function that checks if a router is ready for publishing based on the topic size.
NewAllowlistSubscriptionFilter creates a subscription filter that only allows explicitly specified topics for local subscriptions and incoming peer subscriptions.
NewBasicSeqnoValidator constructs a BasicSeqnoValidator using the givven PeerMetadataStore.
NewFloodSub returns a new PubSub object using the FloodSubRouter.
NewFloodsubWithProtocols returns a new floodsub-enabled PubSub objecting using the protocols specified in ps.
NewGossipSub returns a new PubSub object using the default GossipSubRouter as the router.
NewGossipSubWithRouter returns a new PubSub object using the given router.
NewJsonTracer creates a new JSONTracer writing traces to file.
NewMapBlacklist creates a new MapBlacklist.
NewMessageCache creates a sliding window cache that remembers messages for as long as `history` slots.
No description provided by the author
NewPeerGaterParams creates a new PeerGaterParams struct, using the specified threshold and decay parameters and default values for all other parameters.
NewPubSub returns a new PubSub management object.
NewRandomSub returns a new PubSub object using RandomSubRouter as the router.
NewRegexpSubscriptionFilter creates a subscription filter that only allows topics that match a regular expression for local subscriptions and incoming peer subscriptions.
NewRemoteTracer constructs a RemoteTracer, tracing to the peer identified by pi.
NewTimeCachedBlacklist creates a new TimeCachedBlacklist with the given expiry duration.
OpenJSONTracer creates a new JSONTracer, with explicit control of OpenFile flags and permissions.
OpenPBTracer creates a new PBTracer, with explicit control of OpenFile flags and permissions.
ScoreParameterDecay computes the decay factor for a parameter, assuming the DecayInterval is 1s and that the value decays to zero if it drops below 0.01.
ScoreParameterDecayWithBase computes the decay factor for a parameter using base as the DecayInterval.
WithAppSpecificRpcInspector sets a hook that inspect incomings RPCs prior to processing them.
WithBlacklist provides an implementation of the blacklist; the default is a MapBlacklist.
WithBufferSize is a Subscribe option to customize the size of the subscribe output buffer.
/ Options WithDefaultValidator adds a validator that applies to all topics by default; it can be used more than once and add multiple validators.
WithDirectConnectTicks is a gossipsub router option that sets the number of heartbeat ticks between attempting to reconnect direct peers that are not currently connected.
WithDirectPeers is a gossipsub router option that specifies peers with direct peering agreements.
WithDiscoverConnector adds a custom connector that deals with how the discovery subsystem connects to peers.
WithDiscovery provides a discovery mechanism used to bootstrap and provide peers into PubSub.
WithDiscoveryOpts passes libp2p Discovery options into the PubSub discovery subsystem.
WithEventTracer provides a tracer for the pubsub system.
WithFloodPublish is a gossipsub router option that enables flood publishing.
WithGossipSubParams is a gossip sub router option that allows a custom config to be set when instantiating the gossipsub router.
WithGossipSubProtocols is a gossipsub router option that configures a custom protocol list and feature test function.
WithLocalPublication returns a publishing option to notify in-process subscribers only.
WithMaxMessageSize sets the global maximum message size for pubsub wire messages.
WithMessageAuthor sets the author for outbound messages to the given peer ID (defaults to the host's ID).
WithMessageIdFn is an option to customize the way a message ID is computed for a pubsub message.
WithMessageSignaturePolicy sets the mode of operation for producing and verifying message signatures.
WithMessageSigning enables or disables message signing (enabled by default).
WithNoAuthor omits the author and seq-number data of messages, and disables the use of signatures.
WithPeerExchange is a gossipsub router option that enables Peer eXchange on PRUNE.
WithPeerFilter is an option to set a filter for pubsub peers.
WithPeerGater is a gossipsub router option that enables reactive validation queue management.
WithPeerOutboundQueueSize is an option to set the buffer size for outbound messages to a peer We start dropping messages to a peer if the outbound queue if full.
WithPeerScore is a gossipsub router option that enables peer scoring.
WithPeerScoreInspect is a gossipsub router option that enables peer score debugging.
WithProtocolMatchFn sets a custom matching function for protocol selection to be used by the protocol handler on the Host's Mux.
WithRawTracer adds a raw tracer to the pubsub system.
WithReadiness returns a publishing option for only publishing when the router is ready.
WithSecretKeyAndPeerId returns a publishing option for providing a custom private key and its corresponding peer ID This option is useful when we want to send messages from "virtual", never-connectable peers in the network.
WithSeenMessagesStrategy configures which type of lookup/cleanup strategy is used by the seen messages cache.
WithSeenMessagesTTL configures when a previously seen message ID can be forgotten about.
WithStrictSignatureVerification is an option to enable or disable strict message signing.
WithSubscriptionFilter is a pubsub option that specifies a filter for subscriptions in topics of interest.
WithTopicMessageIdFn sets custom MsgIdFunction for a Topic, enabling topics to have own msg id generation rules.
WithValidateQueueSize sets the buffer of validate queue.
WithValidateThrottle sets the upper bound on the number of active validation goroutines across all topics.
WithValidateWorkers sets the number of synchronous validation worker goroutines.
WithValidatorConcurrency is an option that sets the topic validator throttle.
WithValidatorInline is an option that sets the validation disposition to synchronous: it will be executed inline in validation front-end, without spawning a new goroutine.
WithValidatorTimeout is an option that sets a timeout for an (asynchronous) topic validator.
WrapLimitSubscriptionFilter wraps a subscription filter with a hard limit in the number of subscriptions allowed in an RPC message.

# Constants

AcceptAll signals to accept the incoming RPC for full processing.
AcceptControl signals to accept the incoming RPC only for control message processing by the router.
AcceptNone signals to drop the incoming RPC.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DefaultMaximumMessageSize is 1mb.
No description provided by the author
No description provided by the author
Protocol supports basic GossipSub Mesh -- gossipsub-v1.0 compatible.
Protocol supports Peer eXchange on prune -- gossipsub-v1.1 compatible.
GossipSubID_v10 is the protocol ID for version 1.0.0 of the GossipSub protocol.
GossipSubID_v11 is the protocol ID for version 1.1.0 of the GossipSub protocol.
LaxNoSign does not produce signatures and validates incoming signatures iff one is present Deprecated: it is recommend to either strictly enable, or strictly disable, signatures.
LaxSign produces signatures and validates incoming signatures iff one is present Deprecated: it is recommend to either strictly enable, or strictly disable, signatures.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
rejection reasons.
rejection reasons.
rejection reasons.
rejection reasons.
rejection reasons.
rejection reasons.
rejection reasons.
rejection reasons.
rejection reasons.
rejection reasons.
rejection reasons.
No description provided by the author
No description provided by the author
StrictNoSign does not produce signatures and drops and penalises incoming messages that carry one.
StrictSign produces signatures and expects and verifies incoming signatures.
No description provided by the author
ValidationAccept is a validation decision that indicates a valid message that should be accepted and delivered to the application and forwarded to the network.
ValidationIgnore is a validation decision that indicates a message that should be ignored: it will be neither delivered to the application nor forwarded to the network.
ValidationReject is a validation decision that indicates an invalid message that should not be delivered to the application or forwarded to the application.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DiscoveryPollInitialDelay is how long the discovery system waits after it first starts before polling.
DiscoveryPollInterval is approximately how long the discovery system waits in between checks for whether the more peers are needed for any topic.
ErrEmptyPeerID is returned if an empty peer ID was provided.
ErrNilSignKey is returned if a nil private key was provided.
ErrSubscriptionCancelled may be returned when a subscription Next() is called after the subscription has been cancelled.
ErrTooManySubscriptions may be returned by a SubscriptionFilter to signal that there are too many subscriptions to process.
ErrTopicClosed is returned if a Topic is utilized after it has been closed.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
GossipSubConnTagBumpMessageDelivery is the amount to add to the connection manager tag that tracks message deliveries.
GossipSubConnTagDecayAmount is subtracted from decaying tag values at each decay interval.
GossipSubConnTagDecayInterval is the decay interval for decaying connection manager tags.
GossipSubConnTagMessageDeliveryCap is the maximum value for the connection manager tags that track message deliveries.
Defines the default gossipsub parameters.
GossipSubDefaultProtocols is the default gossipsub router protocol list.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
Defines the default gossipsub parameters.
No description provided by the author
No description provided by the author
TimeCacheDuration specifies how long a message ID will be remembered as seen.
TimeCacheStrategy specifies which type of lookup/cleanup strategy is used by the seen messages cache.
64K ought to be enough for everyone; famous last words.

# Structs

BasicSeqnoValidator is a basic validator, usable as a default validator, that ignores replayed messages outside the seen cache window.
No description provided by the author
No description provided by the author
GossipSubParams defines all the gossipsub specific parameters.
GossipSubRouter is a router that implements the gossipsub protocol.
JSONTracer is a tracer that writes events to a file, encoded in ndjson.
No description provided by the author
No description provided by the author
PBTracer is a tracer that writes events to a file, as delimited protobufs.
No description provided by the author
PeerGaterParams groups together parameters that control the operation of the peer gater.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PubSub is the implementation of the pubsub system.
RandomSubRouter is a router that implements a random propagation strategy.
RemoteTracer is a tracer that sends trace events to a remote peer.
No description provided by the author
Subscription handles the details of a particular Topic subscription.
TimeCachedBlacklist is a blacklist implementation using a time cache.
Topic is the handle for a pubsub topic.
TopicEventHandler is used to manage topic specific events.
No description provided by the author
No description provided by the author
No description provided by the author
ValidationError is an error that may be signalled from message publication when the message fails validation.

# Interfaces

Blacklist is an interface for peer blacklisting.
EventTracer is a generic event tracer interface.
PeerMetadataStore is an interface for storing and retrieving per peer metadata.
PubSubRouter is the message router component of PubSub.
RawTracer is a low level tracing interface that allows an application to trace the internal operation of the pubsub subsystem.
SubscriptionFilter is a function that tells us whether we are interested in allowing and tracking subscriptions for a given topic.

# Type aliases

No description provided by the author
BackoffConnectorFactory creates a BackoffConnector that is attached to a given host.
No description provided by the author
No description provided by the author
No description provided by the author
GossipSubFeature is a feature discriminant enum.
GossipSubFeatureTest is a feature test function; it takes a feature and a protocol ID and should return true if the feature is supported by the protocol.
MapBlacklist is a blacklist implementation using a perfect map.
MessageSignaturePolicy describes if signatures are produced, expected, and/or verified.
MsgIdFunction returns a unique ID for the passed Message, and PubSub can be customized to use any implementation of this function by configuring it with the Option from WithMessageIdFn.
No description provided by the author
PeerFilter is used to filter pubsub peers.
No description provided by the author
No description provided by the author
ProvideKey is a function that provides a private key and its associated peer ID when publishing a new message.
No description provided by the author
No description provided by the author
No description provided by the author
RouterReady is a function that decides if a router is ready to publish.
No description provided by the author
No description provided by the author
No description provided by the author
ValidationResult represents the decision of an extended validator.
Validator is a function that validates a message with a binary decision: accept or reject.
ValidatorEx is an extended validation function that validates a message with an enumerated decision.
ValidatorOpt is an option for RegisterTopicValidator.