create account

EOS之路 第二篇 账户创建与处理 by sheldonhuang

View this thread on: hive.blogpeakd.comecency.com
· @sheldonhuang · (edited)
$4.05
EOS之路 第二篇 账户创建与处理
## 知识储备
eosd操作
 `/eosd --help`
因为篇幅过长,请参阅[eosd 操作导读](https://steemit.com/cn/@sheldonhuang/eos-shell-eosd)
eosc 操作:
![](http://upload-images.jianshu.io/upload_images/3866441-4d9d93ff528b0bdd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
有五个主要的Subcommands:
`create` 创建
`get`  获取账户和合约的信息
`contract` 创建并更新账户上的合约
`transfer` 转账
`benchmark` 配置和执行基准测试
`push` 上链



## 编写协约

### 1. 跳过签名执行transactions,启动single testnets
```
eosd --skip-transaction-signatures
```
如果失败,便执行
```
eosd --resync-blockchain --skip-transaction-signatures
```
> **`--resync-blockchain`**: clear chain database and block log
>  清空之前的chain数据库和日志,了解详情,请参阅[eosd操作导读]()

**成功标志**

![](http://upload-images.jianshu.io/upload_images/3866441-5ec5aef54c3b70c6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
**不要关掉这个窗口,保持运行**


### 2. 新开一个Terminal窗口,生成owner_key和active_key的公钥和私钥,用于账户创建


```
cd ~/eos/build/programs/eosc/  #进入eosc 文件夹
./eosc create key
./eosc create key
```

![](http://upload-images.jianshu.io/upload_images/3866441-64c1f450f634fc16.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

### 3. 通过21个producer中的任何一个创建账户
```
./eosc create account inita exchange PUBLIC_KEY_1 PUBLIC_KEY_2 
```
拷贝两个Public Key 分别替换上面的`PUBLIC_KEY_1` 和 `PUBLIC_KEY_2`


在`genesis.json`里面从inita 到initu一共21个初始化账户作为producer

![](http://upload-images.jianshu.io/upload_images/3866441-fae2119a7c62a3ed.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
成功标志


![](http://upload-images.jianshu.io/upload_images/3866441-d7b46a2493f047d0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)



#### 4.查看刚刚创建的账户状态
```
./eosc get account exchange
```

![](http://upload-images.jianshu.io/upload_images/3866441-fa66e161d0a76b5b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
目前账户余额为0
因为所有的EOS tokens全部在eos账户中

#### 5. 查看初始账户状态
inita 账户
```
./eosc get account inita
```
![](http://upload-images.jianshu.io/upload_images/3866441-9d927baa369b828a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

```
./eosc get account tester
```
![](http://upload-images.jianshu.io/upload_images/3866441-18085e93de3d93a3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


#### 6. 从inita账户向 exchange 转账
```
./eosd transfer inita exchange 1000
```

![](http://upload-images.jianshu.io/upload_images/3866441-73625aa48419985b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)



####7. 检查账户




```
$./eosc get account inita
$./eosc get account tester
```
![](http://upload-images.jianshu.io/upload_images/3866441-33dedcc3995e2a29.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

####8.打开网址查看
```
curl http://127.0.0.1:8888/v1/chain/get_info
```

![](http://upload-images.jianshu.io/upload_images/3866441-0f1854024b70e6a2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


### 9. 小花絮:

![](http://upload-images.jianshu.io/upload_images/3866441-608b53c4e475b846.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)




![](http://upload-images.jianshu.io/upload_images/3866441-15bfc4bba8082bdf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

技术爱好者的知识星球会分享最及时的EOS 团队进展以及技术发展
```
本星球会分享:
     - EOS code 基础知识:
             - C++: boost, CMake,Clang,
             - Linux:OpenSSL,LLVM 4.0,
             - 安全加密: secp256k1-zkp, PGP
             - 前端: WASM,Javascript
     - 筛选并发布Telegram “EOS Developer”优质信息
          -  EOS 单机节点运行
     -  EOS 虚拟多节点运行 (pseudo-distributed)
     -  EOS 多节点运行
     -  EOS智能合约编写与发布
     - 优秀项目架构和设计原理: 
              - graphene(石墨烯),Steemit,BitShares
              - PressOne,BigOne
              - OracleChain
              - Motion.one
              - HMS(Health Mutual Society)
```
👍  , , , , , , , , , ,
properties (23)
authorsheldonhuang
permlink7pu6yi-eos
categorycn
json_metadata{"tags":["cn","eos","eosdev","cryptocurrency","technology"],"app":"steemit/0.1","format":"markdown","image":["http://upload-images.jianshu.io/upload_images/3866441-4d9d93ff528b0bdd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-5ec5aef54c3b70c6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-64c1f450f634fc16.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-fae2119a7c62a3ed.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-d7b46a2493f047d0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-fa66e161d0a76b5b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-9d927baa369b828a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-18085e93de3d93a3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-73625aa48419985b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-33dedcc3995e2a29.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-0f1854024b70e6a2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-608b53c4e475b846.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240","http://upload-images.jianshu.io/upload_images/3866441-15bfc4bba8082bdf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"],"links":["https://steemit.com/cn/@sheldonhuang/eos-shell-eosd"]}
created2017-09-09 04:53:48
last_update2017-09-09 05:01:36
depth0
children0
last_payout2017-09-16 04:53:48
cashout_time1969-12-31 23:59:59
total_payout_value3.086 HBD
curator_payout_value0.968 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,611
author_reputation626,377,591,469
root_title"EOS之路 第二篇 账户创建与处理"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id14,323,579
net_rshares1,422,304,446,892
author_curate_reward""
vote details (11)