bitcoin2graphdb 0.1.9 → 0.2.0

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: 32ce89db6267c86e78c098e3dc376e3385c42a25
4
- data.tar.gz: fed0d92ce0b9809e1f034227b27089dc59a0639d
3
+ metadata.gz: aec5ae8f315c60865e52b397edd3eeceb28f637e
4
+ data.tar.gz: 57ede3ee9a5dcb2cafebb16fd9782a3280619139
5
5
  SHA512:
6
- metadata.gz: f811e116161858a70863beb06f6ae8a3b6b8797291408cf801054ae6495d4259d9ece67db0e154f7aefe27b3799b3c080c01103cdb73a6b905b2c2edd44310b3
7
- data.tar.gz: c6c3716aaad589d4e48ba34515e5b0319b6fa52654e4ba218b5d7284d5306e735af2d23fa81b431a89bc0707df2f0d1b87ed3673ce0a01f0d31827df5d32c4de
6
+ metadata.gz: 090eeabd42228c9617be7eb15ca1b9f3dc56263843a0c4c4a68d5e163d9738b26cc1eb85b33edfef1913b208c386a83131012b527be865bea2392455339f6ba0
7
+ data.tar.gz: 666ae5c174fa32ba07b0b636f7e6c33b3850219c84d21c43c1bc15662c3db5088bdd4092f2348eb25b7534e48ab1f1a940e8d23263237c64d94cf12afe54e52d
data/Rakefile CHANGED
@@ -1,45 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require 'base'
3
4
  load 'neo4j/tasks/neo4j_server.rake'
4
5
  load 'neo4j/tasks/migration.rake'
5
- require 'base'
6
+ load 'bitcoin2graphdb/tasks/migration.rake'
6
7
 
7
8
  RSpec::Core::RakeTask.new(:spec)
8
9
 
9
10
  task :default => :spec
10
-
11
- namespace :b2g do
12
- desc 'Import specified block to neo4j database.'
13
- task :import_block, [:block_height,:config_path] do |task, args|
14
- puts "import #{args.block_height} block."
15
- get_migration(args.config_path).run_with_height(args.block_height.to_i)
16
- end
17
-
18
- desc 'Remove specified block from neo4j database.'
19
- task :remove_block, [:block_height,:config_path] do |task, args|
20
- puts "remove #{args.block_height} block."
21
- get_migration(args.config_path).remove_block(args.block_height.to_i)
22
- end
23
-
24
- desc 'Import specified transaction to neo4j database.'
25
- task :import_tx, [:txid,:config_path] do |task, args|
26
- get_migration(args.config_path).import_tx(args.txid)
27
- end
28
-
29
- desc 'Remove specified transaction from neo4j database.'
30
- task :remove_tx, [:txid,:config_path] do |task, args|
31
- get_migration(args.config_path).remove_tx(args.txid)
32
- end
33
-
34
- desc 'Repair specified transaction.'
35
- task :repair_tx, [:txid,:config_path] do |task, args|
36
- get_migration(args.config_path).remove_tx(args.txid)
37
- get_migration(args.config_path).import_tx(args.txid)
38
- end
39
-
40
- private
41
- def get_migration(config_path)
42
- config = YAML.load(File.read(config_path)).deep_symbolize_keys[:bitcoin2graphdb]
43
- Bitcoin2Graphdb::Migration.new(config)
44
- end
45
- end
@@ -0,0 +1,37 @@
1
+ require 'base'
2
+
3
+ namespace :b2g do
4
+ desc 'Import specified block to neo4j database.'
5
+ task :import_block, [:block_height,:config_path] do |task, args|
6
+ puts "import #{args.block_height} block."
7
+ get_migration(args.config_path).run_with_height(args.block_height.to_i)
8
+ end
9
+
10
+ desc 'Remove specified block from neo4j database.'
11
+ task :remove_block, [:block_height,:config_path] do |task, args|
12
+ puts "remove #{args.block_height} block."
13
+ get_migration(args.config_path).remove_block(args.block_height.to_i)
14
+ end
15
+
16
+ desc 'Import specified transaction to neo4j database.'
17
+ task :import_tx, [:txid,:config_path] do |task, args|
18
+ get_migration(args.config_path).import_tx(args.txid)
19
+ end
20
+
21
+ desc 'Remove specified transaction from neo4j database.'
22
+ task :remove_tx, [:txid,:config_path] do |task, args|
23
+ get_migration(args.config_path).remove_tx(args.txid)
24
+ end
25
+
26
+ desc 'Repair specified transaction.'
27
+ task :repair_tx, [:txid,:config_path] do |task, args|
28
+ get_migration(args.config_path).remove_tx(args.txid)
29
+ get_migration(args.config_path).import_tx(args.txid)
30
+ end
31
+
32
+ private
33
+ def get_migration(config_path)
34
+ config = YAML.load(File.read(config_path)).deep_symbolize_keys[:bitcoin2graphdb]
35
+ Bitcoin2Graphdb::Migration.new(config)
36
+ end
37
+ end
@@ -1,3 +1,3 @@
1
1
  module Bitcoin2Graphdb
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitcoin2graphdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
@@ -149,6 +149,7 @@ files:
149
149
  - lib/bitcoin2graphdb/bitcoin.rb
150
150
  - lib/bitcoin2graphdb/bitcoin/blockchain_provider.rb
151
151
  - lib/bitcoin2graphdb/migration.rb
152
+ - lib/bitcoin2graphdb/tasks/migration.rake
152
153
  - lib/bitcoin2graphdb/version.rb
153
154
  - lib/graphdb.rb
154
155
  - lib/graphdb/configuration.rb
@@ -184,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
185
  version: '0'
185
186
  requirements: []
186
187
  rubyforge_project:
187
- rubygems_version: 2.4.6
188
+ rubygems_version: 2.4.5
188
189
  signing_key:
189
190
  specification_version: 4
190
191
  summary: A tool for import Bitcoin blockchain data into neo4j database.