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
2c9b73ba
Commit
2c9b73ba
authored
May 13, 2019
by
mdj33
Committed by
vipwzw
May 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
relay rpc test
parent
4408b170
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
19 deletions
+28
-19
docker-compose.sh
build/docker-compose.sh
+3
-0
build.sh
plugin/dapp/paracross/cmd/build.sh
+2
-1
build.sh
plugin/dapp/relay/cmd/build.sh
+14
-11
test-rpc.sh
plugin/dapp/relay/cmd/test/test-rpc.sh
+0
-0
relay.go
plugin/dapp/relay/commands/relay.go
+1
-7
relay.go
plugin/dapp/relay/executor/relay.go
+8
-0
No files found.
build/docker-compose.sh
View file @
2c9b73ba
...
...
@@ -322,6 +322,9 @@ function transfer() {
echo
"withdraw cannot find tx"
exit
1
fi
hash
=
$(${
1
}
send coins transfer
-a
100
-n
transfer
-t
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
-k
4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01
)
block_wait
"
${
1
}
"
1
}
function
base_config
()
{
...
...
plugin/dapp/paracross/cmd/build.sh
View file @
2c9b73ba
...
...
@@ -5,7 +5,7 @@ strcmd=${strpwd##*dapp/}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
PARACLI
=
"
${
OUT_DIR
}
/chain33-para-cli"
PARANAME
=
para
...
...
@@ -15,5 +15,6 @@ go build -v -o "${PARACLI}" -ldflags "-X ${SRC_CLI}/buildflags.ParaName=user.p.$
# shellcheck disable=SC2086
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./test/
*
"
${
OUT_TESTDIR
}
"
plugin/dapp/relay/cmd/build.sh
View file @
2c9b73ba
#!/usr/bin/env bash
#
strpwd=$(pwd)
#
strcmd=${strpwd##*dapp/}
#
strapp=${strcmd%/cmd*}
#
#
OUT_DIR="${1}/$strapp"
#
SRC_RELAYD=github.com/33cn/plugin/plugin/dapp/relay/cmd/relayd
#
FLAG=$2
strpwd
=
$(
pwd
)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
SRC_RELAYD
=
github.com/33cn/plugin/plugin/dapp/relay/cmd/relayd
FLAG
=
$2
# shellcheck disable=SC2086,1072
#go build -i ${FLAG} -v -o "${OUT_DIR}/relayd" "${SRC_RELAYD}"
#cp ./relayd/relayd.toml "${OUT_DIR}/relayd.toml"
#cp ./build/* "${OUT_DIR}"
echo
"ignore"
go build
-i
${
FLAG
}
-v
-o
"
${
OUT_DIR
}
/relayd"
"
${
SRC_RELAYD
}
"
cp
./relayd/relayd.toml
"
${
OUT_DIR
}
/relayd.toml"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./test/
*
"
${
OUT_TESTDIR
}
"
plugin/dapp/relay/cmd/test/test-rpc.sh
0 → 100755
View file @
2c9b73ba
This diff is collapsed.
Click to expand it.
plugin/dapp/relay/commands/relay.go
View file @
2c9b73ba
...
...
@@ -370,7 +370,6 @@ func addExchangeFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
Float64P
(
"bty_amount"
,
"b"
,
0
,
"exchange amount of BTY"
)
cmd
.
MarkFlagRequired
(
"bty_amount"
)
cmd
.
Flags
()
.
Float64P
(
"fee"
,
"f"
,
0
,
"coin transaction fee"
)
}
func
relayOrder
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
...
...
@@ -423,7 +422,6 @@ func addRelayAcceptFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
Uint32P
(
"coin_wait"
,
"n"
,
6
,
"coin blocks to wait,default:6,min:1"
)
cmd
.
Flags
()
.
Float64P
(
"fee"
,
"f"
,
0
,
"coin transaction fee"
)
}
func
relayAccept
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
...
...
@@ -467,7 +465,6 @@ func addRevokeFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
Uint32P
(
"action"
,
"a"
,
0
,
"0:unlock, 1:cancel(only for creator)"
)
cmd
.
MarkFlagRequired
(
"action"
)
cmd
.
Flags
()
.
Float64P
(
"fee"
,
"f"
,
0
,
"coin transaction fee"
)
}
func
relayRevoke
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
...
...
@@ -504,7 +501,6 @@ func addConfirmFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
StringP
(
"tx_hash"
,
"t"
,
""
,
"coin tx hash"
)
cmd
.
MarkFlagRequired
(
"tx_hash"
)
cmd
.
Flags
()
.
Float64P
(
"fee"
,
"f"
,
0
,
"coin transaction fee"
)
}
func
relayConfirm
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
...
...
@@ -545,9 +541,8 @@ func addSaveBtcHeadFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
Uint64P
(
"height"
,
"t"
,
0
,
"block height"
)
cmd
.
MarkFlagRequired
(
"height"
)
cmd
.
Flags
()
.
Int32P
(
"flag"
,
"g"
,
0
,
"
block
height"
)
cmd
.
Flags
()
.
Int32P
(
"flag"
,
"g"
,
0
,
"
reset height and save from current
height"
)
cmd
.
Flags
()
.
Float64P
(
"fee"
,
"f"
,
0
,
"coin transaction fee"
)
}
func
relaySaveBtcHead
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
...
...
@@ -598,7 +593,6 @@ func addVerifyBTCFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
StringP
(
"block_hash"
,
"b"
,
""
,
"block hash of tx "
)
cmd
.
MarkFlagRequired
(
"block_hash"
)
cmd
.
Flags
()
.
Float64P
(
"fee"
,
"f"
,
0
,
"coin transaction fee"
)
}
func
relayVerifyBTC
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
...
...
plugin/dapp/relay/executor/relay.go
View file @
2c9b73ba
...
...
@@ -248,3 +248,11 @@ func deleteCreateOrderKeyValue(kv []*types.KeyValue, order *ty.RelayOrder, statu
func
(
r
*
relay
)
CheckReceiptExecOk
()
bool
{
return
true
}
// ExecutorOrder 设置localdb的EnableRead
func
(
g
*
relay
)
ExecutorOrder
()
int64
{
if
types
.
IsFork
(
g
.
GetHeight
(),
"ForkLocalDBAccess"
)
{
return
drivers
.
ExecLocalSameTime
}
return
g
.
DriverBase
.
ExecutorOrder
()
}
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