near / near-indexer-for-explorer

Watch NEAR network and store all the data from NEAR blockchain to PostgreSQL database
https://near-indexers.io/docs/projects/near-indexer-for-explorer
GNU General Public License v3.0
123 stars 56 forks source link

near-indexer-for-explorer based on nearcore doesn't work #348

Closed WuTao18 closed 1 year ago

WuTao18 commented 1 year ago

I am currently using the old version (2d66461993a867f6611beab6f567593808dedee3) of near-indexer-for-explorer, which uses nearcore instead of near lake framework. The reason I still use the old version of near-indexer-for-explorer is that I need to run an archival node. Recently, I found that nearcore in near-indexer-for-explorer could not synchronize data. Specifically, block data could be downloaded, but could not be added to the database (RocksDB) of archival node. I tried to run a rpc node with nearcore (version 1.31.0), and synchronization is OK. So I tried to update the nearcore version in Cargo.toml of near-indexer-for-explorer, but the compilation failed.

Below is my modified Cargo.toml: image

And the output from running cargo build --release: log.txt

telezhnaya commented 1 year ago

The reason I still use the old version of near-indexer-for-explorer is that I need to run an archival node.

Do you mean you need to have all the data, including the historical one, to be still available? With Lake based indexer, you always have all the data.

khorolets commented 1 year ago

Hey there! Sorry for inconveniences, but we don't have capacity to keep supporting the version of the indexer we are not using.

However, I believe we've got you covered this time. We went through similar issues upgrading the nearcore based indexer recently.

You may refer to this pull request and it's changes to apply it to the indexer for Explorer https://github.com/near/near-lake-indexer/pull/61

I am encouraging you to send a PR once you succeed with the target branch master-nearcore to help others.

WuTao18 commented 1 year ago

Do you mean you need to have all the data, including the historical one, to be still available? With Lake based indexer, you always have all the data.

As far as I know, the only way to query the state of a contract under a block is through the RPC API, so I run an archival node. The reason I run indexer is because I need to query all transactions of an account, and perform other similar queries, the postgresql database maintained by indexer meets my need. Running indexer based on nearcore, I can get both an archival node and a postgresql database.

WuTao18 commented 1 year ago

However, I believe we've got you covered this time. We went through similar issues upgrading the nearcore based indexer recently.

You may refer to this pull request and it's changes to apply it to the indexer for Explorer near/near-lake-indexer#61

I am encouraging you to send a PR once you succeed with the target branch master-nearcore to help others.

OK, let me try.

khorolets commented 1 year ago

Resolved by @WuTao18 with #355. master-nearcore branch is up to date with nearcore 1.31.1

https://github.com/near/near-indexer-for-explorer/commit/f5317db9db24e55b832c362fa1778dccc6aea991

Thank you @WuTao18!