docker部署OKExChain主网

  • toString
  • 更新于 2021-09-13 20:21
  • 阅读 228

docker部署OKExChain主网

一. 编写说明

1.1 文档说明

  • 文档内容
通过本文档对欧易链链使用docker部署主网过程进行描述
  • 部署服务

<table> <tr> <th>服务器</th> <th>程序</th> <th>默认端口</th> </tr> <tr> <td rowspan="9">127.0.0.1</td> <td>欧易链主网节点(OKExChain)</td> <td>rpc接口:8545<br>p2p接口:26656</td> </tr> </table>

1.2 配置信息

  • 硬件配置
服务器系统:Centos7+
CPU:4核
内存:8GB
硬盘:SSD 500 GB
网络:5M独立带宽
  • 软件环境
Docker:19.03.11

注意:软件使用版本不强制使用与上面一样的版本

1.3 部署文档信息

二、下载OKExChain主网镜像

docker pull okexchain/fullnode-mainnet:v0.19.5

三、OKExChain主网容器升成

3.1 创建文件夹

mkdir /opt/docker/okexchain

3.2 容器启动

docker run -itd --restart=unless-stopped -v /etc/localtime:/etc/localtime -v /etc/timezone:/etc/timezone --name okexchain -v /opt/docker/okexchain:/root/.exchaind/data/ -p 8545:8545 -p 26656:26656 okexchain/fullnode-mainnet:v0.19.5

3.3 查看容器日志

docker logs --tail 100 -f okexchain

四、查看OKExChain主网同步节点是否部署成功

  • 查看OKExChain容器是否成功启动
# docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                                                                                              NAMES
97527d0c5e32        okexchain/fullnode-mainnet:v0.19.5   "sh -c /root/start.sh"   5 minutes ago       Up 5 minutes        6060/tcp, 0.0.0.0:8545->8545/tcp, 8546/tcp, 26657/tcp, 26659-26660/tcp, 0.0.0.0:26656->26656/tcp   okexchain
  • 查看OKExChain节点启动日志是否正常
