-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection Gating in a libp2p node #877
Conversation
@@ -4,7 +4,6 @@ import ( | |||
"context" | |||
"crypto/rand" | |||
"fmt" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the import block separation is desirable, i think
"github.com/libp2p/go-libp2p-core/connmgr" | ||
"github.com/libp2p/go-libp2p-core/crypto" | ||
"github.com/libp2p/go-libp2p-core/metrics" | ||
"github.com/libp2p/go-libp2p-core/network" | ||
"github.com/libp2p/go-libp2p-core/peer" | ||
"github.com/libp2p/go-libp2p-core/peerstore" | ||
"github.com/libp2p/go-libp2p-core/pnet" | ||
"github.com/pkg/errors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need this dep. either the system built-in "errors"
can be used for errors.New
, or you can use the already included fmt
for fmt.Errorf()
.
// ConnectionGater configures libp2p to use the given Connection Gater | ||
// to reject incoming/outgoing connections based om the logic implemented in the gater. | ||
// Note: This Option has replaced the earlier "Filters" AND "FilterAddresses" Options. | ||
// Please use "filter.ToConnectionGater" to configure this of you already have an instance of a "go-maddr-filter.Filter". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Please use "filter.ToConnectionGater" to configure this of you already have an instance of a "go-maddr-filter.Filter". | |
// Existing users of go-maddr-filter.Filter may use "filter.ToConnectionGater" for compatibility. |
Closing in favour of #881 . |
For #872 .
Core PR at libp2p/go-libp2p-core#139.
Swarm PR at libp2p/go-libp2p-swarm#201.
Transport Upgrader PR at libp2p/go-libp2p-transport-upgrader#55.
MultiAddr Filter PR at libp2p/go-maddr-filter#21.