Skip to content

Commit

Permalink
payment: add onboard cli ccommand
Browse files Browse the repository at this point in the history
  • Loading branch information
pociej committed Nov 7, 2023
1 parent 5f969fa commit ca72f6e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
39 changes: 38 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/payment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
structopt = "0.3"
thiserror = "1.0"
open = "5.0"
tokio = { version = "1", features = ["fs", "signal", "macros"] }
tokio-util = { version = "0.7.9", features = ["rt"] }
uint = "0.7"
Expand Down
13 changes: 13 additions & 0 deletions core/payment/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ pub enum PaymentCli {
/// List active payment accounts
Accounts,

/// Open onboarding url
Onboard {
#[structopt(flatten)]
account: pay::AccountCli,
},
/// Supply payment account with funds
Fund {
#[structopt(flatten)]
Expand Down Expand Up @@ -128,6 +133,14 @@ pub enum InvoiceCommand {
impl PaymentCli {
pub async fn run_command(self, ctx: &CliCtx) -> anyhow::Result<CommandOutput> {
match self {
PaymentCli::Onboard { account } => {
let address = resolve_address(account.address()).await?;
open::that(format!(
"https://golemfactory.github.io/onboarding_production/?yagnaAddress={}",
address
))?;
Ok(CommandOutput::NoOutput)
}
PaymentCli::Fund { account } => {
let address = resolve_address(account.address()).await?;

Expand Down

0 comments on commit ca72f6e

Please sign in to comment.