File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ use std::sync::Arc;
2222fn main ( ) {
2323 let args: Vec < String > = std:: env:: args ( ) . collect ( ) ;
2424
25- if args. len ( ) < 6 {
25+ if args. len ( ) < 8 {
2626 eprintln ! (
27- "Usage: {} storage_path listening_addr rest_svc_addr network esplora_server_url " ,
27+ "Usage: {} storage_path listening_addr rest_svc_addr network bitcoind_rpc_addr bitcoind_rpc_user bitcoind_rpc_password " ,
2828 args[ 0 ]
2929 ) ;
3030 std:: process:: exit ( -1 ) ;
@@ -59,7 +59,21 @@ fn main() {
5959 } ;
6060
6161 let mut builder = Builder :: from_config ( config) ;
62- builder. set_chain_source_esplora ( args[ 5 ] . clone ( ) , None ) ;
62+
63+ let bitcoind_rpc_addr = match SocketAddr :: from_str ( & args[ 5 ] ) {
64+ Ok ( addr) => addr,
65+ Err ( _) => {
66+ eprintln ! ( "Failed to parse bitcoind_rpc_addr: {}" , args[ 3 ] ) ;
67+ std:: process:: exit ( -1 ) ;
68+ } ,
69+ } ;
70+
71+ builder. set_chain_source_bitcoind_rpc (
72+ bitcoind_rpc_addr. ip ( ) . to_string ( ) ,
73+ bitcoind_rpc_addr. port ( ) ,
74+ args[ 6 ] . clone ( ) ,
75+ args[ 7 ] . clone ( ) ,
76+ ) ;
6377
6478 let runtime = match tokio:: runtime:: Builder :: new_multi_thread ( ) . enable_all ( ) . build ( ) {
6579 Ok ( runtime) => Arc :: new ( runtime) ,
You can’t perform that action at this time.
0 commit comments