Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/coins/syscoin.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"internal_binding_template": ":{{.Ports.BlockbookInternal}}",
"public_binding_template": ":{{.Ports.BlockbookPublic}}",
"explorer_url": "",
"additional_params": "-dbcache=4294967296 -dbmaxopenfiles=500000 -workers=16 -chunk=1000",
"additional_params": "-dbcache=4294967296 -dbmaxopenfiles=500000 -workers=16 -chunk=1000 -extendedindex",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Migrate existing Syscoin databases before enabling the flag

When this package is deployed over any existing Syscoin database, the generated service immediately starts with -extendedindex, but db/rocksdb.go:2394-2395 rejects databases whose stored setting is false. The repository's standard deployment path (.github/workflows/deploy.yml:174-178 and contrib/scripts/deploy-blockbook-local.sh:89-92) installs the package and restarts the same database without performing the documented rebuild or directory swap, so deploying either changed config takes that Blockbook instance offline. The migration must be implemented or enforced in the deployment path before changing the default startup flag; documentation alone does not protect automated deployments.

Useful? React with 👍 / 👎.

"block_chain": {
"parse": true,
"mempool_workers": 8,
Expand Down
2 changes: 1 addition & 1 deletion configs/coins/syscoin_testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"internal_binding_template": ":{{.Ports.BlockbookInternal}}",
"public_binding_template": ":{{.Ports.BlockbookPublic}}",
"explorer_url": "",
"additional_params": "-dbcache=4294967296 -dbmaxopenfiles=500000 -workers=16 -chunk=1000",
"additional_params": "-dbcache=4294967296 -dbmaxopenfiles=500000 -workers=16 -chunk=1000 -extendedindex",
"block_chain": {
"parse": true,
"mempool_workers": 8,
Expand Down
18 changes: 18 additions & 0 deletions docs/api-syscoin.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ These fields appear on existing transaction endpoints, including
`/api/v2/tx/{txid}` and address transaction lists. They are omitted for ordinary
base coin transactions.

### Spending transaction lookups

The `syscoin` and `syscoin_testnet` package configurations enable
`-extendedindex`. This stores the spending transaction ID, input index, and
block height with each spent output during indexing. `/spending/{txid}/{vout}`
can then read the spender directly instead of scanning the output address's
transaction history. Transaction responses also include `spentTxId`,
`spentIndex`, and `spentHeight` where applicable, without requiring
`?spending=true`.

Existing Blockbook databases created without `-extendedindex` must be rebuilt
before using the updated service configuration. Changing the startup flag alone
does not backfill historical records and fails with `ExtendedIndex setting does
not match`. Build the new index in a separate database directory, retain the
original index for rollback, and verify synchronization and spending lookups
before switching public traffic. The Syscoin Core blockchain data does not need
to be rebuilt.

## Address Responses

Address responses retain the standard Blockbook `tokens` array for regular
Expand Down
Loading