bitcoin-ruby 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.travis.yml +2 -7
  4. data/COPYING +1 -1
  5. data/Gemfile +2 -6
  6. data/Gemfile.lock +34 -0
  7. data/README.rdoc +16 -68
  8. data/Rakefile +3 -6
  9. data/bin/bitcoin_shell +0 -1
  10. data/{concept-examples/blockchain-pow.rb → examples/concept-blockchain-pow.rb} +0 -0
  11. data/lib/bitcoin.rb +350 -296
  12. data/lib/bitcoin/builder.rb +3 -1
  13. data/lib/bitcoin/connection.rb +2 -1
  14. data/lib/bitcoin/contracthash.rb +76 -0
  15. data/lib/bitcoin/dogecoin.rb +97 -0
  16. data/lib/bitcoin/ffi/bitcoinconsensus.rb +74 -0
  17. data/lib/bitcoin/ffi/openssl.rb +98 -2
  18. data/lib/bitcoin/ffi/secp256k1.rb +144 -0
  19. data/lib/bitcoin/key.rb +12 -2
  20. data/lib/bitcoin/logger.rb +3 -12
  21. data/lib/bitcoin/protocol/block.rb +3 -9
  22. data/lib/bitcoin/protocol/parser.rb +6 -2
  23. data/lib/bitcoin/protocol/tx.rb +44 -13
  24. data/lib/bitcoin/protocol/txin.rb +4 -2
  25. data/lib/bitcoin/protocol/txout.rb +2 -2
  26. data/lib/bitcoin/script.rb +212 -37
  27. data/lib/bitcoin/trezor/mnemonic.rb +130 -0
  28. data/lib/bitcoin/version.rb +1 -1
  29. data/spec/bitcoin/bitcoin_spec.rb +32 -3
  30. data/spec/bitcoin/builder_spec.rb +18 -0
  31. data/spec/bitcoin/contracthash_spec.rb +45 -0
  32. data/spec/bitcoin/dogecoin_spec.rb +176 -0
  33. data/spec/bitcoin/ffi_openssl.rb +45 -0
  34. data/spec/bitcoin/fixtures/156e6e1b84c5c3bd3a0927b25e4119fadce6e6d5186f363317511d1d680fae9a.json +24 -0
  35. data/spec/bitcoin/fixtures/8d0b238a06b5a70be75d543902d02d7a514d68d3252a949a513865ac3538874c.json +24 -0
  36. data/spec/bitcoin/fixtures/coinbase-toshi.json +33 -0
  37. data/spec/bitcoin/fixtures/coinbase.json +24 -0
  38. data/spec/bitcoin/fixtures/dogecoin-block-60323982f9c5ff1b5a954eac9dc1269352835f47c2c5222691d80f0d50dcf053.bin +0 -0
  39. data/spec/bitcoin/fixtures/rawtx-01-toshi.json +46 -0
  40. data/spec/bitcoin/fixtures/rawtx-02-toshi.json +46 -0
  41. data/spec/bitcoin/fixtures/rawtx-03-toshi.json +73 -0
  42. data/spec/bitcoin/fixtures/rawtx-testnet-04fdc38d6722ab4b12d79113fc4b2896bdcc5169710690ee4e78541b98e467b4.bin +0 -0
  43. data/spec/bitcoin/fixtures/rawtx-testnet-0b294c7d11dd21bcccb8393e6744fed7d4d1981a08c00e3e88838cc421f33c9f.bin +0 -0
  44. data/spec/bitcoin/fixtures/rawtx-testnet-3bc52ac063291ad92d95ddda5fd776a342083b95607ad32ed8bc6f8f7d30449e.bin +0 -0
  45. data/spec/bitcoin/fixtures/rawtx-testnet-6f0bbdd4e71a8af4305018d738184df32dbb6f27284fdebd5b56d16947f7c181.bin +0 -0
  46. data/spec/bitcoin/fixtures/rawtx-testnet-a7c9b06e275e8674cc19a5f7d3e557c72c6d93576e635b33212dbe08ab7cdb60.bin +0 -0
  47. data/spec/bitcoin/fixtures/rawtx-testnet-f80acbd2f594d04ddb0e1cacba662132104909157dff526935a3c88abe9201a5.bin +0 -0
  48. data/spec/bitcoin/protocol/block_spec.rb +0 -22
  49. data/spec/bitcoin/protocol/tx_spec.rb +145 -2
  50. data/spec/bitcoin/script/script_spec.rb +282 -0
  51. data/spec/bitcoin/secp256k1_spec.rb +48 -0
  52. data/spec/bitcoin/spec_helper.rb +0 -51
  53. data/spec/bitcoin/trezor/mnemonic_spec.rb +161 -0
  54. metadata +48 -98
  55. data/bin/bitcoin_dns_seed +0 -130
  56. data/bin/bitcoin_gui +0 -80
  57. data/bin/bitcoin_node +0 -153
  58. data/bin/bitcoin_node_cli +0 -81
  59. data/bin/bitcoin_wallet +0 -402
  60. data/doc/CONFIG.rdoc +0 -66
  61. data/doc/EXAMPLES.rdoc +0 -13
  62. data/doc/NAMECOIN.rdoc +0 -34
  63. data/doc/NODE.rdoc +0 -225
  64. data/doc/STORAGE.rdoc +0 -33
  65. data/doc/WALLET.rdoc +0 -102
  66. data/examples/balance.rb +0 -66
  67. data/examples/forwarder.rb +0 -73
  68. data/examples/index_nhash.rb +0 -24
  69. data/examples/reindex_p2sh_addrs.rb +0 -44
  70. data/examples/relay_tx.rb +0 -22
  71. data/examples/verify_tx.rb +0 -57
  72. data/lib/bitcoin/config.rb +0 -58
  73. data/lib/bitcoin/gui/addr_view.rb +0 -44
  74. data/lib/bitcoin/gui/bitcoin-ruby.png +0 -0
  75. data/lib/bitcoin/gui/bitcoin-ruby.svg +0 -80
  76. data/lib/bitcoin/gui/conn_view.rb +0 -38
  77. data/lib/bitcoin/gui/connection.rb +0 -70
  78. data/lib/bitcoin/gui/em_gtk.rb +0 -30
  79. data/lib/bitcoin/gui/gui.builder +0 -1643
  80. data/lib/bitcoin/gui/gui.rb +0 -292
  81. data/lib/bitcoin/gui/helpers.rb +0 -115
  82. data/lib/bitcoin/gui/tree_view.rb +0 -84
  83. data/lib/bitcoin/gui/tx_view.rb +0 -69
  84. data/lib/bitcoin/namecoin.rb +0 -280
  85. data/lib/bitcoin/network/command_client.rb +0 -104
  86. data/lib/bitcoin/network/command_handler.rb +0 -570
  87. data/lib/bitcoin/network/connection_handler.rb +0 -387
  88. data/lib/bitcoin/network/node.rb +0 -565
  89. data/lib/bitcoin/storage/dummy/dummy_store.rb +0 -179
  90. data/lib/bitcoin/storage/models.rb +0 -171
  91. data/lib/bitcoin/storage/sequel/migrations.rb +0 -99
  92. data/lib/bitcoin/storage/sequel/migrations/001_base_schema.rb +0 -52
  93. data/lib/bitcoin/storage/sequel/migrations/002_tx.rb +0 -45
  94. data/lib/bitcoin/storage/sequel/migrations/003_change_txin_script_sig_to_blob.rb +0 -18
  95. data/lib/bitcoin/storage/sequel/migrations/004_change_txin_prev_out_to_blob.rb +0 -18
  96. data/lib/bitcoin/storage/sequel/migrations/005_change_tx_hash_to_bytea.rb +0 -14
  97. data/lib/bitcoin/storage/sequel/migrations/006_add_tx_nhash.rb +0 -31
  98. data/lib/bitcoin/storage/sequel/migrations/007_add_prev_out_index_index.rb +0 -16
  99. data/lib/bitcoin/storage/sequel/migrations/008_add_txin_p2sh_type.rb +0 -31
  100. data/lib/bitcoin/storage/sequel/migrations/009_add_addrs_type.rb +0 -56
  101. data/lib/bitcoin/storage/sequel/sequel_store.rb +0 -551
  102. data/lib/bitcoin/storage/storage.rb +0 -517
  103. data/lib/bitcoin/storage/utxo/migrations/001_base_schema.rb +0 -52
  104. data/lib/bitcoin/storage/utxo/migrations/002_utxo.rb +0 -18
  105. data/lib/bitcoin/storage/utxo/migrations/003_update_indices.rb +0 -14
  106. data/lib/bitcoin/storage/utxo/migrations/004_add_addrs_type.rb +0 -14
  107. data/lib/bitcoin/storage/utxo/utxo_store.rb +0 -374
  108. data/lib/bitcoin/validation.rb +0 -400
  109. data/lib/bitcoin/wallet/coinselector.rb +0 -33
  110. data/lib/bitcoin/wallet/keygenerator.rb +0 -77
  111. data/lib/bitcoin/wallet/keystore.rb +0 -207
  112. data/lib/bitcoin/wallet/txdp.rb +0 -118
  113. data/lib/bitcoin/wallet/wallet.rb +0 -281
  114. data/spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.bin +0 -0
  115. data/spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.json +0 -43
  116. data/spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.bin +0 -0
  117. data/spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.json +0 -67
  118. data/spec/bitcoin/namecoin_spec.rb +0 -182
  119. data/spec/bitcoin/node/command_api_spec.rb +0 -663
  120. data/spec/bitcoin/storage/models_spec.rb +0 -104
  121. data/spec/bitcoin/storage/reorg_spec.rb +0 -236
  122. data/spec/bitcoin/storage/storage_spec.rb +0 -387
  123. data/spec/bitcoin/storage/validation_spec.rb +0 -300
  124. data/spec/bitcoin/wallet/coinselector_spec.rb +0 -38
  125. data/spec/bitcoin/wallet/keygenerator_spec.rb +0 -69
  126. data/spec/bitcoin/wallet/keystore_spec.rb +0 -190
  127. data/spec/bitcoin/wallet/txdp_spec.rb +0 -76
  128. data/spec/bitcoin/wallet/wallet_spec.rb +0 -238