# docker logs -f okexchain
{"app_message":{"ammswap":{"params":{"fee_rate":"0.003000000000000000"},"swap_token_pair_records":null},"auth":{"accounts":[],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000","tx_sig_limit":"7","tx_size_cost_per_byte":"10"}},"backend":null,"bank":{"send_enabled":true},"crisis":{"constant_fee":{"amount":"1000.000000000000000000","denom":"okt"}},"debug":null,"dex":{"max_token_pair_id":"0","operators":null,"params":{"delist_max_deposit_period":"86400000000000","delist_min_deposit":[{"amount":"100.000000000000000000","denom":"okt"}],"delist_voting_period":"259200000000000","list_fee":{"amount":"20000.000000000000000000","denom":"okt"},"ownership_confirm_window":"86400000000000","register_operator_fee":{"amount":"0.000000000000000000","denom":"okt"},"transfer_ownership_fee":{"amount":"10.000000000000000000","denom":"okt"},"withdraw_period":"259200000000000"},"product_locks":{"Data":{}},"token_pairs":null,"withdraw_infos":null},"distribution":{"delegator_withdraw_infos":[],"fee_pool":{"community_pool":[]},"params":{"community_tax":"0.020000000000000000","withdraw_addr_enabled":true},"previous_proposer":"","validator_accumulated_commissions":[]},"evidence":{"evidence":[],"params":{"max_evidence_age":"120000000000"}},"evm":{"accounts":[],"chain_config":{"byzantium_block":"0","constantinople_block":"0","dao_fork_block":"0","dao_fork_support":true,"eip150_block":"0","eip150_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155_block":"0","eip158_block":"0","ewasm_block":"-1","homestead_block":"0","istanbul_block":"0","muir_glacier_block":"0","petersburg_block":"0","yoloV2_block":"-1"},"contract_blocked_list":[],"contract_deployment_whitelist":[],"params":{"enable_call":false,"enable_contract_blocked_list":false,"enable_contract_deployment_whitelist":false,"enable_create":false,"extra_eips":null,"max_gas_limit_per_tx":"30000000"},"txs_logs":[]},"farm":{"current_rewards":[],"historical_rewards":[],"lock_infos":[],"params":{"create_pool_deposit":{"amount":"10.000000000000000000","denom":"okt"},"create_pool_fee":{"amount":"0.000000000000000000","denom":"okt"},"quote_symbol":"usdk","yield_native_token":false},"pools":[],"pools_yield_native_token":null},"genutil":{"gentxs":null},"gov":{"deposit_params":{"max_deposit_period":"86400000000000","min_deposit":[{"amount":"100.000000000000000000","denom":"okt"}]},"deposits":null,"proposals":[],"starting_proposal_id":"1","tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto":"0.334000000000000000","yes_in_vote_period":"0.667000000000000000"},"votes":null,"voting_params":{"voting_period":"259200000000000"},"waiting_proposals":{}},"mint":{"minter":{"minted_per_block":[{"amount":"0.000000000000000000","denom":"okt"}],"next_block_to_update":"0"},"original_minted_per_block":"1.000000000000000000","params":{"blocks_per_year":"10519200","deflation_epoch":"3","deflation_rate":"0.500000000000000000","farm_proportion":"0.500000000000000000","goal_bonded":"0","inflation_max":"0","inflation_min":"0","inflation_rate_change":"0","mint_denom":"okt"}},"order":{"open_orders":null,"params":{"cancel_order_msg_gas_unit":"30000","fee_per_block":{"amount":"0.000000000000000000","denom":"okt"},"max_deals_per_block":"1000","new_order_msg_gas_unit":"40000","order_expire_blocks":"259200","trade_fee_rate":"0.001000000000000000"}},"params":{"params":{"max_block_height":"100000","max_deposit_period":"86400000000000","min_deposit":[{"amount":"100.000000000000000000","denom":"okt"}],"voting_period":"259200000000000"}},"slashing":{"missed_blocks":{},"params":{"downtime_jail_duration":"600000000000","min_signed_per_window":"0.050000000000000000","signed_blocks_window":"10000","slash_fraction_double_sign":"0.000000000000000000","slash_fraction_downtime":"0.000000000000000000"},"signing_infos":{}},"staking":{"all_shares":null,"delegators":null,"exported":false,"last_total_power":"0","last_validator_powers":null,"params":{"epoch":252,"max_bonded_validators":21,"max_validators_to_add_shares":30,"min_delegation":"0.000100000000000000","min_self_delegation":"10000.000000000000000000","unbonding_time":"1209600000000000"},"proxy_delegator_keys":null,"unbonding_delegations":null,"validators":null},"stream":null,"supply":{"supply":[]},"token":{"locked_assets":null,"locked_fees":null,"params":{"burn_fee":{"amount":"10.000000000000000000","denom":"okt"},"issue_fee":{"amount":"2500.000000000000000000","denom":"okt"},"mint_fee":{"amount":"10.000000000000000000","denom":"okt"},"modify_fee":{"amount":"0.000000000000000000","denom":"okt"},"ownership_confirm_window":"86400000000000","transfer_ownership_fee":{"amount":"10.000000000000000000","denom":"okt"}},"tokens":[{"description":"OK Group Global Utility Token","mintable":true,"original_symbol":"okt","original_total_supply":"1000000000.000000000000000000","owner":"ex10q0rk5qnyag7wfvvt7rtphlw589m7frs3hvqmf","symbol":"okt","type":"0","whole_name":"OKT"}]},"upgrade":{}},"chain_id":"exchain-66","gentxs_dir":"","moniker":"fullnode","node_id":"07c645e5ea1b68efae3a1d053d0770651f88eacf"}
--2021-09-13 18:12:21--  https://raw.githubusercontent.com/okex/mainnet/main/genesis.json
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7628169 (7.3M) [text/plain]
Saving to: '/root/.exchaind/config/genesis.json'

/root/.exchaind/con 100%[===================>]   7.27M  --.-KB/s    in 0.03s   

2021-09-13 18:12:22 (266 MB/s) - '/root/.exchaind/config/genesis.json' saved [7628169/7628169]

I[2021-09-13|18:12:22.625][21] starting ABCI with Tendermint                module=main 
I[2021-09-13|18:12:30.128][21] Executed block                               module=state height=2322602 validTxs=0 invalidTxs=0
I[2021-09-13|18:12:30.138][21] Committed state                              module=state height=2322602 txs=0 appHash=475CDCC48EF8D9149399A214D4F0F0F8AF164A0471252B3EAD5C59E153CE5A51
I[2021-09-13|18:12:30.141][21] Interval&lt;33ms>, ApplyBlock&lt;2322602>, tx&lt;0>, elapsed&lt;26ms>, validateBlock&lt;2ms>, abci&lt;15ms>, validate&lt;0ms>, updateState&lt;0ms>, commit&lt;5ms>, evpool&lt;0ms>, saveState&lt;3ms> module=main 
I[2021-09-13|18:12:30.161][21] Executed block                               module=state height=2322603 validTxs=0 invalidTxs=0
I[2021-09-13|18:12:30.169][21] Committed state                              module=state height=2322603 txs=0 appHash=4C350A691780FBED3DBF82FF257C5C0F24943877F7F27A16B2E0549F6D5D8FA5

五、查看OKExChain主网同步节点是否同步完成

  • 查看节点区块数据同步进度 查看节点当前同步的同步进度,返回为false,则OKExChain同步节点区块数据同步完成
#  curl -s -H Content-Type:application/json -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":false}
  • 查看节点最新区块号 查看节点当前同步的最新区块号,与OKExChain官方区块链浏览器进行对比,查看是否一致,是否已与公网节点的区块一致

OKExChain官方主网浏览器:https://www.oklink.com/okexchain

# curl -s -H Content-Type:application/json -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":"0x23b143"}

以上,就是今天分享的全部内容了。

希望大家通过以上方式可以解决自己的实际需求,解决自己目前所遇到的问题。

如果在部署过程中有任何疑问,可以扫描下面的二维码,添加我的个人微信,备注:地区-职业方向-昵称,欢迎来撩,加入区块链技术交流群,与更多的区块链技术大佬学习交流。 .jpg

原创不易,码字不易。 觉得这篇文章对你有点用的话,麻烦你为本文点个赞,留言或转发一下,因为这将是我输出更多优质文章的动力,感谢!

点赞 1
收藏 0
分享
本文参与登链社区写作激励计划 ,好文好收益,欢迎正在阅读的你也加入。

0 条评论

请先 登录 后评论
toString
toString
添加微信:Jemooner ,备注:【登链社区读者】即可加入读者交流群