bitcoin2graphdb 0.2.7 → 0.2.8

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: 4a860441f109ff91f8fcf25b8a8bfed574857a34
4
- data.tar.gz: 7d243d250f0e56ece8ce0db7da40cd24c8fd3a07
3
+ metadata.gz: 1a25d7c3e0df7e46dea42c3679d604d70f70ae69
4
+ data.tar.gz: 0cf2fbe186da4cba65663b85676a64fd36393a95
5
5
  SHA512:
6
- metadata.gz: 16e71ad890801a35970f071ec69d287b8b2ec6bab2be89c4bc1cb89d768c595944598a2aef92062e9cf43ff9fed5a6392d74863de18a0b1fc337b58fb7f7868a
7
- data.tar.gz: e42de4a5eba93693ad497ca6c801979cc9ad55c844301aa6f2800297cca415b63fb59166fb34e391b6548e9c66a5a3ec9ec3caabdae7928ec27709513b33c516
6
+ metadata.gz: 68db0c05c3a3ddcf9c3c9a699d42ad8bfe2c0d4372b6342a50c89efbf044fb9ba92ebc88d8125f0fe64814085401a9030d10a788679efa03254c8ca83454c4c1
7
+ data.tar.gz: 53f05da93364eb9023cbef6a36a98b862d2fc06f068050da85dbaf23df7bfd1a34a543ce878c2103be56b5fca38373ff7da8e091a4018008685eee037f112b7d
data/README.md CHANGED
@@ -41,6 +41,7 @@ bitcoin2graphdb:
41
41
  schema: 'Bitcoin Core server schema. ex, http'
42
42
  port: 'Bitcoin Core server port. ex, 8332'
43
43
  host: 'Bitcoin Core server host. ex, xxx.xxx.xxx.xxx'
44
+ sleep_interval: 600
44
45
  neo4j:
45
46
  server: 'neo4j server url. ex, http://localhost:7474'
46
47
  basic_auth:
@@ -2,6 +2,8 @@ require 'base'
2
2
  module Bitcoin2Graphdb
3
3
  class Migration
4
4
 
5
+ attr_reader :sleep_interval
6
+
5
7
  def initialize(config)
6
8
  Graphdb.configure do |c|
7
9
  c.neo4j_server = config[:neo4j][:server]
@@ -10,6 +12,7 @@ module Bitcoin2Graphdb
10
12
  neo4j_config = {basic_auth: config[:neo4j][:basic_auth], initialize: {request: {timeout: 600, open_timeout: 5}}}
11
13
  Bitcoin2Graphdb::Bitcoin.provider = Bitcoin2Graphdb::Bitcoin::BlockchainProvider.new(config[:bitcoin])
12
14
  Neo4j::Session.open(:server_db, config[:neo4j][:server], neo4j_config)
15
+ @sleep_interval = config[:bitcoin][:sleep_interval].nil? ? 600 : config[:bitcoin][:sleep_interval].to_i
13
16
  end
14
17
 
15
18
  def run
@@ -26,8 +29,8 @@ module Bitcoin2Graphdb
26
29
  @block_height = block_height
27
30
  rescue OpenAssets::Provider::ApiError => e
28
31
  if e.message == '{"code"=>-8, "message"=>"Block height out of range"}'
29
- puts "Block height out of range. sleep 10 min."
30
- sleep 600
32
+ puts "Block height out of range. sleep #{@sleep_interval} seconds."
33
+ sleep @sleep_interval
31
34
  else
32
35
  tx.failure
33
36
  raise e
@@ -1,3 +1,3 @@
1
1
  module Bitcoin2Graphdb
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
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.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi