Crate sn_networking
source ·Structs
- The various settings to apply to when fetching a record from network
- API to interact with the underlying Swarm
- A
RecordStorethat stores records on disk. - The various settings related to writing a record to the network.
- Snapshot of information kept in the Swarm’s local state
Enums
- Network Errors
- GetRecord Query errors
- Channel to send the
Responsethrough. - Events forwarded by the underlying Network; to be used by the upper layers
Constants
- The maximum number of peers to return in a
GetClosestPeersresponse. This is the group size used in safe network protocol to be responsible for an item in the network. The peer should be present among the CLOSE_GROUP_SIZE if we’re fetching the close_group(peer) The size has been set to 5 for improved performance. - The range of peers that will be considered as close to a record target, that a replication of the record shall be sent/accepted to/by the peer.
Functions
- Majority of a given group (i.e. > 1/2).
- Get the value of the provided Quorum
- Tries to get the signed spend out of a record.
- Verifies if
Multiaddrcontains IPv4 address that is not global. This is used to filter out unroutable addresses from the Kademlia routing table. - Sort the provided peers by their distance to the given
NetworkAddress. Return with the closest expected number of entries if has. - Sort the provided peers by their distance to the given
KBucketKey. Return with the closest expected number of entries if has.