I am trying to setup a private eos for my app, I want to know if there is possible to change the usage of CPU, NET etc in private setup without staking tokens. If YES, then please guide me with the procedure.
2 Answers
Easy: Use eosio.bios instead of eosio.system contract
Advanced:
newaccount
in eosio.system initializes account's resources with 0.
void native::newaccount( const name& creator,
const name& newact,
ignore<authority> owner,
ignore<authority> active ) {
/* ... */
user_resources_table userres( get_self(), newact.value );
userres.emplace( newact, [&]( auto& res ) {
res.owner = newact;
res.net_weight = asset( 0, system_contract::get_core_symbol() );
res.cpu_weight = asset( 0, system_contract::get_core_symbol() );
});
// three zero params mean ram, net and cpu in order
// you can change these to proper values, or set -1 to make them unlimited
set_resource_limits( newact, 0, 0, 0 );
}
-
Yes, eosio.bios contract works well for me. You'll be able to create accounts, set the producer schedule and get ordered transaction history as per normal. Commented Mar 16, 2020 at 0:37
You can't just reduce the resources usage if you want to get an alternative and don't have EOS tokens for stake see the REX(Resources Exchange System) in eosio documentation.
Also must watch this video for simple explanation of REX video.
For explanation of different REX functionalities see this blog article