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 +4 -4
- data/README.md +1 -0
- data/lib/bitcoin2graphdb/migration.rb +5 -2
- data/lib/bitcoin2graphdb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a25d7c3e0df7e46dea42c3679d604d70f70ae69
|
4
|
+
data.tar.gz: 0cf2fbe186da4cba65663b85676a64fd36393a95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
30
|
-
sleep
|
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
|