Crates.io | sn_protocol |
lib.rs | sn_protocol |
version | 0.17.14 |
source | src |
created_at | 2023-06-04 22:49:21.171545 |
updated_at | 2024-11-06 13:45:07.69273 |
description | Safe Network Protocol |
homepage | https://maidsafe.net |
repository | https://github.com/maidsafe/safe_network |
max_upload_size | |
id | 882585 |
size | 112,646 |
The 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.
The error.rs
file contains the definitions for various errors that can occur within the protocol.
ChunkNotFound(ChunkAddress)
: Indicates that a chunk was not found.
Result::Err(Error::ChunkNotFound(chunk_address))
ChunkNotStored(XorName)
: Indicates that a chunk was not stored.
Result::Err(Error::ChunkNotStored(xor_name))
RegisterNotFound(Box<RegisterAddress>)
: Indicates that a register was not found.
Result::Err(Error::RegisterNotFound(register_address))
SpendNotFound(SpendAddress)
: Indicates that a spend was not found.
Result::Err(Error::SpendNotFound(cash_note_address))
DoubleSpendAttempt(Box<SignedSpend>, Box<SignedSpend>)
: Indicates a double spend attempt.
Result::Err(Error::DoubleSpendAttempt(spend1, spend2))
The messages
module contains different types of messages that can be sent or received within the protocol.
Cmd::Replicate
NetworkAddress
from the holder.holder: NetworkAddress
: Holder of the replication keys.keys: Vec<NetworkAddress>
: Keys of the copy that shall be replicated.Query::GetStoreCost
address: NetworkAddress
: The address where the record will be stored.QueryResponse::GetStoreCost
store_cost: Result<Token>
: The cost of storing the record.payment_address: PublicAddress
: The address to pay the store cost to.CmdResponse::Replicate
Result<()>
: The result of the replication command.The 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.The 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.