metadata CHANGED
@@ -1,25 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitcoin-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - lian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2015-06-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a ruby library for interacting with the bitcoin protocol/network
14
14
  email:
15
15
  - meta.rb@gmail.com
16
16
  executables:
17
- - bitcoin_dns_seed
18
- - bitcoin_gui
19
- - bitcoin_node
20
- - bitcoin_node_cli
21
17
  - bitcoin_shell
22
- - bitcoin_wallet
23
18
  extensions: []
24
19
  extra_rdoc_files: []
25
20
  files:
@@ -27,57 +22,28 @@ files:
27
22
  - ".travis.yml"
28
23
  - COPYING
29
24
  - Gemfile
25
+ - Gemfile.lock
30
26
  - README.rdoc
31
27
  - Rakefile
32
- - bin/bitcoin_dns_seed
33
- - bin/bitcoin_gui
34
- - bin/bitcoin_node
35
- - bin/bitcoin_node_cli
36
28
  - bin/bitcoin_shell
37
- - bin/bitcoin_wallet
38
29
  - bitcoin-ruby.gemspec
39
- - concept-examples/blockchain-pow.rb
40
- - doc/CONFIG.rdoc
41
- - doc/EXAMPLES.rdoc
42
- - doc/NAMECOIN.rdoc
43
- - doc/NODE.rdoc
44
- - doc/STORAGE.rdoc
45
- - doc/WALLET.rdoc
46
- - examples/balance.rb
47
30
  - examples/bbe_verify_tx.rb
