-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indexing epochs data #142
Indexing epochs data #142
Conversation
e80ae6b
to
4a19f3a
Compare
5a05c60
to
f9933af
Compare
2a1b764
to
7d83419
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start! I have left change requests, questions and suggestions I would like you to address.
database/src/postgres/migrations/2023-12-07-144820_epochs/up.sql
Outdated
Show resolved
Hide resolved
database/src/postgres/migrations/2023-12-07-144820_epochs/up.sql
Outdated
Show resolved
Hide resolved
epoch_id: near_indexer_primitives::CryptoHash, | ||
) -> anyhow::Result<readnode_primitives::EpochValidatorsInfo> { | ||
let epoch = crate::models::Validators::get_validators( | ||
Self::get_connection(&self.pg_pool).await?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like establishing a connection every time instead of passing an established one. Could you clarify why don't you pass a pg_pool
to the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pg_pool
- Generic object and connection pool. This struct can be cloned and transferred across thread boundaries and uses reference counting for its internal state.
get_connection
- Retrieves a connection from pg_pool
or waits for one to become available.
032b915
to
1cfc377
Compare
DATABASE_URL=127.0.0.1:9042 | ||
DATABASE_USER=cassandra | ||
DATABASE_PASSWORD=cassandra | ||
AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does epoch-indexer use S3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! It takes blocks from s3.
1cfc377
to
61cfb84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think this is ready to be merged. Great work!
This pull request introduces several significant enhancements and new functionalities to the codebase, focusing on improving the indexer's capabilities and implementing new endpoints for enhanced querying:
1. Epoch-Indexer Implementation for Validators and Protocol Configurations:
2. State-Indexer Enhancement for Epochs:
3. Query Function Call Improvement and Bug Fix:
4. Validators Endpoint Implementation:
5. Protocol_Config Endpoint Implementation:
6. Gas_Price Endpoint Implementation:
This pull request signifies a significant stride in augmenting the system's capabilities, refining data retrieval mechanisms, and providing users with enhanced access to critical system information.