EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.6k forks source link

unnecessary checks on cleos system newaccount ? #6873

Closed gaboesquivel closed 5 years ago

gaboesquivel commented 5 years ago

Hi

Today stumbled upon this problem:

On an private chain with no resource market.

cleos system newaccount keeps throwing at me ERROR: One of --buy-ram, --buy-ram-kbytes or --buy-ram-bytes should have non-zero value on Build version: d4ffb4eb.

on the other hand EOSJS 20 beta 3 works nicely for

 actions: [{
    account: 'eosio',
    name: 'newaccount',
    authorization: [{
      actor: 'myoldaccount',
      permission: 'active',
    }],
    data: {
      creator: 'myoldaccount',
      name: 'mynewaccount',
      owner: {
        threshold: 1,
        keys: [{
          key: 'PUB_R1_6FPFZqw5ahYrR9jD96yDbbDNTdKtNqRbze6oTDLntrsANgQKZu',
          weight: 1
        }],
        accounts: [],
        waits: []
      },
      active: {
        threshold: 1,
        keys: [{
          key: 'PUB_R1_6FPFZqw5ahYrR9jD96yDbbDNTdKtNqRbze6oTDLntrsANgQKZu',
          weight: 1
        }],
        accounts: [],
        waits: []
      },
    },
  }]
arhag commented 5 years ago

On an private chain with no resource market.

In that case use cleos create account rather than cleos system newaccount.

yashbhavsar007 commented 5 years ago

Have you deployed system contracts and other contracts on your private network as per https://developers.eos.io/eosio-nodeos/docs/bios-boot-sequence ?

gaboesquivel commented 5 years ago

Thanks, I'm aware of cleos create account and the boot sequence.

It just seems to me counterintuitive to me to have cleos system newaccount requiring those flags.

gaboesquivel commented 5 years ago

What I was suggesting is that perhaps the simple flag could be explicit. https://github.com/EOSIO/eos/blob/master/programs/cleos/main.cpp#L993

Now I'm realizing that cleos system has a very specific scope.

create_account