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
31cf8b00
Commit
31cf8b00
authored
May 26, 2020
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete func GetRunningStatus
parent
5e4e66a6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
95 deletions
+2
-95
chain33RelayerCmd.go
plugin/dapp/x2Ethereum/ebcli/chain33RelayerCmd.go
+0
-18
ethereumRelayerCmd.go
plugin/dapp/x2Ethereum/ebcli/ethereumRelayerCmd.go
+0
-18
chain33.go
plugin/dapp/x2Ethereum/ebrelayer/relayer/chain33/chain33.go
+0
-22
ethereum.go
...in/dapp/x2Ethereum/ebrelayer/relayer/ethereum/ethereum.go
+0
-21
manager.go
plugin/dapp/x2Ethereum/ebrelayer/relayer/manager.go
+2
-16
No files found.
plugin/dapp/x2Ethereum/ebcli/chain33RelayerCmd.go
View file @
31cf8b00
...
@@ -21,7 +21,6 @@ func Chain33RelayerCmd() *cobra.Command {
...
@@ -21,7 +21,6 @@ func Chain33RelayerCmd() *cobra.Command {
ImportPrivateKeyCmd
(),
ImportPrivateKeyCmd
(),
ShowValidatorAddrCmd
(),
ShowValidatorAddrCmd
(),
ShowTxsHashCmd
(),
ShowTxsHashCmd
(),
ShowChain33RelayerStatusCmd
(),
)
)
return
cmd
return
cmd
...
@@ -94,20 +93,3 @@ func showChain33Relayer2EthTxs(cmd *cobra.Command, args []string) {
...
@@ -94,20 +93,3 @@ func showChain33Relayer2EthTxs(cmd *cobra.Command, args []string) {
fmt
.
Println
(
hash
)
fmt
.
Println
(
hash
)
}
}
}
}
func
ShowChain33RelayerStatusCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"status"
,
Short
:
"show chain33-relayer status"
,
Run
:
showChain33RelayerStatus
,
}
return
cmd
}
func
showChain33RelayerStatus
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
var
res
ebTypes
.
RelayerRunStatus
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"Manager.ShowChain33RelayerStatus"
,
nil
,
&
res
)
ctx
.
Run
()
}
plugin/dapp/x2Ethereum/ebcli/ethereumRelayerCmd.go
View file @
31cf8b00
...
@@ -28,7 +28,6 @@ func EthereumRelayerCmd() *cobra.Command {
...
@@ -28,7 +28,6 @@ func EthereumRelayerCmd() *cobra.Command {
ShowValidatorsAddrCmd
(),
ShowValidatorsAddrCmd
(),
ShowChain33TxsHashCmd
(),
ShowChain33TxsHashCmd
(),
ShowEthereumTxsHashCmd
(),
ShowEthereumTxsHashCmd
(),
ShowEthRelayerStatusCmd
(),
IsValidatorActiveCmd
(),
IsValidatorActiveCmd
(),
ShowOperatorCmd
(),
ShowOperatorCmd
(),
DeployContrctsCmd
(),
DeployContrctsCmd
(),
...
@@ -181,23 +180,6 @@ func showEthTxs(cmd *cobra.Command, args []string) {
...
@@ -181,23 +180,6 @@ func showEthTxs(cmd *cobra.Command, args []string) {
}
}
}
}
func
ShowEthRelayerStatusCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"status"
,
Short
:
"show ethereum-relayer status"
,
Run
:
showEthRelayerStatus
,
}
return
cmd
}
func
showEthRelayerStatus
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
var
res
ebTypes
.
RelayerRunStatus
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"Manager.ShowEthRelayerStatus"
,
nil
,
&
res
)
ctx
.
Run
()
}
func
IsValidatorActiveCmd
()
*
cobra
.
Command
{
func
IsValidatorActiveCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"active"
,
Use
:
"active"
,
...
...
plugin/dapp/x2Ethereum/ebrelayer/relayer/chain33/chain33.go
View file @
31cf8b00
...
@@ -49,7 +49,6 @@ type Relayer4Chain33 struct {
...
@@ -49,7 +49,6 @@ type Relayer4Chain33 struct {
ctx
context
.
Context
ctx
context
.
Context
rwLock
sync
.
RWMutex
rwLock
sync
.
RWMutex
unlock
chan
int
unlock
chan
int
status
int32
}
}
// StartChain33Relayer : initializes a relayer which witnesses events on the chain33 network and relays them to Ethereum
// StartChain33Relayer : initializes a relayer which witnesses events on the chain33 network and relays them to Ethereum
...
@@ -85,32 +84,11 @@ func StartChain33Relayer(ctx context.Context, syncTxConfig *ebTypes.SyncTxConfig
...
@@ -85,32 +84,11 @@ func StartChain33Relayer(ctx context.Context, syncTxConfig *ebTypes.SyncTxConfig
return
relayer
return
relayer
}
}
func
(
chain33Relayer
*
Relayer4Chain33
)
SetPassphase
(
passphase
string
)
{
chain33Relayer
.
rwLock
.
Lock
()
chain33Relayer
.
passphase
=
passphase
chain33Relayer
.
rwLock
.
Unlock
()
}
func
(
chain33Relayer
*
Relayer4Chain33
)
QueryTxhashRelay2Eth
()
ebTypes
.
Txhashes
{
func
(
chain33Relayer
*
Relayer4Chain33
)
QueryTxhashRelay2Eth
()
ebTypes
.
Txhashes
{
txhashs
:=
utils
.
QueryTxhashes
([]
byte
(
chain33ToEthBurnLockTxHashPrefix
),
chain33Relayer
.
db
)
txhashs
:=
utils
.
QueryTxhashes
([]
byte
(
chain33ToEthBurnLockTxHashPrefix
),
chain33Relayer
.
db
)
return
ebTypes
.
Txhashes
{
Txhash
:
txhashs
}
return
ebTypes
.
Txhashes
{
Txhash
:
txhashs
}
}
}
func
(
chain33Relayer
*
Relayer4Chain33
)
GetRunningStatus
()
(
relayerRunStatus
*
ebTypes
.
RelayerRunStatus
)
{
relayerRunStatus
=
&
ebTypes
.
RelayerRunStatus
{}
chain33Relayer
.
rwLock
.
RLock
()
relayerRunStatus
.
Status
=
chain33Relayer
.
status
chain33Relayer
.
rwLock
.
RUnlock
()
if
relayerRunStatus
.
Status
==
ebTypes
.
StatusPending
{
if
nil
==
chain33Relayer
.
privateKey4Ethereum
{
relayerRunStatus
.
Details
=
"Ethereum's private key not imported"
}
return
}
relayerRunStatus
.
Details
=
"Running"
return
}
func
(
chain33Relayer
*
Relayer4Chain33
)
syncProc
(
syncCfg
*
ebTypes
.
SyncTxReceiptConfig
)
{
func
(
chain33Relayer
*
Relayer4Chain33
)
syncProc
(
syncCfg
*
ebTypes
.
SyncTxReceiptConfig
)
{
_
,
_
=
fmt
.
Fprintln
(
os
.
Stdout
,
"Pls unlock or import private key for Chain33 relayer"
)
_
,
_
=
fmt
.
Fprintln
(
os
.
Stdout
,
"Pls unlock or import private key for Chain33 relayer"
)
<-
chain33Relayer
.
unlock
<-
chain33Relayer
.
unlock
...
...
plugin/dapp/x2Ethereum/ebrelayer/relayer/ethereum/ethereum.go
View file @
31cf8b00
...
@@ -56,7 +56,6 @@ type Relayer4Ethereum struct {
...
@@ -56,7 +56,6 @@ type Relayer4Ethereum struct {
maturityDegree
int32
maturityDegree
int32
fetchHeightPeriodMs
int32
fetchHeightPeriodMs
int32
eventLogIndex
ebTypes
.
EventLogIndex
eventLogIndex
ebTypes
.
EventLogIndex
status
int32
backend
bind
.
ContractBackend
backend
bind
.
ContractBackend
bridgeBankAddr
common
.
Address
bridgeBankAddr
common
.
Address
bridgeBankSub
ethereum
.
Subscription
bridgeBankSub
ethereum
.
Subscription
...
@@ -88,7 +87,6 @@ func StartEthereumRelayer(rpcURL2Chain33 string, db dbm.DB, provider, registryAd
...
@@ -88,7 +87,6 @@ func StartEthereumRelayer(rpcURL2Chain33 string, db dbm.DB, provider, registryAd
db
:
db
,
db
:
db
,
unlockchan
:
make
(
chan
int
,
2
),
unlockchan
:
make
(
chan
int
,
2
),
rpcURL2Chain33
:
rpcURL2Chain33
,
rpcURL2Chain33
:
rpcURL2Chain33
,
status
:
ebTypes
.
StatusPending
,
bridgeRegistryAddr
:
common
.
HexToAddress
(
registryAddress
),
bridgeRegistryAddr
:
common
.
HexToAddress
(
registryAddress
),
deployInfo
:
deploy
,
deployInfo
:
deploy
,
maturityDegree
:
degree
,
maturityDegree
:
degree
,
...
@@ -121,25 +119,6 @@ func (ethRelayer *Relayer4Ethereum) SetPrivateKey4Ethereum(privateKey4Ethereum *
...
@@ -121,25 +119,6 @@ func (ethRelayer *Relayer4Ethereum) SetPrivateKey4Ethereum(privateKey4Ethereum *
}
}
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
GetRunningStatus
()
(
relayerRunStatus
*
ebTypes
.
RelayerRunStatus
)
{
relayerRunStatus
=
&
ebTypes
.
RelayerRunStatus
{}
ethRelayer
.
rwLock
.
RLock
()
relayerRunStatus
.
Status
=
ethRelayer
.
status
ethRelayer
.
rwLock
.
RUnlock
()
if
relayerRunStatus
.
Status
==
ebTypes
.
StatusPending
{
if
nil
==
ethRelayer
.
privateKey4Ethereum
{
relayerRunStatus
.
Details
=
"Ethereum's private key not imported"
}
if
nil
==
ethRelayer
.
privateKey4Chain33
{
relayerRunStatus
.
Details
+=
"
\n
Chain33's private key not imported"
}
return
}
relayerRunStatus
.
Details
=
"Running"
return
}
func
(
ethRelayer
*
Relayer4Ethereum
)
recoverDeployPara
()
(
err
error
)
{
func
(
ethRelayer
*
Relayer4Ethereum
)
recoverDeployPara
()
(
err
error
)
{
if
nil
==
ethRelayer
.
deployInfo
{
if
nil
==
ethRelayer
.
deployInfo
{
return
nil
return
nil
...
...
plugin/dapp/x2Ethereum/ebrelayer/relayer/manager.go
View file @
31cf8b00
...
@@ -122,8 +122,8 @@ func (manager *Manager) ChangePassphase(setPasswdReq relayerTypes.ReqChangePassw
...
@@ -122,8 +122,8 @@ func (manager *Manager) ChangePassphase(setPasswdReq relayerTypes.ReqChangePassw
atomic
.
CompareAndSwapInt32
(
&
manager
.
isLocked
,
Unlocked
,
tempislock
)
atomic
.
CompareAndSwapInt32
(
&
manager
.
isLocked
,
Unlocked
,
tempislock
)
}()
}()
// 钱包已经加密需要验证oldpass的正确性
??? 什么时候会进入到这个里
// 钱包已经加密需要验证oldpass的正确性
if
len
(
manager
.
passphase
)
==
0
&&
manager
.
encryptFlag
==
1
{
if
len
(
manager
.
passphase
)
==
0
&&
manager
.
encryptFlag
==
EncryptEnable
{
isok
:=
manager
.
store
.
VerifyPasswordHash
(
setPasswdReq
.
OldPassphase
)
isok
:=
manager
.
store
.
VerifyPasswordHash
(
setPasswdReq
.
OldPassphase
)
if
!
isok
{
if
!
isok
{
mlog
.
Error
(
"ChangePassphase Verify Oldpasswd fail!"
)
mlog
.
Error
(
"ChangePassphase Verify Oldpasswd fail!"
)
...
@@ -680,20 +680,6 @@ func (manager *Manager) checkPermission() error {
...
@@ -680,20 +680,6 @@ func (manager *Manager) checkPermission() error {
return
nil
return
nil
}
}
func
(
manager
*
Manager
)
ShowEthRelayerStatus
(
param
interface
{},
result
*
interface
{})
error
{
manager
.
mtx
.
Lock
()
defer
manager
.
mtx
.
Unlock
()
*
result
=
manager
.
ethRelayer
.
GetRunningStatus
()
return
nil
}
func
(
manager
*
Manager
)
ShowChain33RelayerStatus
(
param
interface
{},
result
*
interface
{})
error
{
manager
.
mtx
.
Lock
()
defer
manager
.
mtx
.
Unlock
()
*
result
=
manager
.
chain33Relayer
.
GetRunningStatus
()
return
nil
}
func
(
manager
*
Manager
)
ShowEthRelayer2EthTxs
(
param
interface
{},
result
*
interface
{})
error
{
func
(
manager
*
Manager
)
ShowEthRelayer2EthTxs
(
param
interface
{},
result
*
interface
{})
error
{
*
result
=
manager
.
ethRelayer
.
QueryTxhashRelay2Eth
()
*
result
=
manager
.
ethRelayer
.
QueryTxhashRelay2Eth
()
return
nil
return
nil
...
...
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