Skip to content

Commit

Permalink
Merge pull request #513 from breez/ok300-add-getinfo
Browse files Browse the repository at this point in the history
Add `GetInfo` node command
  • Loading branch information
ok300 authored Oct 10, 2023
2 parents e51d6af + b1f7ec8 commit e4350e4
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions libs/sdk-core/src/greenlight/node_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,15 @@ impl NodeAPI for Greenlight {

Ok("All channels were closed".to_string())
}
NodeCommand::GetInfo => {
let resp = self
.get_node_client()
.await?
.getinfo(pb::cln::GetinfoRequest::default())
.await?
.into_inner();
Ok(format!("{resp:?}"))
}
}
}

Expand Down Expand Up @@ -874,23 +883,26 @@ impl NodeAPI for Greenlight {

#[derive(Clone, PartialEq, Eq, Debug, EnumString, Display, Deserialize, Serialize)]
enum NodeCommand {
#[strum(serialize = "listpeers")]
ListPeers,
#[strum(serialize = "closeallchannels")]
CloseAllChannels,

#[strum(serialize = "listpeerchannels")]
ListPeerChannels,
#[strum(serialize = "getinfo")]
GetInfo,

#[strum(serialize = "listfunds")]
ListFunds,

#[strum(serialize = "listinvoices")]
ListInvoices,

#[strum(serialize = "listpayments")]
ListPayments,

#[strum(serialize = "listinvoices")]
ListInvoices,
#[strum(serialize = "listpeers")]
ListPeers,

#[strum(serialize = "closeallchannels")]
CloseAllChannels,
#[strum(serialize = "listpeerchannels")]
ListPeerChannels,
}

// pulls transactions from greenlight based on last sync timestamp.
Expand Down

0 comments on commit e4350e4

Please sign in to comment.