subquery / subql

SubQuery is an Open, Flexible, Fast and Universal data indexing framework for web3. Our mission is to help developers create the decentralised products of the future.
https://subquery.network
GNU General Public License v3.0
19.06k stars 329 forks source link

Unable to run Ethereum node outside Docker #2238

Closed livthomas closed 7 months ago

livthomas commented 7 months ago

Prerequisites

Description

According to Running SubQuery Locally page in the documentation, it should be possible to run both the indexer and the query service outside of Docker. However, I'm unable to run either of those two processes.

Details

These details can help to reproduce the environment the issue is occurring

Local Environment: @subql/cli/4.2.5 darwin-arm64 node-v18.18.2 Query Version: subql-query@2.9.0 Indexer Version: subql-node-ethereum@3.5.2 Network Details: Ethereum Goerli testnet

Steps to Reproduce

  1. Clone https://github.com/subquery/ethereum-subql-starter
  2. Go to /Ethereum/ethereum-goerli-starter/ folder
  3. Run yarn install && yarn codegen && yarn build
  4. Run yarn subql-node-ethereum -f . --db-schema=app --workers=4 --batch-size=30 --unfinalized-blocks=true

Example project: https://github.com/subquery/ethereum-subql-starter/tree/main/Ethereum/ethereum-goerli-starter

Expected behavior: The node should start the same way as if it was run inside a Docker container.

Actual behavior: The node fails with some NestJS error:

2024-02-01T15:54:05.404Z <subql-node> INFO Current @subql/node-ethereum version is 3.7.0
2024-02-01T15:54:05.405Z <subql-node> INFO Current @subql/node-ethereum version is 3.7.0
2024-02-01T15:54:05.421Z <ProjectUpgradeSevice> INFO Projects: {
  "8955994": "/Users/livthomas/Projects/subquery/ethereum-subql-starter/Ethereum/ethereum-goerli-starter"
}
2024-02-01T15:54:05.457Z <nestjs> INFO Starting Nest application...
2024-02-01T15:54:05.500Z <nestjs> INFO AppModule dependencies initialized
2024-02-01T15:54:05.500Z <nestjs> INFO ConfigureModule dependencies initialized
2024-02-01T15:54:05.500Z <nestjs> ERROR Nest can't resolve dependencies of the ProjectService (DsProcessorService, ApiService, PoiService, PoiSyncService, ?, ISubqueryProject, IProjectUpgradeService, StoreService, NodeConfig, DynamicDsService, EventEmitter, UnfinalizedBlocksService). Please make sure that the argument Sequelize at index [4] is available in the FetchModule context.

Potential solutions:
- Is FetchModule a valid NestJS module?
- If Sequelize is a provider, is it part of the current FetchModule?
- If Sequelize is exported from a separate @Module, is that module imported within FetchModule?
  @Module({
    imports: [ /* the Module containing Sequelize */ ]
  })

error Command failed with exit code 1.

Any other information

I have the PostgreSQL database running inside Docker (created by Docker Compose) and I set the following env variables:

DB_USER=postgres
DB_PASS=postgres
DB_DATABASE=postgres
DB_HOST=localhost
DB_PORT=5432
stwiname commented 7 months ago

Can you please try the latest version of @subql/node-ethereum and see if the issue still exists

livthomas commented 7 months ago

It works with the latest version. Thanks @stwiname !