solana_rpc_ruby 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e28d62428fcd7647449c83fa04c5725303e1b2f4c2775834f2ec6a09253b47f
4
- data.tar.gz: ca4ba1695ff8d517beeb3e9fb500a700bc1d44cc2f640a5efcd4d32fb87b7ece
3
+ metadata.gz: 2b473e11604fa0d409efbe09260aa85bf467a1b76b6fa014e7a0716e019b3c5e
4
+ data.tar.gz: 7e116f4bdb58358bf85c3260eb526be306445d87ec87788648ee40ffbd9bd80d
5
5
  SHA512:
6
- metadata.gz: 6eefa191b58abfcbf3ac9d6150aaf1f8d5405bc465ffe4361b675a82c7849649dc09bd0d0aa1a02e85407fd5bc68c72e239d016a9a99de5cf695fc36d7120d02
7
- data.tar.gz: 50a8622360d7ebbe48ea4e5b2565ff651bc37fab5abb42644d0b04cc203671be91bfd649ef8c2c503f9438d355205170862e4e61a89a1e22fab4062716105134
6
+ metadata.gz: 5013b6799259a02d77cc232e3a1456a2de52b71c93c31e78a376c702656ed7c6444577e2f4467ceb8c5aa7df7b9b78d4bb05ee27711f003e08d6576c15b84fc4
7
+ data.tar.gz: ada8e45a050f6bc74e712f9a61a2e8b62032a6a9e60e8a21627c99dd5ce48673833b3cc119c6a893b117dcb81233e1aa8c196bb5cd27145bf684ab88b9c257cb
data/CHANGELOG.md CHANGED
@@ -7,3 +7,7 @@
7
7
 
8
8
  ## 1.1.0
9
9
  * Add websockets connection to gem.
10
+
11
+ ## 1.1.1
12
+ * Fix SolanaRpcRuby::ApiError occurring when websocket program runs for too long
13
+ (#<SolanaRpcRuby::ApiError: NoMethodError undefined method ping)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolanaRpcRuby
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
@@ -43,8 +43,7 @@ module SolanaRpcRuby
43
43
  EM.run {
44
44
  # ping option sends some data to the server periodically,
45
45
  # which prevents the connection to go idle.
46
- ws = Faye::WebSocket::Client.new(@cluster, nil)
47
-
46
+ ws ||= Faye::WebSocket::Client.new(@cluster, nil)
48
47
  EM::PeriodicTimer.new(KEEPALIVE_TIME) do
49
48
  while !ws.ping
50
49
  @retries += 1
@@ -57,7 +56,6 @@ module SolanaRpcRuby
57
56
 
58
57
  puts 'Ping failed, sleep for 10 seconds...'
59
58
  sleep SLEEP_TIME
60
- puts "#{@retries} ping retry..."
61
59
  end
62
60
  end
63
61
 
@@ -92,7 +90,6 @@ module SolanaRpcRuby
92
90
 
93
91
  ws.on :close do |event|
94
92
  p [:close, event.code, event.reason]
95
- ws = nil
96
93
 
97
94
  @retries += 1
98
95
  if @retries <= RETRIES_LIMIT
@@ -100,6 +97,7 @@ module SolanaRpcRuby
100
97
  # It restarts the websocket connection.
101
98
  connect(body, &block)
102
99
  else
100
+ ws = nil
103
101
  puts 'Retries limit reached, closing. Wrong cluster address or unhealthy node might be a reason, please check.'
104
102
  EM.stop
105
103
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solana_rpc_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Block Logic Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-25 00:00:00.000000000 Z
11
+ date: 2021-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faye-websocket
@@ -241,7 +241,7 @@ licenses:
241
241
  metadata:
242
242
  documentation_uri: https://www.rubydoc.info/github/Block-Logic/solana-rpc-ruby
243
243
  source_code_uri: https://github.com/Block-Logic/solana-rpc-ruby
244
- post_install_message:
244
+ post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths:
247
247
  - lib
@@ -256,8 +256,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.0.8
260
- signing_key:
259
+ rubygems_version: 3.0.9
260
+ signing_key:
261
261
  specification_version: 4
262
262
  summary: Ruby wrapper for solana JSON RPC API.
263
263
  test_files: []