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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c77b50a00bf28514314ae08d98371ebdca3215549843665d82d111080ed466c3
4
- data.tar.gz: 0ae8f242244db5535800836cede789ab459e3b6091e610cb1b0fb1bf7fab9019
3
+ metadata.gz: 54dab0d9fc88331fb1fc41de568c869ec989f8c88a0c0e68d1ad643512fb407a
4
+ data.tar.gz: 405482224d09bcbce40611056591ddd0af267967252d7f49c0f566f04cf3fdf7
5
5
  SHA512:
6
- metadata.gz: c1a9b6e6280f27661b7a2447b34caf8fe2757b8bd87a52c7dc7112aab6f0ce2fac8307cdb631e728bdf503ac9f13d57748fc8d5f481acb104a8c54abaf5ec6d3
7
- data.tar.gz: 37c5f658c328e6436f977305b9ecb7b2ea7d3343bf6a873aeb6baf6edcd3860d3fac1fa729b5178f6af18affe8557d38e9a7bd06a889d4bb6fb0aea88cf71a89
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 streaming the entire blockchain.
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 you're sync has started, you can begin doing queries against redis, for example, in the `redis-cli`:
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.last_irreversible_block_num
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
- redis.set(LAST_BLOCK_NUM_KEY, block_num)
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
@@ -1,3 +1,3 @@
1
1
  module Meeseeker
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2pre1'
3
3
  end
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 = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test)/}) }
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.1
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-27 00:00:00.000000000 Z
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: '0'
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