Learning diary learn EOS part 2, 学习笔记,EOS学习2

in #programming6 years ago (edited)

Screen Shot 2018-06-10 at 2.37.53 PM.png
Hello Steemit friends, so yesterday I was installing EOS using docker into my Mac computer, however I faced an issue where I am unable to create a wallet, its seem like docker will simply create a wallet inside an invalid path and therefore no wallet can be found

大家好,昨天我用docker安装了EOS进我的mac电脑后,发现不能创造钱包,因为他创造钱包的路线好象不对

So I have no choice but to try to reinstall EOS into Ubuntu 16.04 and luckily its a success

没办法之下,我再安装整体的EOS到Ubuntu16.04 好采成功

so first step is to boot the nodeos
第一步是启动nodeos

cd build/programs/nodeos
./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin 

then i try to create new wallet using below command
然后用以下的代码创造钱包

./cleos wallet create -n fundurianwallet

so a new wallet called fundurianwallet is been created, a long password is shown, so I copy down the password
新的fundurianwallet创造后,记得抄下密码

then I create the key pair
然后就是创造钥匙

./cleos create key

so I will get one public key and one private key, I copy down that as well, i do this 2 times, becoz i need 2 account later
有公钥和私钥,我创造两套,我需要两套,因为等下开两个户口

then I create 2 account using below code

./cleos create account eosio fundurian {$public key}{$active key}
./cleos create account eosio eosio.token {$public key}{$active key}

So i created a new account called fundurian and attached the first public key i created, and also created a second account called eosio.token and attached the second public key
先开了一个叫fundurian的户口,然后把第一套公钥绑定,再开第二个户口叫eosio.token,用第二套公钥绑定

then I deploy eostoken contract to the eosio.token account
然后把智能合约发布到eosio.token的户口

./cleos set contract eosio.token /root/eos/build/contracts/eosio.token -p eosio.token

now that eosio.token account can issue new token

since my account eosio.token have the smart contract that can issue token
then i create a new token called funtoken with maximum of 1 million unit
拥有智能合约的户口eosio.token可以发币了,先发1百万个FUNTOKEN

cleos push action eosio.token create '[ "eosio", "1000000.00 FUNTOKEN”]’ -p eosio.token

Now i give fundurian 200 FUNTOKEN from my eosio.token account
先给fundurian200个FUNTOKEN

./cleos push action eosio.token issue '[ “fundurian”, “200.00 FUNTOKEN”, "memo" ]' -p eosio

now if i check fundurian account using the below command
再用下面的代码查看fundurian这个户口有多少个币

./cleos get currency balance eosio.token fundurian

the result is 200 FUNTOKEN
可以看到fundurian有200个FUNTOKEN

that it, it was quite fun to be honest, it seem to be easier than ethereum smart contract
很好玩,而且比ethereum的智能合约更加简单,

thanks for reading
谢谢阅读

Sort:  

跟着你这个系列学了

Go here https://steemit.com/@a-a-a to get your post resteemed to over 72,000 followers.

你那里天气如何?听说有才的人都去参加 “三个一” 活动了呢,你要不要去耍耍?如果不想再收到我的留言,请回复“取消”。

You just received a Tier 0 upvote! Looking for bigger rewards? Click here and learn how to get them or visit us on Discord
If you would like to opt out of receiving comments reply with STOP

Thank you for sharing your posts with us. This post was curated by TeamMalaysia as part of our community support. Looking forward for more posts from you.

To support the growth of TeamMalaysia Follow our upvotes by using steemauto.com and follow trail of @myach

Vote TeamMalaysia witness bitrocker2020 using this link vote bitrocker2020 witness

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 60844.65
ETH 2995.69
USDT 1.00
SBD 3.88