Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Add an option to specify which Bitcoin wallet should be used #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ fn main() {
.value_name("DIRECTORY")
.help("Sets a data directory")
.takes_value(true))
.arg(Arg::with_name("rpcwallet")
.short("w")
.long("rpcwallet")
.value_name("WALLET NAME")
.help("Sets the Bitcoin core's wallet name")
.takes_value(true))
.subcommand(SubCommand::with_name("issueasset")
.about("Issue a new asset")
.arg(Arg::with_name("title")
Expand Down Expand Up @@ -111,9 +117,11 @@ fn main() {
let default_rgb_dir = home_dir().unwrap().join(".rgb");
let datadir = Path::new(matches.value_of("datadir").unwrap_or(default_rgb_dir.to_str().unwrap()));

let rpc_wallet_path = matches.value_of("rpcwallet").unwrap_or("");

let config = kaleidoscope::Config::load_from(datadir);
let mut database = database::Database::new(datadir);
let mut client = jsonrpc::client::Client::new("http://".to_owned() + &config.rpcconnect + &":".to_owned() + &config.rpcport.to_string(), Some(config.rpcuser.clone()), Some(config.rpcpassword.clone()));
let mut client = jsonrpc::client::Client::new(format!("http://{}:{}/wallet/{}", config.rpcconnect, config.rpcport.to_string(), rpc_wallet_path), Some(config.rpcuser.clone()), Some(config.rpcpassword.clone()));

// ---------------------------

Expand Down