Sha256: d4ace9965c7c92068b45c48b28dc3e55711b5dd9fe18b8e9bbcc0e647f2e28fb
Contents?: true
Size: 1.01 KB
Versions: 18
Compression:
Stored size: 1.01 KB
Contents
#!/usr/bin/env ruby require 'thor' require 'tapyrus' require 'daemon_spawn' class TapyrusDaemon < DaemonSpawn::Base def start(args) puts "Tapyrusrb daemon start : #{Time.now}" conf = Tapyrus::Node::Configuration.new(network: args.first[:network]) node = Tapyrus::Node::SPV.new(conf) node.run end end class Tapyrusrbd < Thor class_option :network, aliases: '-n', default: :prod desc 'start', 'start tapyrusrb daemon.' def start network = options['network'] ? options['network'].to_sym : :prod Tapyrus.chain_params = network FileUtils.mkdir_p(Tapyrus.base_dir) execute_daemon(['start', network: network]) end private def execute_daemon(cmd_args) TapyrusDaemon.spawn!({working_dir: Tapyrus.base_dir, log_file: "#{Tapyrus.base_dir}/log/tapyrusrbd.log", pid_file: "#{Tapyrus.base_dir}/tapyrusrbd.pid", sync_log: true, singleton: true}, cmd_args) end end Tapyrusrbd.start(ARGV)
Version data entries
18 entries across 18 versions & 1 rubygems