31
+ - examples/concept-blockchain-pow.rb
48
32
  - examples/connect.rb
49
- - examples/forwarder.rb
50
33
  - examples/generate_tx.rb
51
- - examples/index_nhash.rb
52
- - examples/reindex_p2sh_addrs.rb
53
- - examples/relay_tx.rb
54
34
  - examples/simple_network_monitor_and_util.rb
55
- - examples/verify_tx.rb
56
35
  - lib/bitcoin.rb
57
36
  - lib/bitcoin/builder.rb
58
- - lib/bitcoin/config.rb
59
37
  - lib/bitcoin/connection.rb
38
+ - lib/bitcoin/contracthash.rb
39
+ - lib/bitcoin/dogecoin.rb
60
40
  - lib/bitcoin/electrum/mnemonic.rb
41
+ - lib/bitcoin/ffi/bitcoinconsensus.rb
61
42
  - lib/bitcoin/ffi/openssl.rb
62
- - lib/bitcoin/gui/addr_view.rb
63
- - lib/bitcoin/gui/bitcoin-ruby.png
64
- - lib/bitcoin/gui/bitcoin-ruby.svg
65
- - lib/bitcoin/gui/conn_view.rb
66
- - lib/bitcoin/gui/connection.rb
67
- - lib/bitcoin/gui/em_gtk.rb
68
- - lib/bitcoin/gui/gui.builder
69
- - lib/bitcoin/gui/gui.rb
70
- - lib/bitcoin/gui/helpers.rb
71
- - lib/bitcoin/gui/tree_view.rb
72
- - lib/bitcoin/gui/tx_view.rb
43
+ - lib/bitcoin/ffi/secp256k1.rb
73
44
  - lib/bitcoin/key.rb
74
45
  - lib/bitcoin/litecoin.rb
75
46
  - lib/bitcoin/logger.rb
76
- - lib/bitcoin/namecoin.rb
77
- - lib/bitcoin/network/command_client.rb
78
- - lib/bitcoin/network/command_handler.rb
79
- - lib/bitcoin/network/connection_handler.rb
80
- - lib/bitcoin/network/node.rb
81
47
  - lib/bitcoin/protocol.rb
82
48
  - lib/bitcoin/protocol/address.rb
83
49
  - lib/bitcoin/protocol/alert.rb
@@ -90,38 +56,18 @@ files:
90
56
  - lib/bitcoin/protocol/txout.rb
91
57
  - lib/bitcoin/protocol/version.rb
92
58
  - lib/bitcoin/script.rb
93
- - lib/bitcoin/storage/dummy/dummy_store.rb
94
- - lib/bitcoin/storage/models.rb
95
- - lib/bitcoin/storage/sequel/migrations.rb
96
- - lib/bitcoin/storage/sequel/migrations/001_base_schema.rb
97
- - lib/bitcoin/storage/sequel/migrations/002_tx.rb
98
- - lib/bitcoin/storage/sequel/migrations/003_change_txin_script_sig_to_blob.rb
99
- - lib/bitcoin/storage/sequel/migrations/004_change_txin_prev_out_to_blob.rb
100
- - lib/bitcoin/storage/sequel/migrations/005_change_tx_hash_to_bytea.rb
101
- - lib/bitcoin/storage/sequel/migrations/006_add_tx_nhash.rb
102
- - lib/bitcoin/storage/sequel/migrations/007_add_prev_out_index_index.rb
103
- - lib/bitcoin/storage/sequel/migrations/008_add_txin_p2sh_type.rb
104
- - lib/bitcoin/storage/sequel/migrations/009_add_addrs_type.rb
105
- - lib/bitcoin/storage/sequel/sequel_store.rb
106
- - lib/bitcoin/storage/storage.rb
107
- - lib/bitcoin/storage/utxo/migrations/001_base_schema.rb
108
- - lib/bitcoin/storage/utxo/migrations/002_utxo.rb
109
- - lib/bitcoin/storage/utxo/migrations/003_update_indices.rb
110
- - lib/bitcoin/storage/utxo/migrations/004_add_addrs_type.rb
111
- - lib/bitcoin/storage/utxo/utxo_store.rb
112
- - lib/bitcoin/validation.rb
59
+ - lib/bitcoin/trezor/mnemonic.rb
113
60
  - lib/bitcoin/version.rb
114
- - lib/bitcoin/wallet/coinselector.rb
115
- - lib/bitcoin/wallet/keygenerator.rb
116
- - lib/bitcoin/wallet/keystore.rb
117
- - lib/bitcoin/wallet/txdp.rb
118
- - lib/bitcoin/wallet/wallet.rb
119
61
  - spec/bitcoin/bitcoin_spec.rb
