Skip to content

Instantly share code, notes, and snippets.

@deckb
Last active June 11, 2018 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deckb/9b10577645ebba02d815eec9369efcb0 to your computer and use it in GitHub Desktop.
Save deckb/9b10577645ebba02d815eec9369efcb0 to your computer and use it in GitHub Desktop.
EOS Create Account and Vote

Intro to using cleos

As of the writing of this tutorial cleos is the only BPC recommended way to create a new account/vote and personally my favorite way to interact with the EOS mainnet.

NOTE I assume you have followed the instructions on how to build the software. https://github.com/EOSIO/eos/wiki/Local-Environment#2-building-eosio

Setup the Wallet

Setting up the wallet is pretty a straight foward process.

  1. Start keosd
keosd 
  1. Create default wallet
cleos wallet create
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5KKmiBLvZSNBKwxAF3yqRw6nBzUZugoXd28mB5MPBCmTbd38aby"
  1. Import private keys (Suggest that you have two different keys for Owner and Active
cleos wallet import <priv key>
imported private key for: EOSxxx

Unless you love your randomly generated gibberish username from the snapshot the first thing you will want to do is create a user-friendly account name.

# the staked amount should look like "1.0025 EOS" and require 4 numbers after the decimal
cleos --url https://api.eosnewyork.io:443 system newaccount <creator_name> <new account> <owner key> <active key> --stake-net "N.NNNN EOS" --stake-cpu "N.NNNN EOS" --buy-ram-kbytes 8 --transfer
# for example
cleos --url https://api.eosnewyork.io:443 system newaccount gibberish111 readablename EOSOwnerKey EOSActiveKey --stake-net "1.0000 EOS" --stake-cpu "1.0000 EOS" --buy-ram-kbytes 8 --transfer

Now after you created your brand spanking new account you might as well vote with it.

cleos --url https://api.eosnewyork.io:443 system voteproducer prods readablename producer1 producer2 producer 3

Now if for some reason you feel your Owner or Active key has been compromised you will need to reset the keys by doing the following commands.

# first add the keys to your wallet
cleos --url https://api.eosnewyork.io:443 wallet import <priv key>

# reset the active key
cleos --url https://api.eosnewyork.io:443 set account permission <account name> active <public key> owner

# reset the owner key
cleos --url https://api.eosnewyork.io:443 set account permission <account name> owner <public key> -p <account name>@owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment