1

I'm using eos 1.4.3 and ubuntu 16.4 I'm not using docker, I've built the project locally.

I've just created 2 new accounts (Alice and Bob), I've also instantiated the eosio account.

I've read and seen many tutorials on how to create and send tokens to accounts, but most of them are related to "custom tokens" created from the demo token contract.

What I'm interested is using the actual EOS tokens for my local dev test environment.

enter image description here

How can I use the EOS tokens? aren't they there by default in the test dev blockchain? Or am I forced to create a custom token with the demo token contract?

1 Answer 1

1

You can specify the core symbol when building. In the main chain's case, EOS is the core symbol. The flag to pass is -s [CORE_SYMBOL]. You can see this in the Build.sh file.

[CoreSymbolName -s <1-7 characters>]

You can also see the logic for defaulting as SYS in the Build.sh

CORE_SYMBOL_NAME="SYS"

To create the SYS token, you first need to create the eosio.token account.

cleos create account eosio eosio.token [OWNER_KEY] [ACTIVE_KEY]

This assumes you've already imported the default private chain key to sign as eosio as well as set the eosio.bios contract:

cleos wallet import --private-key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

From there you can set the contract to the eosio.token account:

cleos set contract eosio.token build/contracts/eosio.token -p eosio.token@active

Create the token:

cleos push action eosio.token create '[ "eosio", "1000000000.0000 SYS"]' -p eosio.token@active

Issue it:

cleos push action eosio.token issue '[ "alice", "100.0000 SYS", "memo" ]' -p eosio@active

And transfer it:

cleos push action eosio.token transfer '[ "alice", "bob", "25.0000 SYS", "m" ]' -p alice@active

You can then push the system contract to get more of the attributes of the main chain which are described in more detail here.

1
  • Thanks for the thorough answer, everything is clear!
    – Luther
    Commented Nov 20, 2018 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.