bitcoin2graphdb 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9810f791c591fa5cba2820318e56a559a68aac50
4
- data.tar.gz: 5d0eb515b554e6237a34bc01c87f0887e72eb4a1
3
+ metadata.gz: '055480814ddd470fbd441308f64478a5a86326ba'
4
+ data.tar.gz: 0cca242eb84b6d57373450ca4dca4de6216004a2
5
5
  SHA512:
6
- metadata.gz: dfcee0a647b319afd958bad57a0e434b52ff23cc01208027fe63a38705f1f982b580f039eed15c92491be62164d8e47d9f6d9b1166e558368fc0c171236f30e3
7
- data.tar.gz: 83c6bc425de2fd7ac11d7857a5ad06856f1449687bfb394ab8123eddc664379fa56e3b1f672cadde1dfd09b854600a34db7350257ba087e4ae06499ad74bbf93
6
+ metadata.gz: e5dabd486eddaad1a3fdafa568a7c5cdf4cffbd6356d598d627ecb2e719495b32c660b4e2af8ae5290409d9345b92d549de3c5e9f2d1cd01ee916580cdb2d010
7
+ data.tar.gz: 0004f7d3d2504f7bc4e7f1806a1de60fe7161d41e2f109c08f20da0f625ada24b74570f422681f0241f47ffc58feaf117a86b42f485c02cd090298eaa19645f6
@@ -1 +1 @@
1
- ruby-2.2.2
1
+ ruby-2.4.1
@@ -1,11 +1,15 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.2.2
4
+ - 2.3.0
5
+ - 2.4.1
4
6
 
5
7
  bundler_args: --jobs=2
6
8
 
7
- script:
9
+ before_script:
8
10
  - bundle exec rake neo4j:install[community-2.3.3,test]
9
11
  - bundle exec rake neo4j:config[test,7475]
10
12
  - bundle exec rake neo4j:start[test]
11
- - bundle exec rake spec
13
+
14
+ script:
15
+ - bundle exec rake spec
data/README.md CHANGED
@@ -71,6 +71,16 @@ $ bitcoin2graphdb start -c <configuration file path>
71
71
  $ bitcoin2graphdb stop
72
72
  ```
73
73
 
74
+ * Show bitcoin2graphdb Status
75
+ ```
76
+ $ bitcoin2graphdb status
77
+ ```
78
+
79
+ * Restart bitcoin2graphdb daemon
80
+ ```
81
+ $ bitcoin2graphdb restart -c <configuration file path>
82
+ ```
83
+
74
84
  ## Extensions
75
85
 
76
86
  Bitcoin2Graphdb currently supports following extensions.
@@ -19,13 +19,12 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_runtime_dependency "openassets-ruby", ">= 0.6.4"
22
+ spec.add_runtime_dependency "openassets-ruby", ">= 0.6.5"
23
23
  spec.add_runtime_dependency "daemon-spawn"
24
24
  spec.add_runtime_dependency "neo4j", "~>7.1.0"
25
25
  spec.add_runtime_dependency "activesupport", ">= 4.0.2"
26
26
  spec.add_runtime_dependency "thor"
27
27
 
28
-
29
28
  spec.add_development_dependency "bundler", "~> 1.10"
30
29
  spec.add_development_dependency "rake", "~> 10.0"
31
30
  spec.add_development_dependency "rspec"
@@ -1,5 +1,6 @@
1
1
  require 'bitcoin'
2
2
  require 'openassets'
3
+ require 'bitcoin2graphdb/version'
3
4
 
4
5
  module Bitcoin2Graphdb
5
6
  autoload :Bitcoin, 'bitcoin2graphdb/bitcoin'
@@ -16,11 +16,6 @@ module Bitcoin2Graphdb
16
16
  def stop
17
17
  puts "Bitcoin2GraphdbDaemon stop : #{Time.now}"
18
18
  end
19
-
20
- private
21
- def config(args)
22
- config_index = args.index("-c")
23
- end
24
19
  end
25
20
 
26
21
 
@@ -30,32 +25,46 @@ module Bitcoin2Graphdb
30
25
 
31
26
  option :conf, aliases: '-c' , required: true, banner: '<configuration file path>'
32
27
  desc "start", "start bitcoin2graphdb daemon process"
33
- def start(name="Ruby")
34
- conf = if File.exists?(options[:conf])
35
- YAML.load( File.read(options[:conf]) ).deep_symbolize_keys
36
- else
37
- raise ArgumentError.new(
38
- "configuration file[#{options[:conf]}] not specified or does not exist.")
39
- end
40
-
41
- Bitcoin2Graphdb::Bitcoin2GraphdbDaemon.spawn!(
42
- {
43
- working_dir: Dir.pwd,
44
- log_file: File.expand_path(options[:log]),
45
- pid_file: File.expand_path(options[:pid]),
46
- sync_log: true,
47
- singleton: true}, ['start', conf])
28
+ def start()
29
+ conf = read_conf options[:conf]
30
+ execute_daemon(options[:log], options[:pid], ['start', conf])
48
31
  end
49
32
 
50
33
  desc "stop", "stop bitcoin2graphdb daemon process"
51
34
  def stop
35
+ execute_daemon(options[:log], options[:pid], ['stop'])
36
+ end
37
+
38
+ desc "status", "show bitcoin2graphdb daemon status"
39
+ def status
40
+ execute_daemon(options[:log], options[:pid], ['status'])
41
+ end
42
+
43
+ option :conf, aliases: '-c' , required: true, banner: '<configuration file path>'
44
+ desc "restart", "restart bitcoin2graphdb daemon process"
45
+ def restart()
46
+ conf = read_conf options[:conf]
47
+ execute_daemon(options[:log], options[:pid], ['restart', conf])
48
+ end
49
+
50
+ private
51
+ def read_conf(conf_path)
52
+ unless File.exists?(conf_path)
53
+ raise ArgumentError.new(
54
+ "configuration file[#{options[:conf]}] not specified or does not exist.")
55
+ end
56
+ YAML.load( File.read(options[:conf]) ).deep_symbolize_keys
57
+ end
58
+
59
+ def execute_daemon(log, pid, cmd_args)
52
60
  Bitcoin2Graphdb::Bitcoin2GraphdbDaemon.spawn!(
53
- {
54
- working_dir: Dir.pwd,
55
- log_file: File.expand_path(options[:log]),
56
- pid_file: File.expand_path(options[:pid]),
61
+ { working_dir: Dir.pwd,
62
+ log_file: File.expand_path(log),
63
+ pid_file: File.expand_path(pid),
57
64
  sync_log: true,
58
- singleton: true}, ['stop'])
65
+ singleton: true},
66
+ cmd_args)
59
67
  end
68
+
60
69
  end
61
70
  end
@@ -1,3 +1,3 @@
1
1
  module Bitcoin2Graphdb
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitcoin2graphdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-09 00:00:00.000000000 Z
11
+ date: 2017-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: openassets-ruby
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.4
19
+ version: 0.6.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.6.4
26
+ version: 0.6.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: daemon-spawn
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  requirements: []
216
216
  rubyforge_project:
217
- rubygems_version: 2.4.6
217
+ rubygems_version: 2.6.11
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: A tool for import Bitcoin blockchain data into neo4j database.