Creating an account on Proton requires 3 actions that must be bundled together:
- Create account with new public key account: 'eosio', name: 'newaccount'
- Buy RAM for new account - minimum 3k - suggested 12k account: 'eosio', name: 'buyrambytes'
- Resource New Account in Proton users table account: 'eosio.proton', name: 'newaccres'
- newAccountName - name of new account: 12 chars (a-z, 1-5)
- creator - account creator name
- newAccountOwnerKey - new EOSIO public key for account
- ramPerAccount - minimum 3k, recommended 12k
Example account creation with cleos
pcleos.sh system newaccount --buy-ram-kbytes <ramPerAccount> <creator> <newAccountName> <newAccountOwnerKey> --stake-net "0.0000 XPR" --stake-cpu "0.0000 XPR";
pcleos.sh push action eosio.proton newaccres '["<newAccountName>"]' -p <creator>
Example account creation with eosjs
const ramPerAccount = “12000”;
const actions = [
{
account: 'eosio',
name: 'newaccount',
data: {
creator: creator,
name: newAccountName,
owner: {
threshold: 1,
keys: [{
key: newAccountOwnerKey,
weight: 1
}],
accounts: [],
waits: []
},
active: {
threshold: 1,
keys: [{
key: newAccountOwnerKey,
weight: 1
}],
accounts: [],
waits: []
}
}
},
{
account: 'eosio',
name: 'buyrambytes',
data: {
payer: creator,
receiver: newAccountName,
bytes: ramPerAccount
}
},
{
account: 'eosio.proton',
name: 'newaccres',
data: {
account: newAccountName
}
}
]
Check the action details here:
https://proton.bloks.io/transaction/78e62a7a798fcc7d0d3e983f021cdff9bbe29458c9060241b2e2e5236590bfe4