bin/bitcoinrbd in bitcoinrb-grpc-0.1.1 vs bin/bitcoinrbd in bitcoinrb-grpc-0.1.2

- old
+ new

@@ -5,20 +5,16 @@ require 'thor' require 'daemon_spawn' + class BitcoinDaemon < DaemonSpawn::Base def start(args) puts "Bitcoinrb daemon start : #{Time.now} #{args}" conf = Bitcoin::Node::Configuration.new(network: args.first[:network]) - require 'bitcoin/grpc' - require 'extensions/bitcoin/rpc/request_handler' - require 'extensions/bitcoin/wallet/base' - require 'extensions/bitcoin/tx' - refresh_wallet node = Bitcoin::Node::SPV.new(conf) Thread.new { Bitcoin::Grpc::Server.run(node) } node.run end @@ -39,9 +35,12 @@ desc 'start', 'start bitcoinrb daemon.' def start network = options['network'] ? options['network'].to_sym : :mainnet Bitcoin.chain_params = network + + require 'bitcoin/grpc' + FileUtils.mkdir_p(Bitcoin.base_dir) execute_daemon(['start', network: network]) end desc 'stop', 'stop bitcoinrb daemon.'