120
62
  - spec/bitcoin/builder_spec.rb
63
+ - spec/bitcoin/contracthash_spec.rb
64
+ - spec/bitcoin/dogecoin_spec.rb
65
+ - spec/bitcoin/ffi_openssl.rb
121
66
  - spec/bitcoin/fixtures/000000000000056b1a3d84a1e2b33cde8915a4b61c0cae14fca6d3e1490b4f98.json
122
67
  - spec/bitcoin/fixtures/03d7e1fa4d5fefa169431f24f7798552861b255cd55d377066fedcd088fb0e99.json
123
68
  - spec/bitcoin/fixtures/0961c660358478829505e16a1f028757e54b5bbf9758341a7546573738f31429.json
124
69
  - spec/bitcoin/fixtures/0f24294a1d23efbb49c1765cf443fba7930702752aba6d765870082fe4f13cae.json
70
+ - spec/bitcoin/fixtures/156e6e1b84c5c3bd3a0927b25e4119fadce6e6d5186f363317511d1d680fae9a.json
125
71
  - spec/bitcoin/fixtures/23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63.json
126
72
  - spec/bitcoin/fixtures/315ac7d4c26d69668129cc352851d9389b4a6868f1509c6c8b66bead11e2619f.json
127
73
  - spec/bitcoin/fixtures/35e2001b428891fefa0bfb73167c7360669d3cbd7b3aa78e7cad125ddfc51131.json
@@ -133,17 +79,17 @@ files:
133
79
  - spec/bitcoin/fixtures/69216b8aaa35b76d6613e5f527f4858640d986e1046238583bdad79b35e938dc.json
134
80
  - spec/bitcoin/fixtures/7208e5edf525f04e705fb3390194e316205b8f995c8c9fcd8c6093abe04fa27d.json
135
81
  - spec/bitcoin/fixtures/761d8c5210fdfd505f6dff38f740ae3728eb93d7d0971fb433f685d40a4c04f6.json
82
+ - spec/bitcoin/fixtures/8d0b238a06b5a70be75d543902d02d7a514d68d3252a949a513865ac3538874c.json
136
83
  - spec/bitcoin/fixtures/aea682d68a3ea5e3583e088dcbd699a5d44d4b083f02ad0aaf2598fe1fa4dfd4.json
137
84
  - spec/bitcoin/fixtures/bc179baab547b7d7c1d5d8d6f8b0cc6318eaa4b0dd0a093ad6ac7f5a1cb6b3ba.json
138
85
  - spec/bitcoin/fixtures/bd1715f1abfdc62bea3f605bdb461b3ba1f2cca6ec0d73a18a548b7717ca8531.json
139
86
  - spec/bitcoin/fixtures/block-testnet-0000000000ac85bb2530a05a4214a387e6be02b22d3348abc5e7a5d9c4ce8dab.bin
140
87
  - spec/bitcoin/fixtures/cd874fa8cb0e2ec2d385735d5e1fd482c4fe648533efb4c50ee53bda58e15ae2.json
141
88
  - spec/bitcoin/fixtures/ce5fad9b4ef094d8f4937b0707edaf0a6e6ceeaf67d5edbfd51f660eac8f398b.json
89
+ - spec/bitcoin/fixtures/coinbase-toshi.json
90
+ - spec/bitcoin/fixtures/coinbase.json
91
+ - spec/bitcoin/fixtures/dogecoin-block-60323982f9c5ff1b5a954eac9dc1269352835f47c2c5222691d80f0d50dcf053.bin
142
92
  - spec/bitcoin/fixtures/f003f0c1193019db2497a675fd05d9f2edddf9b67c59e677c48d3dbd4ed5f00b.json
143
- - spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.bin
144
- - spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.json
145
- - spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.bin
146
- - spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.json
147
93
  - spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.bin
148
94
  - spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.json
149
95
  - spec/bitcoin/fixtures/litecoin-genesis-block-12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2.bin
@@ -163,10 +109,13 @@ files:
163
109
  - spec/bitcoin/fixtures/rawblock-testnet-26478.bin
164
110
  - spec/bitcoin/fixtures/rawblock-testnet-26478.json
165
111
  - spec/bitcoin/fixtures/rawblock-testnet-265322.bin
112
+ - spec/bitcoin/fixtures/rawtx-01-toshi.json
166
113
  - spec/bitcoin/fixtures/rawtx-01.bin
167
114
  - spec/bitcoin/fixtures/rawtx-01.json
115
+ - spec/bitcoin/fixtures/rawtx-02-toshi.json
168
116
  - spec/bitcoin/fixtures/rawtx-02.bin
169
117
  - spec/bitcoin/fixtures/rawtx-02.json
118
+ - spec/bitcoin/fixtures/rawtx-03-toshi.json
170
119
  - spec/bitcoin/fixtures/rawtx-03.bin
171
120
  - spec/bitcoin/fixtures/rawtx-03.json
172
121
  - spec/bitcoin/fixtures/rawtx-04.json
@@ -182,9 +131,15 @@ files:
182
131
  - spec/bitcoin/fixtures/rawtx-c99c49da4c38af669dea436d3e73780dfdb6c1ecf9958baa52960e8baee30e73.json
183
132
  - spec/bitcoin/fixtures/rawtx-de35d060663750b3975b7997bde7fb76307cec5b270d12fcd9c4ad98b279c28c.json
184
133
  - spec/bitcoin/fixtures/rawtx-f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16.bin
