meeseeker 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +9 -0
- data/Rakefile +1 -1
- data/lib/meeseeker/block_follower_job.rb +66 -51
- data/lib/meeseeker/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6b0c21a1d80f88d64cb337412bc98bfa587477720f4e6d8de0ec4c25781d9af4
|
4
|
+
data.tar.gz: '090cde6805a1bed78470c51413f83edf753c698677b169d77a929cc88d75e9e6'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974862220d3dfc63c34fc2883fcf982cbc80e5085a58cfc262c28fb8b3dde9c912c46d604a692ec30137d93007e31de643dfae4bfd60a9ded749771a68fd4369
|
7
|
+
data.tar.gz: 0ba23902a5fe150682b4d720f620e8a80c94131ec118ae8b23c83b3fd6e60889b06752ac9d8cc47878b633e4a556ae293da87720ca2bd8c8e7776c8ac3e6e1a2
|
data/README.md
CHANGED
@@ -302,6 +302,10 @@ When running `meeseeker sync steem_engine`, the following channels are available
|
|
302
302
|
|
303
303
|
* `steem_engine:block`
|
304
304
|
* `steem_engine:transaction`
|
305
|
+
* `steem_engine:virtual_transaction`
|
306
|
+
* `steem_engine:contract`
|
307
|
+
* `steem_engine:contract:deploy`
|
308
|
+
* `steem_engine:contract:update`
|
305
309
|
* `steem_engine:market`
|
306
310
|
* `steem_engine:market:buy`
|
307
311
|
* `steem_engine:market:cancel`
|
@@ -313,10 +317,15 @@ When running `meeseeker sync steem_engine`, the following channels are available
|
|
313
317
|
* `steem_engine:steempegged:removeWithdrawal`
|
314
318
|
* `steem_engine:steempegged:withdraw`
|
315
319
|
* `steem_engine:tokens`
|
320
|
+
* `steem_engine:tokens:checkPendingUnstake`
|
316
321
|
* `steem_engine:tokens:create`
|
322
|
+
* `steem_engine:tokens:enableStaking`
|
317
323
|
* `steem_engine:tokens:issue`
|
318
324
|
* `steem_engine:tokens:transfer`
|
325
|
+
* `steem_engine:tokens:transferOwnership`
|
326
|
+
* `steem_engine:tokens:unstake`
|
319
327
|
* `steem_engine:tokens:updateMetadata`
|
328
|
+
* `steem_engine:tokens:updateParams`
|
320
329
|
* `steem_engine:tokens:updateUrl`
|
321
330
|
|
322
331
|
The above "channel/action" patterns are the ones that are known that the time of writing. In addition, if a new contract is added or updated, meeseeker will automatically publish to these corresponding channels as they appear, without needing to update or even restart meeseeker.
|
data/Rakefile
CHANGED
@@ -129,67 +129,82 @@ module Meeseeker
|
|
129
129
|
# to embed it into op values. This should also reduce streaming
|
130
130
|
# overhead since we no longer stream block_headers inder the hood.
|
131
131
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
next unless !!Meeseeker.include_virtual
|
142
|
-
|
143
|
-
retries = 0
|
144
|
-
|
145
|
-
# This is where it gets tricky. Virtual ops sometims don't show up
|
146
|
-
# right away, especially if we're streaming on head blocks. In that
|
147
|
-
# situation, we might only need to wait about 1 block. This loop
|
148
|
-
# will likely one execute one iteration, but we have fallback logic
|
149
|
-
# in case there are complications.
|
150
|
-
#
|
151
|
-
# See: https://developers.steem.io/tutorials-recipes/virtual-operations-when-streaming-blockchain-transactions
|
152
|
-
|
153
|
-
loop do
|
154
|
-
condenser_api ||= Steem::CondenserApi.new(url: Meeseeker.node_url)
|
155
|
-
condenser_api.get_ops_in_block(n, true) do |vops|
|
156
|
-
redo if vops.nil?
|
157
|
-
|
158
|
-
if vops.empty? && mode != :head
|
159
|
-
# Usually, we just need to slow down to allow virtual ops to
|
160
|
-
# show up after a short delay. Adding this delay doesn't
|
161
|
-
# impact overall performance because steem-ruby will batch
|
162
|
-
# when block streams fall behind.
|
163
|
-
|
164
|
-
if retries < MAX_VOP_RETRY
|
165
|
-
retries = retries + 1
|
166
|
-
condenser_api = nil
|
167
|
-
sleep 3 * retries
|
132
|
+
loop do
|
133
|
+
begin
|
134
|
+
stream.blocks(options) do |b, n|
|
135
|
+
b.transactions.each_with_index do |transaction, index|
|
136
|
+
transaction.operations.each do |op|
|
137
|
+
op = op.merge(timestamp: b.timestamp)
|
168
138
|
|
169
|
-
|
139
|
+
yield op, b.transaction_ids[index], n
|
170
140
|
end
|
171
|
-
|
172
|
-
puts "Gave up retrying virtual ops lookup on block #{n}"
|
173
|
-
|
174
|
-
break
|
175
141
|
end
|
176
142
|
|
177
|
-
|
178
|
-
|
179
|
-
|
143
|
+
next unless !!Meeseeker.include_virtual
|
144
|
+
|
145
|
+
retries = 0
|
180
146
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
147
|
+
# This is where it gets tricky. Virtual ops sometims don't show up
|
148
|
+
# right away, especially if we're streaming on head blocks. In that
|
149
|
+
# situation, we might only need to wait about 1 block. This loop
|
150
|
+
# will likely one execute one iteration, but we have fallback logic
|
151
|
+
# in case there are complications.
|
152
|
+
#
|
153
|
+
# See: https://developers.steem.io/tutorials-recipes/virtual-operations-when-streaming-blockchain-transactions
|
154
|
+
|
155
|
+
loop do
|
156
|
+
condenser_api ||= Steem::CondenserApi.new(url: Meeseeker.node_url)
|
157
|
+
condenser_api.get_ops_in_block(n, true) do |vops|
|
158
|
+
redo if vops.nil?
|
159
|
+
|
160
|
+
if vops.empty? && mode != :head
|
161
|
+
# Usually, we just need to slow down to allow virtual ops to
|
162
|
+
# show up after a short delay. Adding this delay doesn't
|
163
|
+
# impact overall performance because steem-ruby will batch
|
164
|
+
# when block streams fall behind.
|
165
|
+
|
166
|
+
if retries < MAX_VOP_RETRY
|
167
|
+
retries = retries + 1
|
168
|
+
condenser_api = nil
|
169
|
+
sleep 3 * retries
|
170
|
+
|
171
|
+
redo
|
172
|
+
end
|
173
|
+
|
174
|
+
puts "Gave up retrying virtual ops lookup on block #{n}"
|
175
|
+
|
176
|
+
break
|
177
|
+
end
|
178
|
+
|
179
|
+
if retries > 0
|
180
|
+
puts "Found virtual ops for block #{n} aftere #{retries} retrie(s)"
|
181
|
+
end
|
182
|
+
|
183
|
+
vops.each do |vop|
|
184
|
+
normalized_op = Hashie::Mash.new(
|
185
|
+
type: vop.op[0],
|
186
|
+
value: vop.op[1],
|
187
|
+
timestamp: vop.timestamp
|
188
|
+
)
|
189
|
+
|
190
|
+
yield normalized_op, vop.trx_id, vop.block
|
191
|
+
end
|
192
|
+
end
|
187
193
|
|
188
|
-
|
194
|
+
break
|
189
195
|
end
|
190
196
|
end
|
191
197
|
|
192
198
|
break
|
199
|
+
rescue => e
|
200
|
+
raise e unless e.to_s.include? 'Request Entity Too Large'
|
201
|
+
|
202
|
+
# We need to tell steem-ruby to avoid json-rpc-batch on this
|
203
|
+
# node.
|
204
|
+
|
205
|
+
Steem::BlockApi.const_set 'MAX_RANGE_SIZE', 1
|
206
|
+
sleep 3
|
207
|
+
redo
|
193
208
|
end
|
194
209
|
end
|
195
210
|
end
|
data/lib/meeseeker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meeseeker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
255
|
version: '0'
|
256
256
|
requirements: []
|
257
257
|
rubyforge_project:
|
258
|
-
rubygems_version: 2.
|
258
|
+
rubygems_version: 2.7.7
|
259
259
|
signing_key:
|
260
260
|
specification_version: 4
|
261
261
|
summary: Redis based block follower is an efficient way for multiple apps to stream
|