To speed up the dapp we need an indexer of the blockchain of our contracts.
This service is required to display operations in the dapp.
The indexer query the status of the contracts
and write to mongo database, so the app query the mongo instead of blockchain (slow).
- Scan Raw TX: Indexing blocks
- Scan Events: Indexing events transactions
- Scan TX Status: Scan transaction status
- Scan Blocks not processed
- Scan Blocks confirming
- Mongo db
- Python installed
Requirement and installation
- We need Python 3.9+
Install libraries
pip install -r requirements.txt
Usage
Select settings from settings/ and copy to ./config.json also change url, db uri and db name.
Run
python ./app_run_indexer.py
Build, change path to correct environment
docker build -t stable_protocol_indexer -f Dockerfile --build-arg CONFIG=./settings/productive/moc-testnet.json .
Run
docker run -d \
--name stable_protocol_indexer_moc_mainnet \
--env APP_MONGO_URI=mongodb://localhost:27017 \
--env APP_MONGO_DB=roc_mainnet \
--env APP_CONNECTION_URI=https://public-node.testnet.rsk.co \
stable_protocol_indexer