Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
![image](https://github.com/user-attachments/assets/bf674eb1-512d-47e7-a9c5-e0d0e44c6edb)

> [!Important]
> Tapedrive is very much still in development, it is **not deployed** to mainnet yet.
> Tapedrive is very much still in development, it is **not deployed** to mainnet yet. A [new version](https://x.com/zelimir__/status/1975304835064078660) is in the works.
>
> [Sign up](https://tapedrive.io/#sign-up) to receive updates on network milestones and product releases. Join us on [Discord](https://discord.gg/dVa9TWA45X) to engage with our devs.

Expand Down
12 changes: 12 additions & 0 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,22 @@ pub enum Commands {

#[arg(help = "Name of the miner you're mining with", conflicts_with = "pubkey", short = 'n', long = "name")]
name: Option<String>,

#[arg(help = "Trusted peer to connect to", short = 'p', long = "peer")]
trusted_peer: Option<String>,

#[arg(help = "Miner account public key", short = 'm', long = "miner")]
miner_address: Option<String>,
},
Web {
#[arg(help = "Port to run the web RPC service on")]
port: Option<u16>,

#[arg(help = "Trusted peer to connect to", short = 'p', long = "peer")]
trusted_peer: Option<String>,

#[arg(help = "Miner account public key", short = 'm', long = "miner")]
miner_address: Option<String>,
},

// Admin Commands
Expand Down
19 changes: 11 additions & 8 deletions cli/src/commands/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ pub async fn handle_network_commands(cli: Cli, context: Context) -> Result<()> {
log::print_divider();

match cli.command {
Commands::Web { port } => {
handle_web(context, port).await?;
Commands::Web { port, trusted_peer, miner_address } => {
handle_archive(&context, trusted_peer, miner_address).await?;
handle_web(&context, port).await?;

}
Commands::Archive { trusted_peer, miner_address } => {
handle_archive(context, trusted_peer, miner_address).await?;
handle_archive(&context, trusted_peer, miner_address).await?;
}
Commands::Mine { pubkey, name } => {
handle_mine(context, pubkey, name).await?;
Commands::Mine { pubkey, name, trusted_peer, miner_address } => {
handle_archive(&context, trusted_peer, miner_address).await?;
handle_mine(&context, pubkey, name).await?;
}
Commands::Register { name } => {
handle_register(context, name).await?;
Expand All @@ -38,7 +41,7 @@ pub async fn handle_network_commands(cli: Cli, context: Context) -> Result<()> {
Ok(())
}

pub async fn handle_web(context: Context, port: Option<u16>) -> Result<()> {
pub async fn handle_web(context: &Context, port: Option<u16>) -> Result<()> {
let port = port.unwrap_or(3000);

log::print_info("Starting web RPC service...");
Expand All @@ -49,7 +52,7 @@ pub async fn handle_web(context: Context, port: Option<u16>) -> Result<()> {
}

pub async fn handle_archive(
context: Context,
context: &Context,
trusted_peer: Option<String>,
miner_address: Option<String>
) -> Result<()> {
Expand Down Expand Up @@ -82,7 +85,7 @@ pub async fn handle_archive(
}

pub async fn handle_mine(
context: Context,
context: &Context,
miner_address: Option<String>,
miner_name: Option<String>
) -> Result<()> {
Expand Down