开始准备EOS项目

  • 获取EOS主网项目代码
    git clone https://github.com/EOS-Mainnet/eos.git
  • 进入eos代码目录,切换当前所需的分支
    git checkout --no-track -b Branch_v1.1.0 Mainnet-1.1.0 --
  • 开始编译
    ./eosio_build.sh
  • 执行安装
    sudo make install
  • 建立链接 避免出现 (更新v1.1.0后,在执行 sudo make install 之后,cleos 等指令还是无效)
    ln -s /usr/local/eosio/bin/nodeos /usr/local/bin/nodeos
    ln -s /usr/local/eosio/bin/cleos /usr/local/bin/cleos

开始配置,接入eosfans测试网络

先运行下nodeos,将会自动创建~/.local/share/eosio/nodeos/config目录和config.ini文件。
修改config.ini中如下内容

//添加
p2p-peer-address = p2p.party.eostea.io:56234
//修改 可忽略
agent-name = "EOS Test Agent"
//如果需要外部eosjs调用的话,修改
access-control-allow-origin = *
//如果需要查看get actions,取消前面注释
filter-on = *
//如果需要返回错误信息,修改
verbose-http-errors = true
//添加插件支持
plugin = eosio::chain_api_plugin
plugin = eosio::history_plugin
plugin = eosio::history_api_plugin
如果需要生产区块,成为BP

继续修改config.ini

//修改BP名
producer-name = 你的节点名字
//修改BP节点名对应的公钥,私钥 (不要用下面现成的,自己去重新生成!!!)
signature-provider = EOS66bcyj8NBeJigeCDqCeYnaJNFZfCZt328yEpHCh7VZKSxed4Cn=KEY:5KHqSSajXUi11wPEWagiWgY51G6mo4zE4FKfrD2tNH9i4PHHVxU
//添加插件支持
plugin = eosio::producer_plugin
下载测试网络对应的genesis.json

切换到~/.local/share/eosio/nodeos/config目录,
新建genesis.json,将(测试网络genesis.json)内容复制到新建的genesis.json文件中,不要用wget直接下载,github会有转向内容不对.

开始准备启动

  • 先清空data目录 (由于开始测试启动时,写入了一些不兼容的数据块)
    rm -rf ~/.local/share/eosio/nodeos/data
  • ~/.local/share/eosio/nodeos/config执行
    nodeos --genesis-json genesis.json

    此时已启动并开始同步区块

开始配置成为BP

  • cleos wallet create 创建一个默认钱包并保存好解锁密码
  • cleos wallet import {Private_Key} 导入上面config.ini中signature-provider配置的私钥
  • 在测试网络中注册config.ini中producer-name配置的账号 (可以联系eosfans创建),并转入一些系统代币
    root@iZj6cgy98yiuluw41gz0aoZ:~/.local/share/eosio/nodeos/config# cleos get currency balance eosio.token bcskillsurou EOS
    20000000.0000 EOS
  • 将系统代币抵押给自己 (常见问题
    root@iZj6cgy98yiuluw41gz0aoZ:~/.local/share/eosio/nodeos/config# cleos system delegatebw bcskillsurou bcskillsurou '10000000.0000 EOS' '10000000.0000 EOS'
    2018-07-20T12:20:56.591 thread-0   main.cpp:438                  create_action        ] result: {"binargs":"a0129ddec45aab49a0129ddec45aab4900e876481700000004454f530000000000e876481700000004454f530000000000"} arg: {"code":"eosio","action":"delegatebw","args":{"from":"bcskillsurou","receiver":"bcskillsurou","stake_net_quantity":"10000000.0000 EOS","stake_cpu_quantity":"10000000.0000 EOS","transfer":false}} 
    executed transaction: ed7bfc3787629ae9fd27c8ef2a51440a2f89717a4e442e5c5588184ce7664c4b  144 bytes  1798 us
    #         eosio <= eosio::delegatebw            {"from":"bcskillsurou","receiver":"bcskillsurou","stake_net_quantity":"10000000.0000 EOS","stake_cpu...
    #   eosio.token <= eosio.token::transfer        {"from":"bcskillsurou","to":"eosio.stake","quantity":"20000000.0000 EOS","memo":"stake bandwidth"}
    #  bcskillsurou <= eosio.token::transfer        {"from":"bcskillsurou","to":"eosio.stake","quantity":"20000000.0000 EOS","memo":"stake bandwidth"}
    #   eosio.stake <= eosio.token::transfer        {"from":"bcskillsurou","to":"eosio.stake","quantity":"20000000.0000 EOS","memo":"stake bandwidth"}
    warning: transaction executed locally, but may not be confirmed by the network yet    ] 
  • cleos system regproducer {producer-name} {public key} http://{{server}}.com //申请bp
    root@iZj6cgy98yiuluw41gz0aoZ:~/.local/share/eosio/nodeos/config# cleos system regproducer bcskillsurou EOS8H6rzgwpV2KD5AtiDMZLQWw6nDxWaV6jGc7rVY8sHfFuJZjCq4 http://bcskill.com
    2018-07-20T12:36:19.839 thread-0   main.cpp:438                  create_action        ] result: {"binargs":"a0129ddec45aab490003be6e9ef6503430e4c80a2cd52149d2b7b9330d92c2cea4a839632f94ced75daf10687474703a2f2f64617070702e636f6d0000"} arg: {"code":"eosio","action":"regproducer","args":{"producer":"bcskillsurou","producer_key":"EOS8H6rzgwpV2KD5AtiDMZLQWw6nDxWaV6jGc7rVY8sHfFuJZjCq4","url":"http://dappp.com","location":0}} 
    executed transaction: 91df9e3e6e27708ab803ee6da121c2ddd7845fef5f76145dbfd618937ecee5e5  160 bytes  1130 us
    #         eosio <= eosio::regproducer           {"producer":"bcskillsurou","producer_key":"EOS8H6rzgwpV2KD5AtiDMZLQWw6nDxWaV6jGc7rVY8sHfFuJZjCq4","u...
    warning: transaction executed locally, but may not be confirmed by the network yet    ]

需要等主网启动后,才会出块。