TransWikia.com

How to reduce NET and CPU usage in Private EOS

EOS.IO Asked by Zohaib Basit on August 20, 2021

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 );
   }

Answered by conr2d on August 20, 2021

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

Answered by Umer on August 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP