aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Bug] Clarify Indexer install and setup

Open clay-aptos opened this issue 2 years ago • 6 comments

🐛 Bug

Users are reporting in Discord issues with our indexer fullnode install and setup instructions: https://aptos.dev/nodes/indexer-fullnode/

See the report (annotated screenshots and all) starting at: https://discord.com/channels/945856774056083548/1034215378299133974/1036872377012854794

Steps to reproduce

Follow the steps and run into issues since we recommend use of both apt and brew. Perhaps the solution is to standardize on the latter as it appears to work well on Linux and macOS.

** Error message or problem **

See the Discord thread for exact error messages.

Expected Behavior

Easy setup.

System information

Ubuntu

Additional context

Related, @geekflyer has the following PR out to enable Docker support: https://github.com/aptos-labs/aptos-core/pull/5389

@rajkaramchedu , let me know if I can help with this documentation. I know I helped with drafting the original install steps.

clay-aptos avatar Nov 01 '22 16:11 clay-aptos

Starting this work in: https://github.com/aptos-labs/aptos-core/pull/5404

Seeking to also support Docker per @geekflyer in: https://github.com/aptos-labs/aptos-core/pull/5389

clay-aptos avatar Nov 02 '22 00:11 clay-aptos

I am working through this and running into numerous issues, the smaller of which I will include as TODOs in the PR. Here is a larger one:

When I run, cargo run --bin aptos-node --features "indexer" -- --config fullnode.yaml, I get:

error[E0277]: the trait bound `(diesel::sql_types::BigInt, diesel::sql_types::BigInt, diesel::sql_types::Text, diesel::sql_types::BigInt, diesel::sql_types::BigInt, diesel::sql_types::Text, diesel::sql_types::Jsonb, diesel::sql_types::Timestamp, diesel::sql_types::Text): load_dsl::private::CompatibleType<EventQuery, Pg>` is not satisfied
    --> crates/indexer/src/models/transactions.rs:288:14
     |
288  |             .load::<EventQuery>(conn)?
     |              ^^^^ the trait `load_dsl::private::CompatibleType<EventQuery, Pg>` is not implemented for `(diesel::sql_types::BigInt, diesel::sql_types::BigInt, diesel::sql_types::Text, diesel::sql_types::BigInt, diesel::sql_types::BigInt, diesel::sql_types::Text, diesel::sql_types::Jsonb, diesel::sql_types::Timestamp, diesel::sql_types::Text)`
     |
     = help: the following other types implement trait `load_dsl::private::CompatibleType<U, DB>`:
               (ST0, ST1)
               (ST0, ST1, ST2)
               (ST0, ST1, ST2, ST3)
               (ST0, ST1, ST2, ST3, ST4)
               (ST0, ST1, ST2, ST3, ST4, ST5)
               (ST0, ST1, ST2, ST3, ST4, ST5, ST6)
               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)
               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)
             and 24 others
     = note: required because of the requirements on the impl of `LoadQuery<'_, _, EventQuery>` for `SelectStatement<FromClause<schema::events::table>, query_builder::select_clause::DefaultSelectClause<FromClause<schema::events::table>>, query_builder::distinct_clause::NoDistinctClause, query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::array_comparison::In<schema::events::columns::transaction_version, diesel::expression::array_comparison::Many<diesel::sql_types::BigInt, &i64>>>>>`
note: required by a bound in `diesel::RunQueryDsl::load`
    --> /Users/claymurphy/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-2.0.0/src/query_dsl/mod.rs:1499:15
     |
1499 |         Self: LoadQuery<'query, Conn, U>,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`

error[E0277]: the trait bound `(diesel::sql_types::BigInt, diesel::sql_types::BigInt, diesel::sql_types::Text, diesel::sql_types::BigInt, diesel::sql_types::BigInt, diesel::sql_types::Text, diesel::sql_types::Jsonb, diesel::sql_types::Timestamp, diesel::sql_types::Text): load_dsl::private::CompatibleType<EventQuery, Pg>` is not satisfied
    --> crates/indexer/src/models/transactions.rs:377:14
     |
377  |             .load::<EventQuery>(conn)?;
     |              ^^^^ the trait `load_dsl::private::CompatibleType<EventQuery, Pg>` is not implemented for `(diesel::sql_types::BigInt, diesel::sql_types::BigInt, diesel::sql_types::Text, diesel::sql_types::BigInt, diesel::sql_types::BigInt, diesel::sql_types::Text, diesel::sql_types::Jsonb, diesel::sql_types::Timestamp, diesel::sql_types::Text)`
     |
     = help: the following other types implement trait `load_dsl::private::CompatibleType<U, DB>`:
               (ST0, ST1)
               (ST0, ST1, ST2)
               (ST0, ST1, ST2, ST3)
               (ST0, ST1, ST2, ST3, ST4)
               (ST0, ST1, ST2, ST3, ST4, ST5)
               (ST0, ST1, ST2, ST3, ST4, ST5, ST6)
               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)
               (ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)
             and 24 others
     = note: required because of the requirements on the impl of `LoadQuery<'_, _, EventQuery>` for `SelectStatement<FromClause<schema::events::table>, query_builder::select_clause::DefaultSelectClause<FromClause<schema::events::table>>, query_builder::distinct_clause::NoDistinctClause, query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<schema::events::columns::transaction_version, diesel::expression::bound::Bound<diesel::sql_types::BigInt, &i64>>>>>`
note: required by a bound in `diesel::RunQueryDsl::load`
    --> /Users/claymurphy/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-2.0.0/src/query_dsl/mod.rs:1499:15
     |
1499 |         Self: LoadQuery<'query, Conn, U>,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::RunQueryDsl::load`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `aptos-indexer` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
➜  mainnet git:(fullnode-indexer) ✗ 

clay-aptos avatar Nov 02 '22 22:11 clay-aptos

Per user input, "in:#📚・docs-feedback which version of postgres is preferred, 15? having exact versions or supported ones would be nice"

clay-aptos avatar Nov 02 '22 23:11 clay-aptos

I'm noting we should consider employing tabs as in the tutorials for Mac and Linux commands

clay-aptos avatar Nov 03 '22 18:11 clay-aptos

Also see tagging issues in: https://github.com/aptos-labs/aptos-core/pull/5389#issuecomment-1301918074

clay-aptos avatar Nov 03 '22 18:11 clay-aptos

I am moving some TODOs from PR #5423 per @davidiw. In fullnode-source-code-or-docker.md:

  1. Find out if this mainnet directory should reside in the aptos-core checkout as when attempting to start the fullnode indexer with the directory distinct results in the error:
error: could not find `Cargo.toml` in `/Users/claymurphy/mainnet` or any parent directory
  1. Find out why we have them replace the contents of a file they just downloaded (fullnode.yaml) with the contents of this doc. Also build in the latest docker tag to the image.

And from indexer-fullnode.md:

  1. Test and provide a single brew install command for everything after cargo here. Also find out if we need Cargo if they go the Docker route.

  2. Determine if indexer startup should be done in the aptos-core checkout as indexer startup is looking for a Cargo.toml file:

error: could not find `Cargo.toml` in `/Users/claymurphy/mainnet` or any parent directory

I feel like a lot of these are simply path issues we can sort out with a walkthrough. We should provide some recommendations and use environment variables for simplicity, IMO.

clay-aptos avatar Nov 07 '22 16:11 clay-aptos