Documentation
¶
Index ¶
- Constants
- func LoadIdentity(nodeType string) (crypto.PrivKey, error)
- func SetupKeeperWithRegistry(ctx context.Context, keeperConfig types.NodeConfig, registry *PeerRegistry) (host.Host, error)
- func SetupServiceWithRegistry(ctx context.Context, serviceName string, registry *PeerRegistry) (host.Host, error)
- type Discovery
- type Message
- type Messaging
- type P2PConfig
- type PeerIdentity
- type PeerInfo
- type PeerRegistry
- type ServiceInfo
- type ServicePrivateKeys
Constants ¶
View Source
const ( ServiceManager = "manager" ServiceQuorum = "quorum" ServiceValidator = "validator" ServiceKeeper = "keeper" // Define base data directory BaseDataDir = "data" RegistryDir = "peer_registry" ServiceRegistry = "services.json" )
View Source
const MessageProtocol = "/triggerx/message/1.0.0"
Variables ¶
This section is empty.
Functions ¶
func SetupKeeperWithRegistry ¶ added in v0.1.0
func SetupKeeperWithRegistry(ctx context.Context, keeperConfig types.NodeConfig, registry *PeerRegistry) (host.Host, error)
func SetupServiceWithRegistry ¶ added in v0.1.0
Types ¶
type Discovery ¶ added in v0.1.0
type Discovery struct {
// contains filtered or unexported fields
}
func NewDiscovery ¶ added in v0.1.0
func (*Discovery) ConnectToPeer ¶ added in v0.1.0
ConnectToPeer connects to a specific peer using stored registry info
func (*Discovery) GetConnectedPeers ¶ added in v0.1.0
GetConnectedPeers returns all currently connected peers
func (*Discovery) IsConnected ¶ added in v0.1.0
func (*Discovery) SavePeerInfo ¶ added in v0.1.0
SavePeerInfo saves this peer's info to the registry
type Messaging ¶ added in v0.1.0
type Messaging struct {
// contains filtered or unexported fields
}
func (*Messaging) BroadcastMessage ¶ added in v0.1.0
func (*Messaging) InitMessageHandling ¶ added in v0.1.0
type PeerIdentity ¶
type PeerIdentity struct {
PrivKey []byte `json:"priv_key"`
}
type PeerRegistry ¶ added in v0.1.0
type PeerRegistry struct {
Services map[string]ServiceInfo `json:"services"`
// contains filtered or unexported fields
}
func NewPeerRegistry ¶ added in v0.1.0
func NewPeerRegistry() (*PeerRegistry, error)
func (*PeerRegistry) GetAllServices ¶ added in v0.1.0
func (r *PeerRegistry) GetAllServices() map[string]ServiceInfo
func (*PeerRegistry) GetService ¶ added in v0.1.0
func (r *PeerRegistry) GetService(serviceName string) (ServiceInfo, bool)
func (*PeerRegistry) UpdateService ¶ added in v0.1.0
type ServiceInfo ¶ added in v0.1.0
type ServicePrivateKeys ¶
Click to show internal directories.
Click to hide internal directories.