txcatcher 0.1.0 → 0.1.1

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: 19e98ad3469e868a632b24ac5b511e557be28c9c
4
- data.tar.gz: 83b80df4f5cd3b2367adfbc26e9782184c8901f7
3
+ metadata.gz: 905429921e61c985113797cc22de587a84bef52a
4
+ data.tar.gz: 9d9ee7f15920b8d95b8a379931ee75cf3068e4d6
5
5
  SHA512:
6
- metadata.gz: 6e5e8b687a4feb36016a0ebe7f8e07cb0c604dc9add1d31b6ce0ca412fa871f7222f45f102cef733017276277b301a52dd9f3de56a06deaa7581ef2eb1819cb5
7
- data.tar.gz: 8436da5751fdf20ce4ef8d45d0d58842d3f807e73ae8fe0b83412c919b41e1bccb47d2c780e07c5cc9d6ae3f083953e195ca73c8bc1dd8bbf2b370126a1f3efc
6
+ metadata.gz: 2cb6117d68704c5007ad9ca2ce3663352b156c782b7d0331e52a11c613f764a345e3677b962897951141fc8aa9116368e630382d9c0a693fa02c1076cc32c512
7
+ data.tar.gz: fca2fe045c48d8fa94d4a277bb7bdb3891d803dad52d7ba72279bd6767615ea546b58f631a54604562d1380fb3c9127f68523ebbecc878ed72379a37759ea9ca
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -121,15 +121,24 @@ module TxCatcher
121
121
  def connect_to_rpc_node
122
122
  n = TxCatcher::Config.rpcnode
123
123
  print "Checking #{n["name"]} RPC connection... "
124
- begin
125
- TxCatcher.rpc_node = BitcoinRPC.new("http://#{n["user"]}:#{n["password"]}@#{n["host"]}:#{n["port"]}")
126
- TxCatcher.current_block_height = TxCatcher.rpc_node.getblockcount
127
- print "balance: #{TxCatcher.rpc_node.getbalance}\n"
128
- print "current block height: #{TxCatcher.current_block_height}\n"
129
- rescue Errno::ECONNREFUSED
130
- print "ERROR, cannot connect using connection data #{n["name"]}\n"
131
- exit
124
+ TxCatcher.rpc_node = BitcoinRPC.new("http://#{n["user"]}:#{n["password"]}@#{n["host"]}:#{n["port"]}")
125
+
126
+ i = 0 # try to connect to RPC 100 times before exiting with error
127
+ until TxCatcher.current_block_height
128
+ begin
129
+ TxCatcher.current_block_height = TxCatcher.rpc_node.getblockcount
130
+ rescue Errno::ECONNREFUSED, BitcoinRPC::JSONRPCError => e
131
+ if i > 100
132
+ print "ERROR, cannot connect using connection data #{n["name"]}\n"
133
+ exit
134
+ else
135
+ print "Bitcoin RPC connection error: #{e.to_s}; will try again in 1 sec...\n"
136
+ i += 1
137
+ sleep 1
138
+ end
139
+ end
132
140
  end
141
+ print "current block height: #{TxCatcher.current_block_height}\n"
133
142
  end
134
143
 
135
144
  def run_migrations
