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
3d7a1005
Commit
3d7a1005
authored
Sep 17, 2019
by
mdj33
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add common addr func for main and para chain
parent
4f10b8d6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
45 deletions
+39
-45
dapp-test-common.sh
build/dapp-test-common.sh
+12
-29
docker-compose.sh
build/docker-compose.sh
+9
-1
testcase.sh
plugin/dapp/paracross/cmd/build/testcase.sh
+18
-15
test-rpc.sh
plugin/dapp/relay/cmd/test/test-rpc.sh
+0
-0
No files found.
build/dapp-test-common.sh
View file @
3d7a1005
...
@@ -166,44 +166,27 @@ chain33_LastBlockhash() {
...
@@ -166,44 +166,27 @@ chain33_LastBlockhash() {
echo
-e
"######
\\
n last blockhash is
$LAST_BLOCK_HASH
\\
n######"
echo
-e
"######
\\
n last blockhash is
$LAST_BLOCK_HASH
\\
n######"
}
}
ip
=
$(
echo
"
$ip
"
|
cut
-d
':'
-f
1
)
chain33_applyCoins
()
{
chain33_getMainChainCoins
()
{
echo
"chain33_getMainChainCoins"
echo
"chain33_getMainChainCoins"
if
[
"$#"
-lt
3
]
;
then
if
[
"$#"
-lt
3
]
;
then
echo
"chain33_getMainCoins wrong params"
echo
"chain33_getMainCoins wrong params"
exit
1
exit
1
fi
fi
local
MAIN_HTTP
=
$1
local
targetAddr
=
$1
local
targetAddr
=
$2
local
count
=
$2
local
count
=
$3
local
ip
=
$3
if
[
$count
-gt
10
000000000
]
;
then
if
[
"
$count
"
-gt
15
000000000
]
;
then
echo
"chain33_getMainCoins wrong coins count,should less than 1
0
0 00000000"
echo
"chain33_getMainCoins wrong coins count,should less than 1
5
0 00000000"
exit
1
exit
1
fi
fi
local
poolAddr
=
"0x9d315182e56fde7fadb94408d360203894e5134216944e858f9b31f70e9ecf40"
local
poolAddr
=
"1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx"
M_HTTP
=
${
MAIN_HTTP
//8901/8801
}
chain33_SendToAddress
"
${
poolAddr
}
"
"
${
targetAddr
}
"
"
$count
"
"
${
ip
}
"
chain33_SendToAddress
"
${
poolAddr
}
"
"
${
targetAddr
}
"
$count
"
${
M_HTTP
}
"
}
}
chain33_getParaChainCoins
()
{
chain33_debug_function
()
{
echo
"chain33_getParaChainCoins"
set
-x
if
[
"$#"
-lt
3
]
;
then
eval
"
$@
"
echo
"chain33_getParaChainCoins wrong params"
set
+x
exit
1
fi
local
MAIN_HTTP
=
$1
local
targetAddr
=
$2
local
count
=
$3
if
[
$count
-gt
100000000000
]
;
then
echo
"chain33_getMainCoins wrong coins count,should less than 1000 00000000"
exit
1
fi
local
poolAddr
=
"0x9d315182e56fde7fadb94408d360203894e5134216944e858f9b31f70e9ecf40"
P_HTTP
=
${
MAIN_HTTP
//8801/8901
}
chain33_SendToAddress
"
${
poolAddr
}
"
"
${
targetAddr
}
"
$count
"
${
P_HTTP
}
"
}
}
build/docker-compose.sh
View file @
3d7a1005
...
@@ -103,6 +103,9 @@ function base_init() {
...
@@ -103,6 +103,9 @@ function base_init() {
# ticket
# ticket
sed
-i
$sedfix
's/^ticketPrice =.*/ticketPrice = 10000/g'
chain33.toml
sed
-i
$sedfix
's/^ticketPrice =.*/ticketPrice = 10000/g'
chain33.toml
#relay genesis
sed
-i
$sedfix
's/^genesis="12qyocayNF7.*/genesis="1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3"/g'
chain33.toml
}
}
function
start
()
{
function
start
()
{
...
@@ -377,6 +380,11 @@ function dapp_test_address() {
...
@@ -377,6 +380,11 @@ function dapp_test_address() {
if
[
-z
"
${
result
}
"
]
;
then
if
[
-z
"
${
result
}
"
]
;
then
exit
1
exit
1
fi
fi
result
=
$(${
1
}
account import_key
-k
9d315182e56fde7fadb94408d360203894e5134216944e858f9b31f70e9ecf40
-l
rpctestpooladdr | jq
".label"
)
echo
"
${
result
}
"
if
[
-z
"
${
result
}
"
]
;
then
exit
1
fi
sleep
1
sleep
1
...
@@ -384,7 +392,7 @@ function dapp_test_address() {
...
@@ -384,7 +392,7 @@ function dapp_test_address() {
echo
"
${
hash
}
"
echo
"
${
hash
}
"
#total allocation for rpc test
#total allocation for rpc test
hash
=
$(${
1
}
send coins transfer
-a
5
000
-n
transfer
-t
1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx
-k
2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989
)
hash
=
$(${
1
}
send coins transfer
-a
8
000
-n
transfer
-t
1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx
-k
2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989
)
echo
"
${
hash
}
"
echo
"
${
hash
}
"
block_wait
"
${
1
}
"
1
block_wait
"
${
1
}
"
1
...
...
plugin/dapp/paracross/cmd/build/testcase.sh
View file @
3d7a1005
...
@@ -50,7 +50,7 @@ function para_set_toml() {
...
@@ -50,7 +50,7 @@ function para_set_toml() {
sed
-i
$xsedfix
's/^whitelist=.*/whitelist=["localhost","127.0.0.1","0.0.0.0"]/g'
"
${
1
}
"
sed
-i
$xsedfix
's/^whitelist=.*/whitelist=["localhost","127.0.0.1","0.0.0.0"]/g'
"
${
1
}
"
sed
-i
$xsedfix
's/^ParaRemoteGrpcClient=.*/ParaRemoteGrpcClient="nginx:8803"/g'
"
${
1
}
"
sed
-i
$xsedfix
's/^ParaRemoteGrpcClient=.*/ParaRemoteGrpcClient="nginx:8803"/g'
"
${
1
}
"
sed
-i
$xsedfix
's/^genesis="1JmFaA6unrCFYEWP.*/genesis="1
2qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
"/g'
"
${
1
}
"
sed
-i
$xsedfix
's/^genesis="1JmFaA6unrCFYEWP.*/genesis="1
G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3
"/g'
"
${
1
}
"
# shellcheck disable=SC1004
# shellcheck disable=SC1004
sed
-i
$xsedfix
's/^superManager=.*/superManager=["1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S",\
sed
-i
$xsedfix
's/^superManager=.*/superManager=["1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S",\
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",\
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",\
...
@@ -67,10 +67,10 @@ function para_set_toml() {
...
@@ -67,10 +67,10 @@ function para_set_toml() {
function
para_set_wallet
()
{
function
para_set_wallet
()
{
echo
"=========== # para set wallet ============="
echo
"=========== # para set wallet ============="
para_import_
key
"
${
PARA_CLI
}
"
"0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b"
"paraAuthAccount"
para_import_
wallet
"
${
PARA_CLI
}
"
"0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b"
"paraAuthAccount"
para_import_
key
"
${
PARA_CLI2
}
"
"0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4"
"paraAuthAccount"
para_import_
wallet
"
${
PARA_CLI2
}
"
"0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4"
"paraAuthAccount"
para_import_
key
"
${
PARA_CLI1
}
"
"0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115"
"paraAuthAccount"
para_import_
wallet
"
${
PARA_CLI1
}
"
"0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115"
"paraAuthAccount"
para_import_
key
"
${
PARA_CLI4
}
"
"0xcacb1f5d51700aea07fca2246ab43b0917d70405c65edea9b5063d72eb5c6b71"
"paraAuthAccount"
para_import_
wallet
"
${
PARA_CLI4
}
"
"0xcacb1f5d51700aea07fca2246ab43b0917d70405c65edea9b5063d72eb5c6b71"
"paraAuthAccount"
#14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
#14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
para_import_key
"
${
PARA_CLI
}
"
"0xCC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
"genesis"
para_import_key
"
${
PARA_CLI
}
"
"0xCC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
"genesis"
...
@@ -82,6 +82,8 @@ function para_set_wallet() {
...
@@ -82,6 +82,8 @@ function para_set_wallet() {
para_import_key
"
${
PARA_CLI
}
"
"0x56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138"
"dapptest1"
para_import_key
"
${
PARA_CLI
}
"
"0x56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138"
"dapptest1"
#1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX
#1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX
para_import_key
"
${
PARA_CLI
}
"
"0x2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989"
"dapptest2"
para_import_key
"
${
PARA_CLI
}
"
"0x2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989"
"dapptest2"
#1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx
para_import_key
"
${
PARA_CLI
}
"
"9d315182e56fde7fadb94408d360203894e5134216944e858f9b31f70e9ecf40"
"rpctestpooladdr"
#super node behalf test
#super node behalf test
#1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
#1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
...
@@ -92,7 +94,7 @@ function para_set_wallet() {
...
@@ -92,7 +94,7 @@ function para_set_wallet() {
para_import_key
"
${
PARA_CLI
}
"
"0x794443611e7369a57b078881445b93b754cbc9b9b8f526535ab9c6d21d29203d"
"othernode2"
para_import_key
"
${
PARA_CLI
}
"
"0x794443611e7369a57b078881445b93b754cbc9b9b8f526535ab9c6d21d29203d"
"othernode2"
}
}
function
para_import_
key
()
{
function
para_import_
wallet
()
{
local
lable
=
$3
local
lable
=
$3
echo
"=========== # save seed to wallet ============="
echo
"=========== # save seed to wallet ============="
result
=
$(${
1
}
seed save
-p
1314fuzamei
-s
"tortoise main civil member grace happy century convince father cage beach hip maid merry rib"
| jq
".isok"
)
result
=
$(${
1
}
seed save
-p
1314fuzamei
-s
"tortoise main civil member grace happy century convince father cage beach hip maid merry rib"
| jq
".isok"
)
...
@@ -123,6 +125,16 @@ function para_import_key() {
...
@@ -123,6 +125,16 @@ function para_import_key() {
${
1
}
wallet status
${
1
}
wallet status
}
}
function
para_import_key
()
{
local
lable
=
$3
echo
"=========== # import private key ============="
echo
"key:
${
2
}
"
result
=
$(${
1
}
account import_key
-k
"
${
2
}
"
-l
"
$lable
"
| jq
".label"
)
if
[
-z
"
${
result
}
"
]
;
then
exit
1
fi
}
function
para_transfer
()
{
function
para_transfer
()
{
echo
"=========== # para chain transfer ============="
echo
"=========== # para chain transfer ============="
main_transfer2account
"1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
main_transfer2account
"1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
...
@@ -150,9 +162,6 @@ function para_transfer() {
...
@@ -150,9 +162,6 @@ function para_transfer() {
#1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
#1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
main_transfer2paracross
"0xd165c84ed37c2a427fea487470ee671b7a0495d68d82607cafbc6348bf23bec5"
100
main_transfer2paracross
"0xd165c84ed37c2a427fea487470ee671b7a0495d68d82607cafbc6348bf23bec5"
100
#relay rpc test
para_transfer2exec
"0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588"
"relay"
para_transfer2exec
"0x4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01"
"relay"
block_wait
"
${
CLI
}
"
2
block_wait
"
${
CLI
}
"
2
# para_create_manage_nodegroup
# para_create_manage_nodegroup
...
@@ -195,12 +204,6 @@ function main_transfer2paracross() {
...
@@ -195,12 +204,6 @@ function main_transfer2paracross() {
echo
"
${
hash1
}
"
echo
"
${
hash1
}
"
}
}
function
para_transfer2exec
()
{
echo
"exec=
$2
,addr=
${
1
}
"
hash1
=
$(${
PARA_CLI
}
send coins send_exec
-a
500
-e
"
$2
"
-k
"
${
1
}
"
)
echo
"
${
hash1
}
"
}
function
para_create_manage_nodegroup
()
{
function
para_create_manage_nodegroup
()
{
echo
"=========== # para chain send config ============="
echo
"=========== # para chain send config ============="
para_configkey
"
${
CLI
}
"
"paracross-nodes-user.p.
${
PARANAME
}
."
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
para_configkey
"
${
CLI
}
"
"paracross-nodes-user.p.
${
PARANAME
}
."
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
...
...
plugin/dapp/relay/cmd/test/test-rpc.sh
View file @
3d7a1005
This diff is collapsed.
Click to expand it.
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