我们会做什么?
安装所需的环境配置,并使用pm2工具进行管理。
将代币从一个区块链发送到另一个。

github脚本:[cosmos-tolls回购](https://github.com/iammelea/cosmos-tools/tree/master/IBC-GOZ/automotion/scripts“ cosmos-tolls回购”)
1.安装PM2
由于必须控制许多流程,因此我们将使用辅助工具,例如pm2,该工具功能强大,可以帮助您轻松使用IBC。

$ wg ETH ttps://github.com/iammelea/cosmos-tools/blob/master/IBC-GOZ/automotion/scripts/pm2_install.sh$chmod xpm2_install.sh$../pm2_install.sh
2.安装Golang
$ wg ETH ttps://github.com/iammelea/cosmos-tools/blob/master/IBC-GOZ/automotion/scripts/go_install.sh$chmod xgo_install.sh$./go_install.sh
3.安装Gaia和Repeater
$ wg ETH ttps://github.com/iammelea/cosmos-tools/blob/master/IBC-GOZ/automotion/scripts/gaia_rly_install.sh$chmod xgaia_rly_install.sh$./gaia_rly_install.sh
4.基于Cosmos构建第一个区块链
$ wg ETH ttps://github.com/iammelea/cosmos-tools/blob/master/IBC-GOZ/automotion/scripts/1chain_ibc.sh$chmod x1chain_ibc.sh$./1chain_ibc.sh


输入数据后,网络将很快生成块

5.基于Cosmos构建第二个区块链
$ wg ETH ttps://github.com/iammelea/cosmos-tools/blob/master/IBC-GOZ/automotion/scripts/2chain_ibc.sh$chmod x2chain_ibc.sh$./2chain_ibc.sh


到目前为止,已经准备好2个链条和2个水龙头

6.创建一条连接A链和B链的路径,并将数据包从一个链发送到另一链,并执行IBC aKa跨链连接。
$ wg ETH ttps://github.com/iammelea/cosmos-tools/blob/master/IBC-GOZ/automotion/scripts/path_clients.sh$chmod xpath_clients.sh$./path_clients.sh

恭喜,如果您的屏幕看起来像图像,则说明您已经成功创建了客户端,连接和通道,从而使IBC成为可能。

7.监视中继器cmd并通过IBC发送您的第一个包裹rly-h公司

rlytxtransfer-h

检查所有路径
$ rlypthlist0:1_2-gt; chns()clnts()conn()chan()(melea-1a:transfer lt;gt; meleo-2x:transfer)
检查链条和状态
$ rlychlist0:melea-1a-gt; key()bal()lite()path()1:meleo-2x-gt; key()bal()lite()path()
8.将代币从链A转移到链B
$ rlytxtransfer-hThissendstokens fromarelayersconfiguredwalletonchainsrctoadstaddrondstUsage:rlytransacttransfer [src-chain-id] [dst-chain-id] [amount] [source] [dst-chain-addr] [flags]
转移前检查余额
$ rlyqbalmelea-1a99999999970000a btc ,100000000000000a ETH $ rlyqbalmeleo-2x100000000000000abtg,99999999960000aetc
现在从melea-1a向meleo-2x发送1000a btc
用法:rlytransacttransfer [src-chain-id] [dst-chain-id] [amount] [source] [dst-chain-addr] [flags] $ rlytxtransfermelea-1ameleo-2x1000a btc truecosmos18mnwlwctfcae4zyn7ua4swrr4cng92jsznk

$ rlytxtransfermelea-1ameleo-2x1000a btc truecosmos18mnwlwctfcae4zyn7ua4swrr4cng92jsznkI [2020–06–05 | 02:06:23.844][melea-1a] @ {1048} -msg(0:transfer)hash(9E255B3B4C -2x] @ {993}-消息(0:update_client,1:ics04 / opaque)哈希(C646A871F7189F19127082033F12B92F2DABD181A6272C1673780E476E295491)
现在再次检查余额
$ rlyqbalmeleo-2x100000000000000abtg,99999999955000aetc,1000transfer / expjityxqz / a btc $ rlyqbalmelea-1a99999999964000a btc ,100000000000000a ETH
现在,“ meleo-2x”链中的帐户拥有“ a btc ”代币
9.将代币从链B转移到链A
现在将1000abtg从meleo-2x发送到melea-1a
$ rlytxtransfermeleo-2xmelea-1a1000abtgtruecosmos1nqcr5eyggljhhkj5dkysrkc6hhszsc80laraukI [2020-06-05 | 02:15:28.441][meleo-2x] @ {1098} -msg(0:transfer)hash(12637D71F1D3C5LE {1157} -msg(0:update_client,1:ics04 / opaque)哈希(65CB1D740CBE9F009589CCCBAEB627190C54131436C48E041874B44416C4FFD4)

现在再次检查余额
$ rlyqbalmeleo-2x99999999999000abtg,99999999945000aetc,1000transfer / expjityxqz / a btc $ rlyqbalmelea-1a99999999959000a btc ,100000000000000a ETH ,1000transfer / gnamkuaugt / abtg
如您所见,链A具有来自链B的代币,链B具有来自链A的代币
pm2提示cmd
$ pm2ls

$ pm2logs0

$ pm2logs2

$ pm2reloadpm2-ID $ pm2stoppm2-ID $ pm2startpm2-ID $ pm2monit
免责声明:本文为转载,非本网原创内容,不代表本网观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
如有疑问请发送邮件至:bangqikeconnect@gmail.com