134
+ - spec/bitcoin/fixtures/rawtx-testnet-04fdc38d6722ab4b12d79113fc4b2896bdcc5169710690ee4e78541b98e467b4.bin
135
+ - spec/bitcoin/fixtures/rawtx-testnet-0b294c7d11dd21bcccb8393e6744fed7d4d1981a08c00e3e88838cc421f33c9f.bin
136
+ - spec/bitcoin/fixtures/rawtx-testnet-3bc52ac063291ad92d95ddda5fd776a342083b95607ad32ed8bc6f8f7d30449e.bin
137
+ - spec/bitcoin/fixtures/rawtx-testnet-6f0bbdd4e71a8af4305018d738184df32dbb6f27284fdebd5b56d16947f7c181.bin
185
138
  - spec/bitcoin/fixtures/rawtx-testnet-a220adf1902c46a39db25a24bc4178b6a88440f977a7e2cabfdd8b5c1dd35cfb.json
139
+ - spec/bitcoin/fixtures/rawtx-testnet-a7c9b06e275e8674cc19a5f7d3e557c72c6d93576e635b33212dbe08ab7cdb60.bin
186
140
  - spec/bitcoin/fixtures/rawtx-testnet-e232e0055dbdca88bbaa79458683195a0b7c17c5b6c524a8d146721d4d4d652f.bin
187
141
  - spec/bitcoin/fixtures/rawtx-testnet-e232e0055dbdca88bbaa79458683195a0b7c17c5b6c524a8d146721d4d4d652f.json
142
+ - spec/bitcoin/fixtures/rawtx-testnet-f80acbd2f594d04ddb0e1cacba662132104909157dff526935a3c88abe9201a5.bin
188
143
  - spec/bitcoin/fixtures/reorg/blk_0_to_4.dat
189
144
  - spec/bitcoin/fixtures/reorg/blk_3A.dat
190
145
  - spec/bitcoin/fixtures/reorg/blk_4A.dat
@@ -249,9 +204,7 @@ files:
249
204
  - spec/bitcoin/fixtures/txscript-invalid-too-many-sigops-followed-by-invalid-pushdata.bin
250
205
  - spec/bitcoin/helpers/fake_blockchain.rb
251
206
  - spec/bitcoin/key_spec.rb
252
- - spec/bitcoin/namecoin_spec.rb
253
207
  - spec/bitcoin/network_spec.rb
254
- - spec/bitcoin/node/command_api_spec.rb
255
208
  - spec/bitcoin/performance/storage_spec.rb
256
209
  - spec/bitcoin/protocol/addr_spec.rb
257
210
  - spec/bitcoin/protocol/alert_spec.rb
@@ -267,16 +220,9 @@ files:
267
220
  - spec/bitcoin/protocol/version_spec.rb
268
221
  - spec/bitcoin/script/opcodes_spec.rb
269
222
  - spec/bitcoin/script/script_spec.rb
223
+ - spec/bitcoin/secp256k1_spec.rb
270
224
  - spec/bitcoin/spec_helper.rb
271
- - spec/bitcoin/storage/models_spec.rb
272
- - spec/bitcoin/storage/reorg_spec.rb
273
- - spec/bitcoin/storage/storage_spec.rb
274
- - spec/bitcoin/storage/validation_spec.rb
275
- - spec/bitcoin/wallet/coinselector_spec.rb
276
- - spec/bitcoin/wallet/keygenerator_spec.rb
277
- - spec/bitcoin/wallet/keystore_spec.rb
278
- - spec/bitcoin/wallet/txdp_spec.rb
279
- - spec/bitcoin/wallet/wallet_spec.rb
225
+ - spec/bitcoin/trezor/mnemonic_spec.rb
280
226
  homepage: https://github.com/lian/bitcoin-ruby
281
227
  licenses: []
282
228
  metadata: {}
@@ -296,17 +242,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
242
  version: 1.3.6
297
243
  requirements: []
298
244
  rubyforge_project: bitcoin-ruby
299
- rubygems_version: 2.2.2
245
+ rubygems_version: 2.4.5
300
246
  signing_key:
301
247
  specification_version: 4
302
248
  summary: bitcoin utils and protocol in ruby
303
249
  test_files:
304
250
  - spec/bitcoin/bitcoin_spec.rb
305
251
  - spec/bitcoin/builder_spec.rb
252
+ - spec/bitcoin/contracthash_spec.rb
253
+ - spec/bitcoin/dogecoin_spec.rb
254
+ - spec/bitcoin/ffi_openssl.rb
306
255
  - spec/bitcoin/fixtures/000000000000056b1a3d84a1e2b33cde8915a4b61c0cae14fca6d3e1490b4f98.json
307
256
  - spec/bitcoin/fixtures/03d7e1fa4d5fefa169431f24f7798552861b255cd55d377066fedcd088fb0e99.json
308
257
  - spec/bitcoin/fixtures/0961c660358478829505e16a1f028757e54b5bbf9758341a7546573738f31429.json
309
258
  - spec/bitcoin/fixtures/0f24294a1d23efbb49c1765cf443fba7930702752aba6d765870082fe4f13cae.json
259
+ - spec/bitcoin/fixtures/156e6e1b84c5c3bd3a0927b25e4119fadce6e6d5186f363317511d1d680fae9a.json
310
260
  - spec/bitcoin/fixtures/23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63.json
311
261
  - spec/bitcoin/fixtures/315ac7d4c26d69668129cc352851d9389b4a6868f1509c6c8b66bead11e2619f.json
