Repository navigation
Support Ergo nodes without extra indexing - #72
Merged
kushti merged 2 commits intoNov 11, 2026
Merged
Conversation
odybhoja
force-pushed
the
support-non-indexed-node
branch
from
November 9, 2026 10:12
201b775 to
545d2bb
Compare
Previously the server panicked at startup if /blockchain/indexedHeight
was unavailable, and note scanning, note redemption and the healthcheck
all relied on the indexer API.
Add a ChainSource that detects whether the node has extra indexing and
falls back to scan- and block-based lookups when it does not:
- transactions are fetched via /blocks/at/{height} using the box
inclusion height
- spent/unspent note and reserve boxes are looked up from node scans
(/scan/unspentBoxes, /scan/spentBoxes)
- oracle and buyback boxes are found through ContainsAsset scans that
are registered at startup (triggering a wallet rescan)
The healthcheck now reports node info from /info and includes the
indexed height only when indexing is enabled.
ServerState::new now takes the node API key, needed for the
/scan/spentBoxes endpoint which ergo_client does not wrap.
Ergo node 6.x requires a treeVersion field in /script/p2sAddress, which ergo_client does not send, so the server failed at startup against any 6.x node. Compile contracts through ChainSource with treeVersion 0, which reproduces the contract trees deployed on mainnet. Node scans can report spent boxes as unspent, e.g. when the node skips blocks during a wallet rescan (seen on a 6.0.7 UTXO-bootstrapped node). Confirm oracle/buyback candidates against /utxo/withPool/byId before using them. Add ignored tests that run against a live node on localhost:9053.
odybhoja
force-pushed
the
support-non-indexed-node
branch
from
November 9, 2026 10:32
545d2bb to
3a3b3a9
Compare
kushti
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support Ergo nodes without extra indexing
chaincash required a node with extra indexing (extraIndex = true): the
server panicked at startup without /blockchain/indexedHeight, and note
scanning, note redemption and the healthcheck all used the indexer API.
Add ChainSource, which detects whether the node is indexed and otherwise
falls back to APIs every node exposes:
using the box inclusion height reported by scans
/scan/spentBoxes
startup, checked against /utxo/withPool/byId because scans can report
spent boxes as unspent (e.g. when the node skips blocks during a
wallet rescan)
Also fix startup on Ergo node 6.x, indexed or not: /script/p2sAddress
now requires treeVersion, which ergo_client does not send. Contracts are
compiled with treeVersion 0, which matches the trees deployed on mainnet.
The healthcheck now reports node info from /info, plus the indexed
height when indexing is enabled.
ServerState::new now takes the node API key, needed for endpoints that
ergo_client does not wrap.
Tested against an Ergo 6.0.7 mainnet node bootstrapped from a UTXO
snapshot, with extraIndex = false.
Closes #71