Page MenuHomePhabricator

[explorer] Add live transactions view
Needs RevisionPublic

Authored by johnkuney on Wed, Nov 26, 05:10.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

Adding a live transactions view to the landing page using the new subscribeToTxs chronik method

Since we cant actually get all the current mempool transactions (unless I totally missed something), here we get the latest 50 transactions from recent blocks and then start polling for new live transactions via subscribeToTxs. As they come in they pop in the display and knock older ones out

Tokens are rendered with relevant info and finalized state is displayed

Test Plan

preview and check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
explorer-live-transactions
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35166
Build 69790: Build Diffbuild-explorer
Build 69789: arc lint + arc unit

Event Timeline

johnkuney edited the test plan for this revision. (Show Details)
johnkuney edited the summary of this revision. (Show Details)
johnkuney edited the summary of this revision. (Show Details)
johnkuney edited the summary of this revision. (Show Details)
johnkuney edited the test plan for this revision. (Show Details)

revert to native2

johnkuney published this revision for review.Wed, Nov 26, 05:27
Fabien requested changes to this revision.Wed, Nov 26, 08:50
Fabien added a subscriber: Fabien.

There is no point adding a mempool view that doesn't show the mempool. The explorer is a source of trust that we send to users and business to check their node is working, you can explain tons of questions within seconds because users nodes will not show the same as the explorer.
Also:

  • This will break the testnet explorer
  • This is trying to fit cubes into circle holes with finalization. Rather than copying what other chain without preconsensus do, let's take advantage of it to show a better representation. Here is my proposal:
    • Have a view with 2 sides, non final and final
    • Move the tx from one side the other upon finalization This will be useful if e.g. the mempool is full to see what transaction are being finalized and which are pending. Also helps figuring out how block mining works by draining the finalized txs
web/explorer/explorer-server/code/live-txs.js
1 ↗(On Diff #56767)

Missing header

6 ↗(On Diff #56767)

What is that ?

8–9 ↗(On Diff #56767)

I don't understand why you need these at all

171 ↗(On Diff #56767)

All the functions above likely exist already in the code base since the explorer does all this already

This revision now requires changes to proceed.Wed, Nov 26, 08:50

Okay good points. How can I get the mempool transactions though? Is that possible with chronik? I saw blockchair has an endpoint for it, but we probably dont want to use that right?

Okay good points. How can I get the mempool transactions though? Is that possible with chronik? I saw blockchair has an endpoint for it, but we probably dont want to use that right?

https://ecashmempool.vercel.app/ "chronik-client": "3.6.0-rc0",

Okay good points. How can I get the mempool transactions though? Is that possible with chronik? I saw blockchair has an endpoint for it, but we probably dont want to use that right?

https://ecashmempool.vercel.app/ "chronik-client": "3.6.0-rc0",

You are using https://api.blockchair.com/ecash/mempool/transactions to get the mempool right?

Okay good points. How can I get the mempool transactions though? Is that possible with chronik? I saw blockchair has an endpoint for it, but we probably dont want to use that right?

https://ecashmempool.vercel.app/ "chronik-client": "3.6.0-rc0",

You are using https://api.blockchair.com/ecash/mempool/transactions to get the mempool right?

You need to have the ability to access the current mempool transactions and subscribe to subsequent updates. The current beta version of chronik-client (as mentioned above) already provides the ws method, but you still temporarily need a method to obtain the current mempool. You can choose to manually get it via zmq or other means, but I recommend waiting for the next version of chronik, which is expected to add a direct method to fetch current mempool transactions.

web/explorer/explorer-exe/src/main.rs
15–16 ↗(On Diff #56767)

what is this for? im confused.
These rs codes are for passing a URL to front?