## 生成账号 & 部署合约 1. ### 可以用命令行生成公钥/私钥 bendeMacBook-Pro:~ ben$ `cleos create key --to-console` Private key: 5JgZ2aRteVHmAXdGmjLWzUMMTNMgkoaEcRnSzuQA2nRGMwAsNqB Public key: EOS5UJR2Np5NPaAJaNpew5aQBRpEKdKBKftPcWhA5fngx3mrax2Bp 2. ### 通过网站生成账号 账号地址:[http://jungle.cryptolions.io/#account](http://jungle.cryptolions.io/#account) 输入 12位的账号、以及上面生成的公钥 生成账号
Account name: luckpoint2co Owner Public Key: EOS5UJR2Np5NPaAJaNpew5aQBRpEKdKBKftPcWhA5fngx3mrax2Bp Active Public Key: EOS5UJR2Np5NPaAJaNpew5aQBRpEKdKBKftPcWhA5fngx3mrax2Bp
检验账号是否创建: `cleos -u https://api.jungle.alohaeos.com/ get account luckpoint2co` * ### 创建一个钱包 * `cleos wallet create --to-console` 或者是 `cleos wallet create --name mywallet --to-console` 注意:不带 `--name xxx` 时则使用 `default` 为钱包名字; 如果想对指定钱包操作,每次都需要带上这个参数及名字,在往下的`cleos`对钱包的操作中不再重复 * `cleos wallet unlock --password PW5xxxxxxxxxx...` 后面紧跟着是前面生成的密钥,当然也可能通过隐性的方式输入密钥 如:`cleos wallet unlock`,会提示输入密钥 * 导入 luckpoint2co 账号的私钥 `cleos wallet import --private-key 5JgZ2aRteVHmAXdGmjLWzUMMTNMgkoaEcRnSzuQA2nRGMwAsNqB` * ### 编译 & 发布合约 * 使用 eosiocpp 脚本编译 .cpp 和 .abi 文件: ``` cd eos eosiocpp -o contracts/dice/dice.wast contracts/dice/dice.cpp eosiocpp -g contracts/dice/dice.abi contracts/dice/dice.cpp ``` * 使用luckpoint2co来发布合约: ``` cd eos cleos -u https://api.jungle.alohaeos.com/ set contract luckpoint2co contracts/dice -p luckpoint2co@active ``` 可能出现的问题: Error 3080001: Account using more than allotted RAM usage Error Details: account luckpoint2co has insufficient ram; needs 349456 bytes has 167452 bytes * 买内存Ram: `cleos system buyram payer receiver "10 EOS"` 例子: cleos -u https://api.jungle.alohaeos.com/ system buyram luckpoint2co luckpoint2co --kbytes 1000 可能出现的问题: Error 3050003: eosio_assert_message assertion failure Error Details: assertion failure with message: no balance object found pending console output: * 查询用户余额: cleos -u https://api.jungle.alohaeos.com/ get currency balance eosio.token luckpoint2co 输出: ``` 439.6621 EOS 500.0000 JUNGLE ``` * 测试网添加EOS币: [http://jungle.cryptolions.io/#faucet](http://jungle.cryptolions.io/#faucet) 输入 luckpoint2co ,点击"Send Coins". XXX445 ![screenshot of conversion](https://raw.github.com/adam-p/markdown-here/master/store-assets/markdown-here-image1.gimp.png) ### Table of Contents **[Installation Instructions](#installation-instructions)**
**[Usage Instructions](#usage-instructions)**
**[Troubleshooting](#troubleshooting)**
**[Compatibility](#compatibility)**
**[Notes and Miscellaneous](#notes-and-miscellaneous)**
**[Building the Extension Bundles](#building-the-extension-bundles)**
**[Next Steps, Credits, Feedback, License](#next-steps)**
## Installation Instructions ### Chrome #### Chrome Web Store Go to the [Chrome Web Store page for *Markdown Here*](https://chrome.google.com/webstore/detail/elifhakcjgalahccnjkneoccemfahfoa) and install normally. After installing, make sure to reload your webmail or restart Chrome!