-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add pub_keys and account_controls collections. #4756
Conversation
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.
One suggestion, otherwise fine to commit
}; | ||
|
||
const account_name mongo_db_plugin_impl::newaccount = "newaccount"; | ||
const account_name mongo_db_plugin_impl::setabi = "setabi"; | ||
const action_name mongo_db_plugin_impl::newaccount = N(newaccount); |
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.
Suggestion: use newaccount::get_name() for actions and config::active_name and config::owner_name for these constants
@@ -293,7 +292,8 @@ void mongo_db_plugin_impl::consume_blocks() { | |||
} | |||
auto time = fc::time_point::now() - start_time; | |||
auto per = size > 0 ? time.count()/size : 0; | |||
ilog( "process_accepted_transaction, time per: ${p}, size: ${s}, time: ${t}", ("s", size)("t", time)("p", per) ); | |||
if( time > fc::microseconds(500000) ) // reduce logging, .5 secs |
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.
How about making this a mongodb_plugin option? Just a suggestion, fine to keep it as .5 secs
@@ -865,7 +864,7 @@ void mongo_db_plugin_impl::_process_irreversible_block(const chain::block_state_ | |||
const auto block_num = bs->block->block_num(); | |||
|
|||
// genesis block 1 is not signaled to accepted_block | |||
if (block_num < 2) return; | |||
// if (block_num < 2) return; |
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.
can we get rid of this?
Resolves #4681
The equivalent of
/v1/history/get_key_accounts
with mongo:db.pub_keys.find({"public_key":"EOS7EarnUhcyYqmdnPon8rm7mBCTnBoot6o7fE2WzjvEX2TdggbL3"}).pretty()
The equivalent of
/v1/history/get_controlled_acounts
with mongo:db.account_controls.find({"controlling_account":"hellozhangyi"}).pretty()
This PR also includes a number of performance improvements.