117 releases (7 breaking)
|new 0.8.39||Dec 6, 2023|
|0.8.33||Nov 29, 2023|
|0.4.1||Jul 31, 2023|
2,985 downloads per month
Used in 8 crates (6 directly)
sn_protocol directory contains the core protocol logic for the Safe Network. It includes various modules that handle different aspects of the protocol, such as error handling, messages, and storage.
Table of Contents
- Error Handling
- Protobuf Definitions
error.rs file contains the definitions for various errors that can occur within the protocol.
ChunkNotFound(ChunkAddress): Indicates that a chunk was not found.
ChunkNotStored(XorName): Indicates that a chunk was not stored.
RegisterNotFound(Box<RegisterAddress>): Indicates that a register was not found.
SpendNotFound(SpendAddress): Indicates that a spend was not found.
DoubleSpendAttempt(Box<SignedSpend>, Box<SignedSpend>): Indicates a double spend attempt.
messages module contains different types of messages that can be sent or received within the protocol.
- Description: Write operation to notify peer fetch a list of
NetworkAddressfrom the holder.
holder: NetworkAddress: Holder of the replication keys.
keys: Vec<NetworkAddress>: Keys of the copy that shall be replicated.
- Description: Retrieve the cost of storing a record at the given address.
address: NetworkAddress: The address where the record will be stored.
- Description: The store cost in nanos for storing the next record.
store_cost: Result<Token>: The cost of storing the record.
payment_address: PublicAddress: The address to pay the store cost to.
- Description: Response to replication cmd.
Result<()>: The result of the replication command.
storage module handles the storage aspects of the protocol.
ChunkAddress: Address of a chunk in the network.
SpendAddress: Address of a CashNote's Spend in the network.
Header: Header information for storage items.
safenode_proto directory contains the Protocol Buffers definitions for the Safe Network.
req_resp_types.proto: Definitions for request and response types.
safenode.proto: Main Protocol Buffers definitions for the Safe Network.