Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make websocket optional for realtime fetcher #1778

Merged
merged 1 commit into from
Apr 18, 2019
Merged

Conversation

goodsoft
Copy link
Contributor

@goodsoft goodsoft commented Apr 18, 2019

Realtime fetcher already uses both websocket and JSONRPC polling for more reliable new block fetching.
Though, if no websocket was available, the realtime fetcher wouldn't start, and no new blocks arrived at all.

As we already have a polling fallback, we now make websocket optional.
This will also help with supporting nodes without websocket API.

To disable websocket API, pass nil in subscribe_named_arguments.transport.

Checklist for your PR

  • I added an entry to CHANGELOG.md with this PR
  • If I added new functionality, I added tests covering it.
  • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • I checked whether I should update the docs and did so if necessary

@ghost ghost assigned goodsoft Apr 18, 2019
@ghost ghost added the in progress label Apr 18, 2019
@coveralls
Copy link

coveralls commented Apr 18, 2019

Pull Request Test Coverage Report for Build 1b534c0a-b9b6-4447-a718-9ee238af2a7a

  • 0 of 7 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.07%) to 83.073%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/indexer/lib/indexer/block/realtime/fetcher.ex 0 7 0.0%
Files with Coverage Reduction New Missed Lines %
apps/indexer/lib/indexer/block/realtime/fetcher.ex 2 30.0%
Totals Coverage Status
Change from base Build 6bfd0629-ac5a-4ead-9901-0fef2c645e69: 0.07%
Covered Lines: 4422
Relevant Lines: 5323

💛 - Coveralls

Realtime fetcher already uses both websocket and JSONRPC polling for more reliable new block fetching.
Though, if no websocket was available, the realtime fetcher wouldn't start, and no new blocks arrived at all.

As we already have a polling fallback, we now make websocket optional.
This will also help with supporting nodes without websocket API.

To disable websocket API, pass `nil` in `subscribe_named_arguments.transport`.
@goodsoft goodsoft merged commit b8a8a00 into master Apr 18, 2019
@ghost ghost removed the in progress label Apr 18, 2019
gabitoesmiapodo added a commit that referenced this pull request Apr 18, 2019
* master:
  Make websocket optional for realtime fetcher (#1778)
  check assigns
  add CHANGELOG entry
  finish erc20 info
  fix eslint
  add CHANGELOG entry
  add only blocks path
  optionally show token transfer info
  add timestamp to block overview
  fix CHANGELOG entry
  fix first block parameter
  Update CHANGELOG
  CHange twitter acc link to official Blockscout acc twitter

# Conflicts:
#	CHANGELOG.md
#	apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex
#	apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex
#	apps/block_scout_web/priv/gettext/default.pot
#	apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
@vbaranov vbaranov deleted the gs-optional-websocket branch May 28, 2019 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants