Integration with Theta Network Fails Due to 'Latest Best Height is not available' Error
Issue Description:
When trying to integrate Theta Network with SubQuery, the initialization process fails, raising an error related to "Latest Best Height is not available." This seems to come from /node_modules/@subql/node-ethereum/node_modules/@subql/node-core/dist/indexer/fetch.service.js.
Log Output:
theta-starter-subquery-node-1 | 2023-09-07T15:30:34.113Z <nestjs-#3> INFO DbModule dependencies initialized theta-starter-subquery-node-1 | 2023-09-07T15:30:34.114Z <indexer> INFO indexer manager started theta-starter-subquery-node-1 | 2023-09-07T15:30:34.114Z <indexer> INFO indexer manager start theta-starter-subquery-node-1 | 2023-09-07T15:30:34.115Z <nestjs-#3> INFO IndexerModule dependencies initialized theta-starter-subquery-node-1 | 2023-09-07T15:30:34.129Z <nestjs-#3> INFO Nest application successfully started theta-starter-subquery-node-1 | 2023-09-07T15:30:34.145Z <store> INFO Historical state is enabled theta-starter-subquery-node-1 | 2023-09-07T15:30:34.192Z <indexer> INFO indexer manager started theta-starter-subquery-node-1 | 2023-09-07T15:30:34.195Z <subql-node> INFO Node started on port: 3000 theta-starter-subquery-node-1 | /usr/local/lib/node_modules/@subql/node-ethereum/node_modules/@subql/node-core/dist/indexer/fetch.service.js:34 theta-starter-subquery-node-1 | (0, assert_1.default)(this._latestBestHeight, new Error('Latest Best Height is not avaialble')); theta-starter-subquery-node-1 | ^ theta-starter-subquery-node-1 | theta-starter-subquery-node-1 | Error: Latest Best Height is not avaialble theta-starter-subquery-node-1 | at get latestBestHeight [as latestBestHeight] (/usr/local/lib/node_modules/@subql/node-ethereum/node_modules/@subql/node-core/dist/indexer/fetch.service.js:34:55) theta-starter-subquery-node-1 | at FetchService.fillNextBlockBuffer (/usr/local/lib/node_modules/@subql/node-ethereum/node_modules/@subql/node-core/dist/indexer/fetch.service.js:169:75) theta-starter-subquery-node-1 | at FetchService.startLoop (/usr/local/lib/node_modules/@subql/node-ethereum/node_modules/@subql/node-core/dist/indexer/fetch.service.js:135:20) theta-starter-subquery-node-1 | at FetchService.init (/usr/local/lib/node_modules/@subql/node-ethereum/node_modules/@subql/node-core/dist/indexer/fetch.service.js:83:19) theta-starter-subquery-node-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) theta-starter-subquery-node-1 | at async bootstrap (/usr/local/lib/node_modules/@subql/node-ethereum/dist/init.js:42:9) theta-starter-subquery-node-1 | theta-starter-subquery-node-1 | Node.js v18.17.1 dependency failed to start: container theta-starter-subquery-node-1 is unhealthy error Command failed with exit code 1.
Steps to Reproduce:
- Set up a SubQuery EVM Project.
- Add details from Theta chain and this token to index transfers and approvals.
- Run
yarn dev.
This branch has a project on it already: Theta branch
Suggested Solutions: Investigate the cause of the 'Latest Best Height is not available' error within the SubQuery SDK. Update the SDK or the implementation to support Theta's specifics if they differ from Ethereum's.