312
262
  - spec/bitcoin/fixtures/35e2001b428891fefa0bfb73167c7360669d3cbd7b3aa78e7cad125ddfc51131.json
@@ -318,17 +268,17 @@ test_files:
318
268
  - spec/bitcoin/fixtures/69216b8aaa35b76d6613e5f527f4858640d986e1046238583bdad79b35e938dc.json
319
269
  - spec/bitcoin/fixtures/7208e5edf525f04e705fb3390194e316205b8f995c8c9fcd8c6093abe04fa27d.json
320
270
  - spec/bitcoin/fixtures/761d8c5210fdfd505f6dff38f740ae3728eb93d7d0971fb433f685d40a4c04f6.json
271
+ - spec/bitcoin/fixtures/8d0b238a06b5a70be75d543902d02d7a514d68d3252a949a513865ac3538874c.json
321
272
  - spec/bitcoin/fixtures/aea682d68a3ea5e3583e088dcbd699a5d44d4b083f02ad0aaf2598fe1fa4dfd4.json
322
273
  - spec/bitcoin/fixtures/bc179baab547b7d7c1d5d8d6f8b0cc6318eaa4b0dd0a093ad6ac7f5a1cb6b3ba.json
323
274
  - spec/bitcoin/fixtures/bd1715f1abfdc62bea3f605bdb461b3ba1f2cca6ec0d73a18a548b7717ca8531.json
324
275
  - spec/bitcoin/fixtures/block-testnet-0000000000ac85bb2530a05a4214a387e6be02b22d3348abc5e7a5d9c4ce8dab.bin
325
276
  - spec/bitcoin/fixtures/cd874fa8cb0e2ec2d385735d5e1fd482c4fe648533efb4c50ee53bda58e15ae2.json
326
277
  - spec/bitcoin/fixtures/ce5fad9b4ef094d8f4937b0707edaf0a6e6ceeaf67d5edbfd51f660eac8f398b.json
278
+ - spec/bitcoin/fixtures/coinbase-toshi.json
279
+ - spec/bitcoin/fixtures/coinbase.json
280
+ - spec/bitcoin/fixtures/dogecoin-block-60323982f9c5ff1b5a954eac9dc1269352835f47c2c5222691d80f0d50dcf053.bin
327
281
  - spec/bitcoin/fixtures/f003f0c1193019db2497a675fd05d9f2edddf9b67c59e677c48d3dbd4ed5f00b.json
328
- - spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.bin
329
- - spec/bitcoin/fixtures/freicoin-block-000000005d231b285e63af83edae2d8f5e50e70d396468643092b9239fd3be3c.json
330
- - spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.bin
331
- - spec/bitcoin/fixtures/freicoin-genesis-block-000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c.json
332
282
  - spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.bin
333
283
  - spec/bitcoin/fixtures/litecoin-block-80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f.json
334
284
  - spec/bitcoin/fixtures/litecoin-genesis-block-12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2.bin
@@ -348,10 +298,13 @@ test_files:
348
298
  - spec/bitcoin/fixtures/rawblock-testnet-26478.bin
349
299
  - spec/bitcoin/fixtures/rawblock-testnet-26478.json
350
300
  - spec/bitcoin/fixtures/rawblock-testnet-265322.bin
301
+ - spec/bitcoin/fixtures/rawtx-01-toshi.json
351
302
  - spec/bitcoin/fixtures/rawtx-01.bin
352
303
  - spec/bitcoin/fixtures/rawtx-01.json
304
+ - spec/bitcoin/fixtures/rawtx-02-toshi.json
353
305
  - spec/bitcoin/fixtures/rawtx-02.bin
354
306
  - spec/bitcoin/fixtures/rawtx-02.json
307
+ - spec/bitcoin/fixtures/rawtx-03-toshi.json
355
308
  - spec/bitcoin/fixtures/rawtx-03.bin
356
309
  - spec/bitcoin/fixtures/rawtx-03.json
357
310
  - spec/bitcoin/fixtures/rawtx-04.json
@@ -367,9 +320,15 @@ test_files:
367
320
  - spec/bitcoin/fixtures/rawtx-c99c49da4c38af669dea436d3e73780dfdb6c1ecf9958baa52960e8baee30e73.json
368
321
  - spec/bitcoin/fixtures/rawtx-de35d060663750b3975b7997bde7fb76307cec5b270d12fcd9c4ad98b279c28c.json
369
322
  - spec/bitcoin/fixtures/rawtx-f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16.bin
323
+ - spec/bitcoin/fixtures/rawtx-testnet-04fdc38d6722ab4b12d79113fc4b2896bdcc5169710690ee4e78541b98e467b4.bin
324
+ - spec/bitcoin/fixtures/rawtx-testnet-0b294c7d11dd21bcccb8393e6744fed7d4d1981a08c00e3e88838cc421f33c9f.bin
325
+ - spec/bitcoin/fixtures/rawtx-testnet-3bc52ac063291ad92d95ddda5fd776a342083b95607ad32ed8bc6f8f7d30449e.bin
326
+ - spec/bitcoin/fixtures/rawtx-testnet-6f0bbdd4e71a8af4305018d738184df32dbb6f27284fdebd5b56d16947f7c181.bin
370
327
  - spec/bitcoin/fixtures/rawtx-testnet-a220adf1902c46a39db25a24bc4178b6a88440f977a7e2cabfdd8b5c1dd35cfb.json
