sn_client
- SAFE Network Client LibraryThe sn_client
library provides the core functionalities for interacting with the SAFE Network. It handles tasks such as connecting to the network, managing concurrency, and performing various network operations like data storage and retrieval.
To include sn_client
in your Rust project, add the following to your Cargo.toml
:
toml
[dependencies]
sn_client = "latest_version_here"
To use sn_client
, you first need to instantiate a client. Here's a simple example:
rust
use sn_client::Client;
let client = Client::new(signer, peers, req_response_timeout, custom_concurrency_limit).await?;
new
signer: SecretKey
peers: Option<Vec<Multiaddr>>
req_response_timeout: Option<Duration>
custom_concurrency_limit: Option<usize>
Result<Self>
get_signed_register_from_network
address: RegisterAddress
Result<SignedRegister>
get_register
address: RegisterAddress
Result<ClientRegister>
create_register
meta: XorName
verify_store: bool
Result<ClientRegister>
store_chunk
Chunk
as a record.chunk: Chunk
payment: Vec<CashNote>
verify_store: bool
Result<()>
get_chunk
Chunk
from the kad network.address: ChunkAddress
Result<Chunk>
network_store_spend
SpendCashNote
request to the network.spend: SpendRequest
verify_store: bool
Result<()>
get_spend_from_network
cash_note_id: &CashNoteId
Result<SignedSpend>
get_store_costs_at_address
address: &NetworkAddress
Result<Vec<(PublicAddress, Token)>>
Please refer to the Contributing Guidelines from the main directory for details on how to contribute to this project.
We follow the Conventional Commits specification for commit messages. Please adhere to this standard when contributing.
This project is licensed under the MIT License.