meeseeker 0.0.1 → 0.0.2pre1
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 +4 -4
- data/README.md +2 -2
- data/lib/meeseeker/block_follower_job.rb +14 -2
- data/lib/meeseeker/version.rb +1 -1
- data/meeseeker.gemspec +3 -1
- metadata +4 -5
- data/.gitignore +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54dab0d9fc88331fb1fc41de568c869ec989f8c88a0c0e68d1ad643512fb407a
|
4
|
+
data.tar.gz: 405482224d09bcbce40611056591ddd0af267967252d7f49c0f566f04cf3fdf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a655fed67dd2bca61b0a4c6a0c00e70feb6bc6f465c7f1f49ff383d5926f0334bad5e675a1c8649ea221677aaae73e45188b87707ec5fe9dcdbeaf737f2e11f
|
7
|
+
data.tar.gz: 69a0db4d8b084e2809abff747d5faa4c6a52f45d6ed027ccff3e805e7960f33ab039ac8747d6c6eaa03f9cdba74816ee05065d2934c29dbd588dab1ba093d8a6
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Redis based block follower is an efficient way for multiple apps to stream the Steem Blockchain.
|
4
4
|
|
5
|
-
If you have multiple applications that need to perform actions as operations occur, `meeseeker` will allow your apps to each perform actions for specific operations without each app having to
|
5
|
+
If you have multiple applications that need to perform actions as operations occur, `meeseeker` will allow your apps to each perform actions for specific operations without each app having to stream the entire blockchain.
|
6
6
|
|
7
7
|
*In a nutshell:* The overarching intent here is to provide a "live view" of the blockchain, *not* store the entire blockchain. Apps can attach to your redis source and ask, "What *just* happened?"
|
8
8
|
|
@@ -100,7 +100,7 @@ From the redis manual:
|
|
100
100
|
|
101
101
|
See: https://redis.io/commands/scan
|
102
102
|
|
103
|
-
Once
|
103
|
+
Once your sync has started, you can begin doing queries against redis, for example, in the `redis-cli`:
|
104
104
|
|
105
105
|
```bash
|
106
106
|
redis-cli --scan --pattern 'steem:*:vote'
|
@@ -12,7 +12,7 @@ module Meeseeker
|
|
12
12
|
|
13
13
|
database_api.get_dynamic_global_properties do |dgpo|
|
14
14
|
block_num = case Meeseeker.stream_mode
|
15
|
-
when :head then dgpo.
|
15
|
+
when :head then dgpo.head_block_number
|
16
16
|
when :irreversible then dgpo.last_irreversible_block_num
|
17
17
|
else; abort "Unknown stream mode: #{Meeseeker.stream_mode}"
|
18
18
|
end
|
@@ -41,6 +41,7 @@ module Meeseeker
|
|
41
41
|
|
42
42
|
last_key_prefix = nil
|
43
43
|
trx_index = 0
|
44
|
+
current_block_num = nil
|
44
45
|
|
45
46
|
stream.operations(options) do |op, trx_id, block_num|
|
46
47
|
current_key_prefix = "steem:#{block_num}:#{trx_id}"
|
@@ -48,6 +49,10 @@ module Meeseeker
|
|
48
49
|
if current_key_prefix == last_key_prefix
|
49
50
|
trx_index += 1
|
50
51
|
else
|
52
|
+
if !!last_key_prefix
|
53
|
+
n, b, t = last_key_prefix.split(':')
|
54
|
+
redis.publish('steem:transaction', {block_num: b.to_i, trx_id: t}.to_json)
|
55
|
+
end
|
51
56
|
last_key_prefix = "steem:#{block_num}:#{trx_id}"
|
52
57
|
trx_index = 0
|
53
58
|
end
|
@@ -57,7 +62,14 @@ module Meeseeker
|
|
57
62
|
puts key
|
58
63
|
redis.set(key, op.to_json)
|
59
64
|
redis.expire(key, Meeseeker.expire_keys)
|
60
|
-
|
65
|
+
|
66
|
+
if current_block_num != block_num
|
67
|
+
redis.set(LAST_BLOCK_NUM_KEY, block_num)
|
68
|
+
redis.publish('steem:block', {block_num: block_num}.to_json)
|
69
|
+
current_block_num = block_num
|
70
|
+
end
|
71
|
+
|
72
|
+
redis.publish("steem:op:#{op_type}", {key: key}.to_json)
|
61
73
|
end
|
62
74
|
end
|
63
75
|
end
|
data/lib/meeseeker/version.rb
CHANGED
data/meeseeker.gemspec
CHANGED
@@ -11,7 +11,9 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.description = 'If you have multiple applications that need to perform actions as operations occur, `meeseeker` will allow your apps to each perform actions for specific operations without each app having to streaming the entire blockchain.'
|
12
12
|
s.authors = ['Anthony Martin']
|
13
13
|
s.email = ['meeseeker@martin-studio.com,']
|
14
|
-
s.files =
|
14
|
+
s.files = Dir['bin/**/*', 'lib/**/*', 'Gemfile', 'LICENSE', 'Rakefile', 'README.md', 'meeseeker.gemspec']
|
15
|
+
s.test_files = Dir['test/**/*']
|
16
|
+
s.executables = Dir['bin/*'].map{ |f| File.basename(f) }
|
15
17
|
s.homepage = 'https://rubygems.org/gems/meeseeker'
|
16
18
|
s.metadata = { 'source_code_uri' => 'https://github.com/inertia186/meeseeker' }
|
17
19
|
s.bindir = 'bin'
|
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.2pre1
|
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-01-
|
11
|
+
date: 2019-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -100,7 +100,6 @@ executables:
|
|
100
100
|
extensions: []
|
101
101
|
extra_rdoc_files: []
|
102
102
|
files:
|
103
|
-
- ".gitignore"
|
104
103
|
- Gemfile
|
105
104
|
- LICENSE
|
106
105
|
- README.md
|
@@ -126,9 +125,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
125
|
version: '0'
|
127
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
127
|
requirements:
|
129
|
-
- - "
|
128
|
+
- - ">"
|
130
129
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
130
|
+
version: 1.3.1
|
132
131
|
requirements: []
|
133
132
|
rubyforge_project:
|
134
133
|
rubygems_version: 2.7.7
|
data/.gitignore
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
/.config
|
4
|
-
/coverage/
|
5
|
-
/InstalledFiles
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/spec/examples.txt
|
9
|
-
/test/tmp/
|
10
|
-
/test/version_tmp/
|
11
|
-
/tmp/
|
12
|
-
|
13
|
-
# Used by dotenv library to load environment variables.
|
14
|
-
# .env
|
15
|
-
|
16
|
-
## Specific to RubyMotion:
|
17
|
-
.dat*
|
18
|
-
.repl_history
|
19
|
-
build/
|
20
|
-
*.bridgesupport
|
21
|
-
build-iPhoneOS/
|
22
|
-
build-iPhoneSimulator/
|
23
|
-
|
24
|
-
## Specific to RubyMotion (use of CocoaPods):
|
25
|
-
#
|
26
|
-
# We recommend against adding the Pods directory to your .gitignore. However
|
27
|
-
# you should judge for yourself, the pros and cons are mentioned at:
|
28
|
-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
29
|
-
#
|
30
|
-
# vendor/Pods/
|
31
|
-
|
32
|
-
## Documentation cache and generated files:
|
33
|
-
/.yardoc/
|
34
|
-
/_yardoc/
|
35
|
-
/doc/
|
36
|
-
/rdoc/
|
37
|
-
|
38
|
-
## Environment normalization:
|
39
|
-
/.bundle/
|
40
|
-
/vendor/bundle
|
41
|
-
/lib/bundler/man/
|
42
|
-
|
43
|
-
# for a library or gem, you might want to ignore these files since the code is
|
44
|
-
# intended to run in multiple environments; otherwise, check them in:
|
45
|
-
Gemfile.lock
|
46
|
-
# .ruby-version
|
47
|
-
# .ruby-gemset
|
48
|
-
|
49
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
50
|
-
.rvmrc
|