328
+ - spec/bitcoin/fixtures/rawtx-testnet-a7c9b06e275e8674cc19a5f7d3e557c72c6d93576e635b33212dbe08ab7cdb60.bin
371
329
  - spec/bitcoin/fixtures/rawtx-testnet-e232e0055dbdca88bbaa79458683195a0b7c17c5b6c524a8d146721d4d4d652f.bin
372
330
  - spec/bitcoin/fixtures/rawtx-testnet-e232e0055dbdca88bbaa79458683195a0b7c17c5b6c524a8d146721d4d4d652f.json
331
+ - spec/bitcoin/fixtures/rawtx-testnet-f80acbd2f594d04ddb0e1cacba662132104909157dff526935a3c88abe9201a5.bin
373
332
  - spec/bitcoin/fixtures/reorg/blk_0_to_4.dat
374
333
  - spec/bitcoin/fixtures/reorg/blk_3A.dat
375
334
  - spec/bitcoin/fixtures/reorg/blk_4A.dat
@@ -434,9 +393,7 @@ test_files:
434
393
  - spec/bitcoin/fixtures/txscript-invalid-too-many-sigops-followed-by-invalid-pushdata.bin
435
394
  - spec/bitcoin/helpers/fake_blockchain.rb
436
395
  - spec/bitcoin/key_spec.rb
437
- - spec/bitcoin/namecoin_spec.rb
438
396
  - spec/bitcoin/network_spec.rb
439
- - spec/bitcoin/node/command_api_spec.rb
440
397
  - spec/bitcoin/performance/storage_spec.rb
441
398
  - spec/bitcoin/protocol/addr_spec.rb
442
399
  - spec/bitcoin/protocol/alert_spec.rb
@@ -452,13 +409,6 @@ test_files:
452
409
  - spec/bitcoin/protocol/version_spec.rb
453
410
  - spec/bitcoin/script/opcodes_spec.rb
454
411
  - spec/bitcoin/script/script_spec.rb
412
+ - spec/bitcoin/secp256k1_spec.rb
455
413
  - spec/bitcoin/spec_helper.rb
456
- - spec/bitcoin/storage/models_spec.rb
457
- - spec/bitcoin/storage/reorg_spec.rb
458
- - spec/bitcoin/storage/storage_spec.rb
459
- - spec/bitcoin/storage/validation_spec.rb
460
- - spec/bitcoin/wallet/coinselector_spec.rb
461
- - spec/bitcoin/wallet/keygenerator_spec.rb
462
- - spec/bitcoin/wallet/keystore_spec.rb
463
- - spec/bitcoin/wallet/txdp_spec.rb
464
- - spec/bitcoin/wallet/wallet_spec.rb
414
+ - spec/bitcoin/trezor/mnemonic_spec.rb
@@ -1,130 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $:.unshift(File.dirname(__FILE__) + "/../lib")
3
-
4
- require 'bitcoin'
5
- require 'socket'
6
- require 'json'
7
- require 'rubydns'
8
- require 'optparse'
9
-
10
- Bitcoin::Network::Node # autoload to include Array#weighted_sample
11
-
12
- DNS_OPTS = {
13
- :name => nil,
14
- :connect => "127.0.0.1:9999",
15
- :port => 8333,
16
- :cache => 1024,
17
- :send => 16,
18
- :interval => 10,
19
- :ttl => nil,
20
- :hosts => nil,
21
- }
22
- optparse = OptionParser.new do|opts|
23
- opts.banner = "Usage: bitcoin_dns_seed [options] <domain>"
24
-
25
- opts.on("-c", "--connect [HOST:PORT]",
26
- "Connect to server (default: 127.0.0.1:9999)") do |connect|
27
- DNS_OPTS[:connect] = connect
28
- end
29
-
30
- opts.on("-p", "--port [PORT]",
31
- "Network default port each addr must match (default: 8333)") do |port|
32
- DNS_OPTS[:port] = port.to_i
33
- end
34
-
35
- opts.on("-c", "--cache [SIZE]", "Cache addresses (default: 1024)") do |size|
36
- DNS_OPTS[:cache] = size.to_i
37
- end
38
-
39
- opts.on("-s", "--send [SIZE]", "Send addresses (default: 16)") do |size|
40
- DNS_OPTS[:send] = size.to_i
41
- end
42
-
43
- opts.on("-i", "--interval [SECONDS]", "Refresh addresses (default: 10)") do |s|
44
- DNS_OPTS[:interval] = s.to_i
45
- end
46
-
47
- opts.on("-t", "--ttl [SECONDS]", "TTL to set on served records (default: relative to addr age)") do |t|
48
- DNS_OPTS[:ttl] = t.to_i
49
- end
50
-
51
- opts.on("--hosts [HOSTS]", "Additional hosts file with name => addr mappings") do |h|
52
- DNS_OPTS[:hosts] = h
53
- end
54
-
55
- opts.on( '-h', '--help', 'Display this screen' ) do
56
- puts opts
57
- exit
58
- end
59
- end
60
- optparse.parse!
61
-
62
- DNS_OPTS[:domain] = ARGV.shift
63
- unless DNS_OPTS[:domain]
64
- puts optparse
65
- exit
66
- end
67
-
68
-
69
- class RubyDNS::Server
70
- attr_accessor :addrs
71
- end
72
-
73
- class AddrFetcher < EM::Connection
74
- def initialize(dns)
75
- @dns = dns
76
- @dns.addrs ||= []
77
- @buf = BufferedTokenizer.new("\x00")
78
- send_data(["addrs", DNS_OPTS[:cache].to_s].to_json)
79
- end
80
-
81
- def receive_data(data)
82
- @buf.extract(data).each do |packet|
83
- json = JSON.load(packet)[1]
84
- @dns.logger.info { "received #{json.size} new addrs" }
85
- @dns.addrs += json.select{|a| a[1] == DNS_OPTS[:port]}
86
- @dns.addrs.uniq! {|a| a[0]}
87
- pop = @dns.addrs.size - DNS_OPTS[:cache]
88
- @dns.addrs.pop(pop) if pop > 0
89
- @dns.logger.debug { "addr pool size now #{@dns.addrs.size}" }
90
- close_connection
91
- end
92
- end
93
-
94
- def self.run(host, port, dns, interval = 30)
95
- EM.connect(host, port, self, dns)
96
- EM.add_periodic_timer(interval) do
97
- EM.connect(host, port, self, dns)
98
- end
99
- end
100
- end
101
-
102
- dns = RubyDNS::Server.new
103
- dns.match(DNS_OPTS[:domain], :A) do |transaction|
104
- addrs = dns.addrs.weighted_sample(DNS_OPTS[:send]) {|addr| 10800 - addr[2] }.uniq
105
- addrs.each do |addr|
106
- begin
107
- ttl = DNS_OPTS[:ttl] || ((10800 - addr[2]) / 30)
108
- transaction.respond!(addr[0], :ttl => ttl)
109
- rescue
110
- # ignore faulty addrs ("localhost" etc)
111
- end
112
- end
113
- end
114
-
115
- if DNS_OPTS[:hosts]
116
- dns.logger.info { "serving additional addrs from file" }
117
- File.read(DNS_OPTS[:hosts]).each_line do |line|
118
- dns.logger.debug { line.strip }
119
- addr, *names = line.split(/\s+/)
120
- names.each {|n| dns.match(n, :A) {|t| t.respond!(addr) } }
121
- end
122
- end
123
-
124
- EM.run do
125
- EventMachine.open_datagram_socket("0.0.0.0", 53, RubyDNS::UDPHandler, dns)
126
- EventMachine.start_server("0.0.0.0", 53, RubyDNS::TCPHandler, dns)
127
- dns.logger.info { "DNS Server listening on 0.0.0.0:53" }
128
-
129
- timer = AddrFetcher.run(*DNS_OPTS[:connect].split(":"), dns, DNS_OPTS[:interval])
130
- end
@@ -1,80 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $:.unshift( File.expand_path("../../lib", __FILE__) )
3
-
4
- require 'bitcoin'
5
- require 'optparse'
6
-
7
- Bitcoin.require_dependency 'ffi-gtk3', gem: "gir_ffi"
8
- Bitcoin.require_dependency :eventmachine
9
- Bitcoin.require_dependency :notify
10
- Bitcoin.require_dependency :json
11
-
12
-
13
- defaults = {
14
- :network => "bitcoin",
15
- :storage => "dummy",
16
- :keystore => "simple::file=~/.bitcoin-ruby/keys.json",
17
- :command => "127.0.0.1:9999"
18
- }
19
- options = Bitcoin::Config.load(defaults, :wallet)
20
-
21
- optparse = OptionParser.new do |opts|
22
- opts.banner =
23
- "Usage: bitcoin_wallet [options] <command> [<command options>]\n"
24
-
25
- opts.separator("\nAvailable options:\n")
26
-
27
- opts.on("-c", "--config FILE",
28
- "Config file (default: #{Bitcoin::Config::CONFIG_PATHS})") do |file|
29
- options = Bitcoin::Config.load_file(options, file, :wallet)
30
- end
31
-
32
- opts.on("-n", "--network NETWORK",
33
- "User Network (default: #{options[:network]})") do |network|
34
- options[:network] = network
35
- end
36
-
37
- opts.on("-s", "--storage BACKEND::CONFIG",
38
- "Use storage backend (default: #{options[:storage]})") do |storage|
39
- options[:storage] = storage
40
- end
41
-
42
- opts.on("--command [HOST:PORT]",
43
- "Node command socket (default: #{options[:command]})") do |command|
44
- options[:command] = command
45
- end
46
-
47
- opts.on("-k", "--keystore [backend::<config>]",
48
- "Key store (default: #{options[:store]})") do |store|
49
- options[:keystore] = store
50
- end
51
-
52
- opts.on("-h", "--help", "Display this help") do
53
- puts opts; exit
54
- end
55
-
56
- opts.separator "\nAvailable commands:\n" +
57
- " balance [<addr>] - display balance for given addr or whole wallet\n" +
58
- " list <addr> - list transaction history for address\n" +
59
- " send <addr>:<amount>[,<addr>:<amount>...] [<fee>] - send transaction\n" +
60
- " new - generate new key and add to keystore\n" +
61
- " import <base58> - import key in base58 format\n" +
62
- " export <addr> - export key to base58 format\n"
63
-
64
- end
65
-
66
- optparse.parse!
67
-
68
- Bitcoin.network = options[:network]
69
-
70
- backend, config = options[:storage].split("::")
71
- @storage = Bitcoin::Storage.send(backend, :db => config)
72
-
73
- backend, config = options[:keystore].split("::")
74
- config = Hash[config.split(",").map{|c| c.split("=")}]
75
-
76
- EM.run do
77
- @gui = Bitcoin::Gui::Gui.new(@storage, config['file'])
78
- Bitcoin::Gui::Connection.new(*options[:command].split(":"), @gui)
79
- EM.gtk_main
80
- end