bitcoin2graphdb 0.3.5 → 0.3.6

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: 518f182a04704a20cbb981b092b04f26bb5fa377
4
- data.tar.gz: 079e1a6ad0b6ca97d3b35a8644b91a7292ef7a10
3
+ metadata.gz: 9810f791c591fa5cba2820318e56a559a68aac50
4
+ data.tar.gz: 5d0eb515b554e6237a34bc01c87f0887e72eb4a1
5
5
  SHA512:
6
- metadata.gz: 710533c347d6a8b9dbf3d8094d5637e28071b4fd3830a2c2a451ca9fd5af746d687f78cc8c0a102eae4c50e5f69ab7bb9701f1d17d8bc1319bfe7e42d81562f2
7
- data.tar.gz: bac0deec127d4f922743bf2903423db27303b4d6ca1160d79cf33a154bd9225b9cf94cd79b9d9ec99bed2a5a6ff3052f4dbffbee48a07ab607a95ec07c8227f5
6
+ metadata.gz: dfcee0a647b319afd958bad57a0e434b52ff23cc01208027fe63a38705f1f982b580f039eed15c92491be62164d8e47d9f6d9b1166e558368fc0c171236f30e3
7
+ data.tar.gz: 83c6bc425de2fd7ac11d7857a5ad06856f1449687bfb394ab8123eddc664379fa56e3b1f672cadde1dfd09b854600a34db7350257ba087e4ae06499ad74bbf93
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Bitcoin2Graphdb [![Build Status](https://travis-ci.org/haw-itn/bitcoin2graphdb.svg?branch=master)](https://travis-ci.org/haw-itn/bitcoin2graphdb) [![Gem Version](https://badge.fury.io/rb/bitcoin2graphdb.svg)](https://badge.fury.io/rb/bitcoin2graphdb) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
1
+ # Bitcoin2Graphdb [![Build Status](https://travis-ci.org/haw-itn/bitcoin2graphdb.svg?branch=master)](https://travis-ci.org/haw-itn/bitcoin2graphdb) [![Gem Version](https://badge.fury.io/rb/bitcoin2graphdb.svg)](https://badge.fury.io/rb/bitcoin2graphdb) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
2
2
 
3
3
  A tool for import Bitcoin blockchain data into neo4j database.
4
4
 
@@ -56,6 +56,11 @@ bitcoin2graphdb:
56
56
 
57
57
  ## Usage
58
58
 
59
+ * Show usage
60
+ ```
61
+ $ bitcoin2graphdb help
62
+ ```
63
+
59
64
  * Start bitcoin2graphdb daemon
60
65
  ```
61
66
  $ bitcoin2graphdb start -c <configuration file path>
@@ -63,7 +68,7 @@ $ bitcoin2graphdb start -c <configuration file path>
63
68
 
64
69
  * Stop bitcoin2graphdb daemon
65
70
  ```
66
- $ bitcoin2graphdb stop
71
+ $ bitcoin2graphdb stop
67
72
  ```
68
73
 
69
74
  ## Extensions
@@ -73,7 +78,7 @@ Bitcoin2Graphdb currently supports following extensions.
73
78
  |Extension Key Name|Description|
74
79
  |:-----------|:------------|
75
80
  |open_assets| Add Open Assets Protocol support. If this extension is enabled, the asset quantity and Graphdb::Model::AssetId association will be added to the Graphdb::Model::TxOut.|
76
- * Open Assets Protocol
81
+ * Open Assets Protocol
77
82
 
78
83
  To enable extension, add an extension key name to enable the Configuration file like following.
79
84
 
@@ -86,13 +91,13 @@ bitcoin2graphdb:
86
91
 
87
92
  # Testing
88
93
 
89
- When you run rspec, you need to run neo4j test server(http://localhost:7475) in advance.
90
- Others are the same as normal rspec.
94
+ When you run rspec, you need to run neo4j test server(http://localhost:7475) in advance.
95
+ Others are the same as normal rspec.
91
96
 
92
97
 
93
98
  ## Contributing
94
99
 
95
- Bug reports and pull requests are welcome on GitHub at https://github.com/haw-itn/bitcoin2graphdb.
100
+ Bug reports and pull requests are welcome on GitHub at https://github.com/haw-itn/bitcoin2graphdb.
96
101
 
97
102
  ## License
98
103
 
@@ -117,4 +122,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
117
122
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
118
123
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
119
124
  SOFTWARE.
120
-
@@ -19,10 +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.5.7"
22
+ spec.add_runtime_dependency "openassets-ruby", ">= 0.6.4"
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
+ spec.add_runtime_dependency "thor"
27
+
26
28
 
27
29
  spec.add_development_dependency "bundler", "~> 1.10"
28
30
  spec.add_development_dependency "rake", "~> 10.0"
data/exe/bitcoin2graphdb CHANGED
@@ -1,38 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'bitcoin2graphdb/cli'
2
3
 
3
- require "bundler/setup"
4
- require 'base'
5
- require 'optparse'
6
- require 'json'
7
- require 'yaml'
8
- require 'active_support/all'
9
- require 'daemon_spawn'
10
-
11
- class Bitcoin2GraphdbDaemon < DaemonSpawn::Base
12
- def start(args)
13
- puts "Bitcoin2GraphdbDaemon start : #{Time.now}"
14
- migration = Bitcoin2Graphdb::Migration.new(config(args)[:bitcoin2graphdb])
15
- migration.run
16
- end
17
-
18
- def stop
19
- puts "Bitcoin2GraphdbDaemon stop : #{Time.now}"
20
- end
21
-
22
- private
23
- def config(args)
24
- config_index = args.index("-c")
25
- if config_index && args.length > config_index + 1 && File.exists?(args[config_index + 1])
26
- YAML.load(File.read(args[config_index + 1])).deep_symbolize_keys
27
- else
28
- raise ArgumentError.new 'configuration file not specified or does not exist.'
29
- end
30
- end
31
- end
32
-
33
- Bitcoin2GraphdbDaemon.spawn!({
34
- working_dir: Dir.pwd,
35
- log_file: File.expand_path(Dir.pwd + '/bitcoin2graphdb.log'),
36
- pid_file: File.expand_path(Dir.pwd + '/bitcoin2graphdb.pid'),
37
- sync_log: true,
38
- singleton: true})
4
+ Bitcoin2Graphdb::CLI.start(ARGV)
@@ -0,0 +1,61 @@
1
+ require 'thor'
2
+ require 'base'
3
+ require 'json'
4
+ require 'yaml'
5
+ require 'active_support/all'
6
+ require 'daemon_spawn'
7
+
8
+ module Bitcoin2Graphdb
9
+ class Bitcoin2GraphdbDaemon < DaemonSpawn::Base
10
+ def start(args)
11
+ puts "Bitcoin2GraphdbDaemon start : #{Time.now}"
12
+ migration = Bitcoin2Graphdb::Migration.new(args[0][:bitcoin2graphdb])
13
+ migration.run
14
+ end
15
+
16
+ def stop
17
+ puts "Bitcoin2GraphdbDaemon stop : #{Time.now}"
18
+ end
19
+
20
+ private
21
+ def config(args)
22
+ config_index = args.index("-c")
23
+ end
24
+ end
25
+
26
+
27
+ class CLI < Thor
28
+ class_option :pid, aliases: '-p', default: Dir.pwd + '/bitcoin2graphdb.pid', banner: '<pid file path>'
29
+ class_option :log, aliases: '-l', default: Dir.pwd + '/bitcoin2graphdb.log', banner: '<log file path>'
30
+
31
+ option :conf, aliases: '-c' , required: true, banner: '<configuration file path>'
32
+ 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])
48
+ end
49
+
50
+ desc "stop", "stop bitcoin2graphdb daemon process"
51
+ def stop
52
+ 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]),
57
+ sync_log: true,
58
+ singleton: true}, ['stop'])
59
+ end
60
+ end
61
+ end
@@ -1,3 +1,3 @@
1
1
  module Bitcoin2Graphdb
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
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.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-14 00:00:00.000000000 Z
11
+ date: 2017-06-09 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.5.7
19
+ version: 0.6.4
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.5.7
26
+ version: 0.6.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: daemon-spawn
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.0.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: thor
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -162,6 +176,7 @@ files:
162
176
  - lib/bitcoin2graphdb.rb
163
177
  - lib/bitcoin2graphdb/bitcoin.rb
164
178
  - lib/bitcoin2graphdb/bitcoin/blockchain_provider.rb
179
+ - lib/bitcoin2graphdb/cli.rb
165
180
  - lib/bitcoin2graphdb/migration.rb
166
181
  - lib/bitcoin2graphdb/tasks/migration.rake
167
182
  - lib/bitcoin2graphdb/version.rb