Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add pub_keys and account_controls collections. #4756

Merged
merged 7 commits into from
Jul 24, 2018
Merged

Conversation

heifner
Copy link
Contributor

@heifner heifner commented Jul 19, 2018

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.

Copy link
Contributor

@brianjohnson5972 brianjohnson5972 left a 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);
Copy link
Contributor

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
Copy link
Contributor

@brianjohnson5972 brianjohnson5972 Jul 24, 2018

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;
Copy link
Contributor

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?

@heifner heifner merged commit 51cadb6 into develop Jul 24, 2018
@heifner heifner deleted the mongo-accounts branch July 24, 2018 19:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants