steem icon indicating copy to clipboard operation
steem copied to clipboard

initminer authority missing in Master

Open kingswisdom opened this issue 7 years ago • 6 comments

First of all, hello to everybody.

I cloned the master branch of the steem repo, of course after installing the required dependencies.

I'm trying to launch a main net with a different chain ID, which of course work. It gives me the following output :

3315007ms witness_plugin.cpp:507 block_production_loo ] Generated block #1551 with timestamp 2018-07-31T13:55:15 at time 2018-07-31T13:55:15

Then, when I start the cli_wallet, I create a password with set_password, then unlock the wallet, and then I import the initminer private key associated with the public key I configured in the protocol/config.hpp

I then verify if the key was correctly imported, with list_keys, which shows me that the key was correctly saved.

But then, when i try to create an account, or try to broadcast a transaction, it gives me the following error :

2173675ms websocket_api.cpp:102 on_message ] message: {"jsonrpc":"2.0","error":{"code":-32000,"message":"missing required active authority:Missing Active Authority initminer"

For the full error message, please have a look at this : http://jsfiddle.net/j6qterz7/

What I tried so far :

I first saw that the initminer account has the same keys for all the auth (memo, posting, active, owner).

So I thought the cli_wallet couldn't determine which key I imported. I then decided to correct this behaviour by modifying the database.cpp + config.hpp to add different keys to the initminer account at genesis. I then restarted the blockchain from block 1, and i verified on the cli_wallet that the initminer had effectively 4 different keys. Which now does.

But when i import the active key, or the owner key, the same error happen when i try to create an account or broadcast a transaction. So the fix i made didn't work.

I then tried to build from the latest stable build. Now everything works, but the latest stable branch has 1500 commits behind master, which means that the stable branch feels a little bit outdated. Plus we can't configure the init_supply for example.

I searched here and on google already. Some people already had this issue, for example #2282 #2451 #2453

It seems that this issue is also present on Bitshares

I'm not sure how to debug this issue. Is there any fix yet ?

kingswisdom avatar Jul 31 '18 14:07 kingswisdom

@kingswisdom you solved this issue? cause I am getting exact same issue.. and found no solution so far. I also changed my chain-id ..

baaluo avatar Sep 26 '18 06:09 baaluo

I figured this out, This issue occurs, when your code is not using correct chain id , you either need to remove checks from code.. or pass chain-id when running steemd ..

I removed checks from code.

baaluo avatar Oct 10 '18 04:10 baaluo

@baaluo may i know how to pass that chain_Id or how to remove that checks ?

yashbhavsar007 avatar Dec 10 '18 09:12 yashbhavsar007

Got it there is some modifications you need to made when you want to run your own private chain you need to made some changes in cli_wallet's main.hpp file by passing the chain id when you are not on testnet !!!

yashbhavsar007 avatar Dec 11 '18 04:12 yashbhavsar007

Got it there is some modifications you need to made when you want to run your own private chain you need to made some changes in cli_wallet's main.hpp file by passing the chain id when you are not on testnet !!!

how you solve please explain me i'm in same issue

rabbykst avatar Jun 28 '19 17:06 rabbykst

@rabbykst I have resolved this issue by the following solution

#ifdef IS_TEST_NET
      if( options.count("chain-id") )
      {
         auto chain_id_str = options.at("chain-id").as< std::string >();

         try
         {
            _steem_chain_id = chain_id_type( chain_id_str);
         }
         catch( fc::exception& )
         {
            FC_ASSERT( false, "Could not parse chain_id as hex string. Chain ID String: ${s}", ("s", chain_id_str) );
         }
      }
#endif

As you can see these lines of code in main.cpp (programs/cli_wallet) what you need to do is you can copy the code which is inside the #ifdef IS_TEST_NET and paste it outside that IF statement that's how it worked for me.

Also add ("chain-id", bpo::value< std::string >()->default_value( STEEM_CHAIN_ID ), "chain ID to connect to")

After line ("wallet-file,w", bpo::value<string>()->implicit_value("wallet.json"), "wallet to load")

yashbhavsar007 avatar Jul 01 '19 04:07 yashbhavsar007