Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
b3cf20db
Commit
b3cf20db
authored
Dec 24, 2021
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add deploy_ebrelayer.md
parent
6abb7750
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
12 deletions
+43
-12
deploy_ebrelayer.md
plugin/dapp/cross2eth/ebrelayer/doc/deploy_ebrelayer.md
+39
-3
ethereum.go
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
+4
-9
No files found.
plugin/dapp/cross2eth/ebrelayer/doc/deploy_ebrelayer.md
View file @
b3cf20db
...
...
@@ -64,7 +64,6 @@ done
```
***
### 启动 relayer B C D
...
...
@@ -91,4 +90,41 @@ done
./ebcli_A ethereum import_privatekey
-k
"
${
ethValidatorAddrKeya
}
"
```
#### 运行持续启动 relayer B C D
\ No newline at end of file
***
### 启动代理 relayer proxy
#### 修改 relayer.toml 配置文件
先 cp relayerA 的配置文件, 然后修改以下字段:
|字段|说明|
|----|----|
|pushName|4 个 relayer 不同相同,
`sed -i 's/^pushName=.*/pushName="XXX"/g' relayer.toml`
|
|ProcessWithDraw|改为 true|
|chain33Host|平行链的 host 地址, 默认: http://localhost:8801, 选任意一个 chain33 平行链地址就可以|
|deploy4chain33|
[
deploy4chain33
]
下字段全部删除, 只需 relayer A 配置一次就可以|
|deploy|
[
deploy
]
下字段全部删除, 只需 relayer A 配置一次就可以|
#### 首次启动 relayer 进行设置
同上...
#### 设置 chain33 代理地址, 及手续费设置
```
shell
# 设置 withdraw 的手续费及每日转帐最大值
result
=
$(${
CLIP
}
ethereum cfgWithdraw
-f
1
-s
ETH
-a
100
-d
18
)
Flags:
-a
,
--amount
float 每日最大值
-d
,
--decimal
int8 token 精度
-f
,
--fee
float 手续费
-s
,
--symbol
string symbol
# 设置 chain33 代理地址
${
Boss4xCLI
}
chain33 offline set_withdraw_proxy
-c
"
${
chain33BridgeBank
}
"
-a
"
${
chain33Validatorsp
}
"
-k
"
${
chain33DeployKey
}
"
-n
"set_withdraw_proxy:
${
chain33Validatorsp
}
"
Flags:
-a
,
--address
string withdraw address
-c
,
--contract
string bridgebank contract address
-f
,
--fee
float contract gas fee
(
optional
)
-k
,
--key
string the deployer private key
-n
,
--note
string transaction note info
(
optional
)
```
\ No newline at end of file
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
View file @
b3cf20db
...
...
@@ -14,6 +14,7 @@ import (
"crypto/ecdsa"
"errors"
"fmt"
"math"
"math/big"
"regexp"
"strings"
...
...
@@ -591,23 +592,17 @@ func (ethRelayer *Relayer4Ethereum) handleLogWithdraw(chain33Msg *events.Chain33
tokenAddr
:=
common
.
HexToAddress
(
withdrawFromChain33TokenInfo
.
Address
)
//从chain33进行withdraw回来的token需要根据精度进行相应的缩放
if
8
!=
withdrawFromChain33TokenInfo
.
Decimal
{
if
withdrawFromChain33TokenInfo
.
Decimal
>
8
{
dist
:=
withdrawFromChain33TokenInfo
.
Decimal
-
8
dist
:=
math
.
Abs
(
float64
(
withdrawFromChain33TokenInfo
.
Decimal
-
8
))
value
,
exist
:=
utils
.
Decimal2value
[
int
(
dist
)]
if
!
exist
{
relayerLog
.
Error
(
"handleLogWithdraw"
,
"does support for decimal, %d"
,
withdrawFromChain33TokenInfo
.
Decimal
)
err
=
errors
.
New
(
"ErrDecimalNotSupport"
)
return
}
if
withdrawFromChain33TokenInfo
.
Decimal
>
8
{
chain33Msg
.
Amount
.
Mul
(
chain33Msg
.
Amount
,
big
.
NewInt
(
value
))
}
else
{
dist
:=
8
-
withdrawFromChain33TokenInfo
.
Decimal
value
,
exist
:=
utils
.
Decimal2value
[
int
(
dist
)]
if
!
exist
{
relayerLog
.
Error
(
"handleLogWithdraw"
,
"does support for decimal, %d"
,
withdrawFromChain33TokenInfo
.
Decimal
)
err
=
errors
.
New
(
"ErrDecimalNotSupport"
)
return
}
chain33Msg
.
Amount
.
Div
(
chain33Msg
.
Amount
,
big
.
NewInt
(
value
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment