-
Notifications
You must be signed in to change notification settings - Fork 84
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
crates/rooch-indexer/.env
Outdated
@@ -0,0 +1 @@ | |||
DATABASE_URL=/Users/Baichuan/.rooch/local/roochdb/indexer.sqlite |
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.
Is the DATABASE_URL
must an absolute path?
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.
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(); |
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.
Should keep the temp_dir()
returned DataDirPath
. Otherwise, the temp dir will be removed when the DataDirPath instance is dropped.
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.
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 { |
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.
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.
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, the transactionFilter
query RPC will be implemented in the following pr later to support queries including sender and other dimensions.
I will merge this PR first. |
Summary
part of #1028
Server start
failure prompt and supportedServer clean
to give the corresponding networkTODO
Solve the problem of automatic creation of Sqlite schema when
Server start
and integration test. There are two optiondiesel migrate run
to complete schema initialization, which means thatServer start
and integration test have pre-dependenciesdiesel migrate run
in rooch cli to eliminate pre-dependencies and the user experience will be smoother.Add more testcase