TX endpoint and new collection data
New Features
- transaction hash and transaction uid can now be looked up via a new tx endpoint:
blockservice_host
/tx?hash=some_txHash
blockservice_host
/tx?uid=some_tx_uid
- If both are provided in the query will use txHash
- State Changes objects which are served on the
/history
endpoints now have a list of raw keys there were changed - Current State objects which are served on the
/current
endpoint now haveprev_values
andprev_uid
Upgrade steps
Pull and Restart
- git fetch && git pull
- restart blockservice (however you have it running)
Update Database
- It's always a good idea to do a
mongodump
and backup the database before running these loader files
If this is a new install, and the blockservice has never run before, then you can disregard this step.
This will update your collections with new information now provided by this upgrade. These loaders need to be run in the proper order. The new block service code will handle any new transactions coming in, these loaders will only affect entries that are previous to your upgrade so you can keep the blockservice running while these loaders work.
- node src/database/loaders add_affectedRawKeysList.mjs
- This will add a list of keys that were changed during the transaction to all object in the StateChanges collection
- This addition is needed to make the next loader work
- node src/database/loaders prev_tx.mjs
- This will add
prev_value
andprev_uid
to all objects in the CurrentState collection. - This could take a few hours* but your block service will continue to function while this loader runs.
- This will add