Skip to content
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

Implement transaction indexer #1121

Merged
merged 10 commits into from
Nov 9, 2023
Merged

Implement transaction indexer #1121

merged 10 commits into from
Nov 9, 2023

Conversation

baichuan3
Copy link
Collaborator

Summary

part of #1028

  1. Implement indexer actor
  2. Implement transaction indexer write
  3. Simplified Indexer store implementation, removing asynchronous and multi-threading
  4. Optimized the Server start failure prompt and supported Server clean to give the corresponding network

TODO

  1. Solve the problem of automatic creation of Sqlite schema when Server start and integration test. There are two option

    • Use shell script to call diesel migrate run to complete schema initialization, which means that Server start and integration test have pre-dependencies
    • Simulate diesel migrate run in rooch cli to eliminate pre-dependencies and the user experience will be smoother.
  2. Add more testcase

Copy link

vercel bot commented Nov 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2023 2:13pm

@@ -0,0 +1 @@
DATABASE_URL=/Users/Baichuan/.rooch/local/roochdb/indexer.sqlite
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the DATABASE_URL must an absolute path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the .env is only for dev, and It should be removed from the crate.

}

pub fn mock_indexer_store() -> Result<Self> {
let tmpdir = moveos_config::temp_dir();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should keep the temp_dir() returned DataDirPath. Otherwise, the temp dir will be removed when the DataDirPath instance is dropped.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the problem of using temp path to release instance when server starts.
As for whether calling mock_indexer_store in the integration test will release it, I will write a test case to cover and verify it later.

}

#[async_trait]
impl Handler<QueryTransactionsByHashMessage> for IndexerActor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can query transactions by hash from the transaction store, and does not need the index. Providing query transactions by the sender is more useful.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the transactionFilter query RPC will be implemented in the following pr later to support queries including sender and other dimensions.

@jolestar
Copy link
Contributor

jolestar commented Nov 9, 2023

I will merge this PR first.

@jolestar jolestar merged commit 4de62ea into main Nov 9, 2023
5 checks passed
@jolestar jolestar deleted the transaction_indexer branch November 9, 2023 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Indexer] Implement transaction indexer
2 participants