data/txcatcher.gemspec ADDED
@@ -0,0 +1,92 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: txcatcher 0.1.1 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "txcatcher"
9
+ s.version = "0.1.1"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Roman Snitko"]
14
+ s.date = "2017-09-23"
15
+ s.description = "Ccurrently, the only job of this gem is to collect all new Bitcoin/Litecoin transactions, store them in a DB, index addresses."
16
+ s.email = "roman.snitko@gmail.com"
17
+ s.executables = ["txcatcher"]
18
+ s.extra_rdoc_files = [
19
+ "LICENSE.txt",
20
+ "README.md"
21
+ ]
22
+ s.files = [
23
+ ".document",
24
+ ".rspec",
25
+ "Gemfile",
26
+ "Gemfile.lock",
27
+ "LICENSE.txt",
28
+ "README.md",
29
+ "Rakefile",
30
+ "VERSION",
31
+ "bin/txcatcher",
32
+ "db/migrations/001_create_transactions.rb",
33
+ "db/migrations/002_create_addresses.rb",
34
+ "db/migrations/003_create_deposits.rb",
35
+ "db/schema.rb",
36
+ "lib/tasks/db.rake",
37
+ "lib/txcatcher.rb",
38
+ "lib/txcatcher/bitcoin_rpc.rb",
39
+ "lib/txcatcher/catcher.rb",
40
+ "lib/txcatcher/cleaner.rb",
41
+ "lib/txcatcher/config.rb",
42
+ "lib/txcatcher/initializer.rb",
43
+ "lib/txcatcher/models/address.rb",
44
+ "lib/txcatcher/models/deposit.rb",
45
+ "lib/txcatcher/models/transaction.rb",
46
+ "lib/txcatcher/server.rb",
47
+ "lib/txcatcher/utils/hash_string_to_sym_keys.rb",
48
+ "spec/catcher_spec.rb",
49
+ "spec/cleaner_spec.rb",
50
+ "spec/config/config.yml",
51
+ "spec/config/txcatcher_test.db",
52
+ "spec/fixtures/transaction.txt",
53
+ "spec/fixtures/transaction_decoded_no_outputs.txt",
54
+ "spec/models/address_spec.rb",
55
+ "spec/models/transaction_spec.rb",
56
+ "spec/spec_helper.rb",
57
+ "templates/config.yml",
58
+ "txcatcher.gemspec"
59
+ ]
60
+ s.homepage = "http://github.com/snitko/txcatcher"
61
+ s.licenses = ["MIT"]
62
+ s.rubygems_version = "2.5.1"
63
+ s.summary = "An lightweight version of Bitpay's Insight, allows to check Bitcoin/Litecoin addresses"
64
+
65
+ if s.respond_to? :specification_version then
66
+ s.specification_version = 4
67
+
68
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
69
+ s.add_runtime_dependency(%q<goliath>, [">= 0"])
70
+ s.add_runtime_dependency(%q<sequel>, [">= 0"])
71
+ s.add_runtime_dependency(%q<ffi-rzmq>, [">= 0"])
72
+ s.add_runtime_dependency(%q<satoshi-unit>, [">= 0"])
73
+ s.add_development_dependency(%q<bundler>, [">= 0"])
74
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
75
+ else
76
+ s.add_dependency(%q<goliath>, [">= 0"])
77
+ s.add_dependency(%q<sequel>, [">= 0"])
78
+ s.add_dependency(%q<ffi-rzmq>, [">= 0"])
79
+ s.add_dependency(%q<satoshi-unit>, [">= 0"])
80
+ s.add_dependency(%q<bundler>, [">= 0"])
81
+ s.add_dependency(%q<jeweler>, [">= 0"])
82
+ end
83
+ else
84
+ s.add_dependency(%q<goliath>, [">= 0"])
85
+ s.add_dependency(%q<sequel>, [">= 0"])
86
+ s.add_dependency(%q<ffi-rzmq>, [">= 0"])
87
+ s.add_dependency(%q<satoshi-unit>, [">= 0"])
88
+ s.add_dependency(%q<bundler>, [">= 0"])
89
+ s.add_dependency(%q<jeweler>, [">= 0"])
90
+ end
91
+ end
92
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txcatcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko
@@ -139,6 +139,7 @@ files:
139
139
  - spec/models/transaction_spec.rb
140
140
  - spec/spec_helper.rb
141
141
  - templates/config.yml
142
+ - txcatcher.gemspec
142
143
  homepage: http://github.com/snitko/txcatcher
143
144
  licenses:
144
145
  - MIT