Crates.io | artifice-manager |
lib.rs | artifice-manager |
version | 0.1.4 |
source | src |
created_at | 2020-07-18 04:19:41.606915 |
updated_at | 2020-07-24 06:16:18.821227 |
description | Artifice Management crate |
homepage | |
repository | https://github.com/artifice-network/manager |
max_upload_size | |
id | 266463 |
size | 95,381 |
This crate provides centralized functionalities for artifice such as permissions requesting/granting as well as configuration retrieval and upkeep. The reason for having a seperate crate for thse functionalities that may only end up being used once or twice is to provide extensibility of the artifice api by exposing dynamic secure configurability
In order to use the tools of the artifice network the network must first be installed. In order to do this see
use manager::{ArtificeDB, Manager};
use manager::database::Database;
use networking::peers::ArtificePeer;
use networking::ArtificeHost;
fn main(){
let database = ArtificeDB::default();
let manager = Manager::load(database, b"example password").unwrap();
let host = ArtificeHost::from_host_data(manager.config()).unwrap();
for netstream in host {
let stream = netstream.unwrap();
if manager.authenticate(stream.peer()).unwrap() {
println!("peer authenticated");
}
}
}
use manager::{ArtificeDB, Manager};
use manager::database::Database;
use networking::peers::ArtificePeer;
use networking::ArtificeHost;
fn main(){
let database = ArtificeDB::default();
let manager = Manager::load(database, b"example_password").unwrap();
let host = ArtificeHost::from_host_data(manager.config()).unwrap();
let peer = manager.get_peer("global_peer_hash").unwrap();
let host = ArtificeHost::from_host_data(manager.config()).unwrap();
let stream = host.connect(peer).unwrap();
}