Documentation ¶
Index ¶
- Constants
- func CreateLdb(dbRootDir string) (*levelds.Datastore, error)
- func GenerateIdentity(path string) (crypto.PrivKey, error)
- func LoadIdentity(idPath string) (crypto.PrivKey, error)
- func ReadIdentity(path string) (crypto.PrivKey, error)
- type ACLConfig
- type ACLFilter
- func (a *ACLFilter) AllowConnect(src peer.ID, srcAddr ma.Multiaddr, dest peer.ID) bool
- func (a *ACLFilter) AllowHop(src, dest peer.ID) bool
- func (a *ACLFilter) AllowReserve(p peer.ID, addr ma.Multiaddr) bool
- func (a *ACLFilter) Connected(n network.Network, c network.Conn)
- func (a *ACLFilter) Disconnected(n network.Network, c network.Conn)
- type BootstrapConfig
- type Config
- type ConnMgrConfig
- type DHTConfig
- type DaemonConfig
- type MtvNode
- type NetworkConfig
- type PNetFingerprint
- type RelayV2Config
Constants ¶
const ( NameID = "id" NameConfig = "config" NamePSK = "swarmkey" )
Define the names of arguments here.
Variables ¶
This section is empty.
Functions ¶
func GenerateIdentity ¶
GenerateIdentity writes a new random private key to the given path.
func LoadIdentity ¶
LoadIdentity reads a private key from the given path and, if it does not exist, generates a new one.
Types ¶
type ACLConfig ¶
ACLConfig provides filtering configuration to allow specific peers or subnets to be fronted by relays. In V2, this specifies the peers/subnets that are able to make reservations on the relay. In V1, this specifies the peers/subnets that can be contacted through the relays.
type ACLFilter ¶
type ACLFilter struct {
// contains filtered or unexported fields
}
ACLFilter implements the libp2p relay ACL interface.
func NewACL ¶
NewACL returns an implementation of the relay ACL interface using the given host and relay daemon ACL config.
func (*ACLFilter) AllowConnect ¶
AllowConnect is always true, as we are accepting any public node to be able to contact the nodes allowed to make reservations through this relay.
func (*ACLFilter) AllowReserve ¶
AllowReserve is relevant for the relayv2 ACL implementation.
type BootstrapConfig ¶
type BootstrapConfig struct {
BootstrapPeers []string
}
type Config ¶
type Config struct { Network NetworkConfig ConnMgr ConnMgrConfig // RelayV1 RelayV1Config RelayV2 RelayV2Config ACL ACLConfig Daemon DaemonConfig Bootstrap BootstrapConfig DHT DHTConfig }
Config stores the full configuration of the relays, ACLs and other settings that influence behaviour of a relay daemon.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a default relay configuration using default resource settings and no ACLs.
func LoadConfig ¶
LoadConfig reads a relay daemon JSON configuration from the given path. The configuration is first initialized with DefaultConfig, so all unset fields will take defaults from there.
type ConnMgrConfig ¶
ConnMgrConfig controls the libp2p connection manager settings.
type DaemonConfig ¶
type DaemonConfig struct {
PprofPort int
}
DaemonConfig controls settings for the relay-daemon itself.
type MtvNode ¶
func NewMtvNode ¶
type NetworkConfig ¶
NetworkConfig controls listen and annouce settings for the libp2p host.
type PNetFingerprint ¶
type PNetFingerprint []byte
func LoadSwarmKey ¶
func LoadSwarmKey(path string) (pnet.PSK, PNetFingerprint, error)
LoadSwarmKey loads a swarm key at the given filepath and decodes it as a PSKv1.
type RelayV2Config ¶
RelayV2Config controls activation of V2 circuits and resouce configuration for them.