Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPort = 6091
View Source
var P2PPrivateKeyKey = "p2pPrivKey"
Functions ¶
This section is empty.
Types ¶
type AccountsP2P ¶
type AccountsP2P struct {
Accounts map[string]blockchain.Account
}
AccountsP2P represents all the accounts from a peer
type MappingsP2P ¶
type MappingsP2P struct {
Mappings map[string]blockchain.DocumentMapping
}
MappingsP2P represents all the collection mappings (schemas) from a peer
type P2P ¶
P2P is the main object to handle networking-related messages
func NewP2P ¶
func NewP2P(bc *blockchain.Blockchain, bindHost string, bindPort uint16, advertiseAddress string, connectionAddresses ...string) *P2P
NewP2P initializes the P2P node with messages and handlers
func (*P2P) BroadcastObject ¶
func (p *P2P) BroadcastObject(object noise.Serializable)
BroadcastObject sends a serializable object to all the known peers
func (*P2P) SyncAccountsFromPeers ¶
func (p *P2P) SyncAccountsFromPeers()
SyncAccountsFromPeers sends rpc to peers to sync the accounts
func (*P2P) SyncMappingsFromPeers ¶
func (p *P2P) SyncMappingsFromPeers()
SyncMappingsFromPeers sends rpc to peers to sync the mappings
type RequestP2P ¶
RequestP2P represents common p2p request body
Click to show internal directories.
Click to hide internal directories.