Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
improve: Greenlight start from invite code and recover
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Jul 30, 2023
1 parent 9912994 commit 3e6542b
Show file tree
Hide file tree
Showing 11 changed files with 297 additions and 54 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/target
myseed
seed
*.redb
device_cert
device_key
TODO.md
146 changes: 124 additions & 22 deletions Cargo.lock

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

14 changes: 11 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ motd = "Hello world"
email = "[email protected]"

[ln]
cln_path = "~/.lightning/signet/lightning-rpc"
authorized_users = ["04918dfc36c93e7db6cc0d60f37e1522f1c36b64d3f4b424c532d7c595febbc5"]
enable_node_manager = false
enable_node_manager = true
jwt_secret = "supersecretprivatekey"
ln_backend = "Cln"

# Required ln backend `Cln`, `Ldk`, `Greenlight`
ln_backend = "Greenlight"

# CLN
cln_path = "~/.lightning/signet/lightning-rpc"

# Required to start greenlight for the first time
# greenlight_invite_code = ""

fee_percent = 1.0
reserve_fee_min = 1000
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run-mint:
cargo run --bin cashu-rs-mint
run-mint OPTIONS:
cargo run --bin cashu-rs-mint {{OPTIONS}}

run-manager:
trunk serve mint-manager/index.html
Expand Down
2 changes: 1 addition & 1 deletion mint-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bitcoin = { workspace = true }
log = "0.4.19"
wasm-logger = "0.2.0"
web-sys = { version = "0.3.64", features = ["HtmlSelectElement"] }
gloo = "0.8.1"
gloo = "0.9.0"
wasm-bindgen = "0.2.87"
js-sys = "0.3.64"
nostr = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions mint/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ pub struct CLIArgs {
required = false
)]
pub config: Option<String>,
#[arg(short, long, help = "Recover Greenlight from seed", required = false)]
pub recover: Option<String>,
}
4 changes: 2 additions & 2 deletions mint/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub struct Ln {
pub authorized_users: HashSet<XOnlyPublicKey>,
pub jwt_secret: String,
pub cln_path: Option<PathBuf>,
pub geenlight_invoice_code: Option<String>,
pub greenlight_invite_code: Option<String>,
pub invoice_description: Option<String>,
pub fee_percent: f64,
pub reserve_fee_min: Amount,
Expand Down Expand Up @@ -144,7 +144,7 @@ impl Settings {

match settings.ln.ln_backend {
LnBackend::Cln => assert!(settings.ln.cln_path.is_some()),
LnBackend::Greenlight => assert!(settings.ln.geenlight_invoice_code.is_some()),
LnBackend::Greenlight => assert!(settings.ln.greenlight_invite_code.is_some()),
LnBackend::Ldk => (),
}

Expand Down
Loading

0 comments on commit 3e6542b

Please sign in to comment.