rsk_snitch 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rsk_snitch.rb +7 -8
- data/lib/rsk_snitch/version.rb +1 -1
- data/rsk_snitch.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 796e36c480593a5e47a30d982c6a51341d0ed6ba
|
4
|
+
data.tar.gz: ff13ee91af11a142edb7545956fef70b059fbb99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 122a1451772c9fafb261dc320e12886e1d88a4e6b1c3e3f72bad6f163f1e0bc17113b0cf964d9b5e6c9246d1d505030ca1914502dfc81cfabbfe309d989c0d0b
|
7
|
+
data.tar.gz: 6ff712f8948eccc96dd66caafd506c63b9ac9d9d5764f1a6a59883a5cafa9647be15f08ed7c34358db5304e31f4aa7e2ae896eb1d8bccaf72365cd0dc82424b2
|
data/lib/rsk_snitch.rb
CHANGED
@@ -2,15 +2,14 @@ require "rsk_snitch/version"
|
|
2
2
|
require 'faye/websocket'
|
3
3
|
|
4
4
|
module RskSnitch
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
5
|
+
# Checks the RSK public stats websocket to see if bitex is there
|
6
|
+
class Nodes
|
7
|
+
def self.url
|
8
|
+
"ws://stats.rsk.co/primus/?_primuscb=#{(Time.now.to_f * 1000).round}-0"
|
9
|
+
end
|
11
10
|
|
12
11
|
def self.debug=(debug)
|
13
|
-
@debug =
|
12
|
+
@debug = debug
|
14
13
|
end
|
15
14
|
|
16
15
|
def self.find(node, max_messages = 500)
|
@@ -22,7 +21,7 @@ module RskSnitch
|
|
22
21
|
ws.on :message do |event|
|
23
22
|
puts event.data if @debug
|
24
23
|
messages += 1
|
25
|
-
found = true if /"id":"
|
24
|
+
found = true if /"id":".*?#{node}.*?"/ =~ event.data
|
26
25
|
ws.close if found || messages > max_messages
|
27
26
|
end
|
28
27
|
|
data/lib/rsk_snitch/version.rb
CHANGED
data/rsk_snitch.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["yo@nubis.im"]
|
11
11
|
|
12
12
|
spec.summary = %q{Check if a node is reporting stats in stats.rsk.co}
|
13
|
-
spec.description = %q{Check if a node is reporting stats in stats.rsk.co
|
13
|
+
spec.description = %q{Check if a node is reporting stats in stats.rsk.co. Can be used as lib or executable.}
|
14
14
|
spec.homepage = "https://github.com/bitex-la/rsk-snitch"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsk_snitch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nubis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faye-websocket
|
@@ -122,7 +122,8 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '1.0'
|
125
|
-
description: Check if a node is reporting stats in stats.rsk.co
|
125
|
+
description: Check if a node is reporting stats in stats.rsk.co. Can be used as lib
|
126
|
+
or executable.
|
126
127
|
email:
|
127
128
|
- yo@nubis.im
|
128
129
|
executables:
|