Skip to content
Snippets Groups Projects

Write `get-file` and commands to get the list of blocks from another node

2 files
+ 33
0
Compare changes
  • Side-by-side
  • Inline

Files

+ 11
0
@@ -7,6 +7,7 @@ use libp2p::swarm::NetworkInfo;
use libp2p::{Multiaddr, PeerId};
use serde::{Deserialize, Serialize};
use std::error::Error;
use std::path::PathBuf;
use std::sync::Arc;
use tokio::sync::{
mpsc,
@@ -90,6 +91,10 @@ pub(crate) enum DragoonCommand {
powers_path: String,
sender: Sender<(String, String)>,
},
GetBlockDir {
file_hash: String,
sender: Sender<PathBuf>,
},
GetBlockFrom {
peer_id: PeerId,
file_hash: String,
@@ -114,6 +119,10 @@ pub(crate) enum DragoonCommand {
powers_path: String,
sender: Sender<String>,
},
GetFileDir {
file_hash: String,
sender: Sender<PathBuf>,
},
GetListeners {
sender: Sender<Vec<Multiaddr>>,
},
@@ -151,11 +160,13 @@ impl std::fmt::Display for DragoonCommand {
// DragoonCommand::DragoonPeers { .. } => write!(f, "dragoon-peers"),
// DragoonCommand::DragoonSend { .. } => write!(f, "dragoon-send"),
DragoonCommand::EncodeFile { .. } => write!(f, "encode-file"),
DragoonCommand::GetBlockDir { .. } => write!(f, "get-block-dir"),
DragoonCommand::GetBlockFrom { .. } => write!(f, "get-block-from"),
DragoonCommand::GetBlocksInfoFrom { .. } => write!(f, "get-blocks-info-from"),
DragoonCommand::GetBlockList { .. } => write!(f, "get-block-list"),
DragoonCommand::GetConnectedPeers { .. } => write!(f, "get-connected-peers"),
DragoonCommand::GetFile { .. } => write!(f, "get-file"),
DragoonCommand::GetFileDir { .. } => write!(f, "get-file-dir"),
DragoonCommand::GetListeners { .. } => write!(f, "get-listener"),
DragoonCommand::GetPeerId { .. } => write!(f, "get-peer-id"),
DragoonCommand::GetNetworkInfo { .. } => write!(f, "get-network-info"),
Loading