Skip to content

feat(block-explorer): open blocks and transactions in gnoscope - #238

Open
moul wants to merge 1 commit into
mainfrom
feat/gnoscope-deep-links
Open

moul wants to merge 1 commit into
mainfrom
feat/gnoscope-deep-links

Conversation

@moul

@moul moul commented Dec 1, 2026

Copy link
Copy Markdown
Owner

What:

  • Two URL builders in apps/web/src/shell/gnoweb-links.ts: explorerBlockUrl gives <explorerUrl>/block/<height> and explorerTxUrl gives <explorerUrl>/tx/<hash>.
    • Both drop a trailing slash from the configured base URL.
    • explorerTxUrl escapes the hash, because indexer hashes are base64 and can contain +, / and =.
  • The Block Explorer now has an "Open in explorer" button under the block's fields. Each transaction in the block also gets one, shown only when that transaction has a hash.
  • Both buttons open the URL in the app's own Explorer window, like the Address window does.
  • Both appear only when the active network has an explorerUrl, so staging and gnodev show nothing.
  • Unit tests for both builders cover the basic URL, the trailing slash, and escaping of a real base64 hash and of a /.

Why: the block and transaction views had no deep link to the explorer. Mainnet's explorer is gnoscope since #230.

The URL pattern comes from gnoscope.com itself, not from the repo, which only had the address and realm routes:

  • I used curl. /block/1 and /tx/<hash> each come back with their own page title ("block 1 on gnoscope", "tx … on gnoscope").
  • /blocks/, /txs/ and /transaction/ come back with the generic home page title.
  • The links are not scoped with ?network=, matching the existing address links.

What I could not verify:

  • That gnoscope actually finds a transaction from the base64 hash the indexer returns. The page title just repeats whatever hash you give it. I didn't find a real mainnet hash to test with, so it might expect hex instead.
  • That the testnet explorer (explorer.pearl.testnets.gno.land) uses the same /block/ and /tx/ routes. I only checked gnoscope.com.

Not done, on purpose: the Transaction Explorer table has no per-transaction link. The indexer's listTransactions doesn't return a hash, so adding one means changing packages/rpc. That belongs in its own PR. Here, "transaction view" means the transaction rows inside the block view.

Verified on a Linux worker: pnpm lint, typecheck, test and build exit 0. e2e left to CI.

Refs gnoute3#2770.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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.

1 participant