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
46fc51a7
Commit
46fc51a7
authored
Jan 02, 2020
by
linj
Committed by
vipwzw
Jan 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update game test jrpc/grpc port
parent
c0399631
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
game_test.go
plugin/dapp/guess/commands/game_test.go
+20
-17
No files found.
plugin/dapp/guess/commands/game_test.go
View file @
46fc51a7
...
...
@@ -41,6 +41,9 @@ import (
var
(
secp
crypto
.
Crypto
jrpcUrl
=
"127.0.0.1:8803"
grpcUrl
=
"127.0.0.1:8804"
config
=
`# Title为local,表示此配置文件为本地单节点的配置。此时本地节点所在的链上只有这一个节点,共识模块一般采用solo模式。
Title="local"
TestNet=true
...
...
@@ -119,9 +122,9 @@ verMix=200
verMax=200
[rpc]
# jrpc绑定地址
jrpcBindAddr="localhost:880
1
"
jrpcBindAddr="localhost:880
3
"
# grpc绑定地址
grpcBindAddr="localhost:880
2
"
grpcBindAddr="localhost:880
4
"
# 白名单列表,允许访问的IP地址,默认是“*”,允许所有IP访问
whitelist=["127.0.0.1"]
# jrpc方法请求白名单,默认是“*”,允许访问所有RPC方法
...
...
@@ -476,7 +479,7 @@ func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mo
func
createConn
()
error
{
var
err
error
url
:=
"127.0.0.1:8802"
url
:=
grpcUrl
fmt
.
Println
(
"grpc url:"
,
url
)
conn
,
err
=
grpc
.
Dial
(
url
,
grpc
.
WithInsecure
())
if
err
!=
nil
{
...
...
@@ -632,47 +635,47 @@ func testCmd(cmd *cobra.Command) {
rootCmd
.
PersistentFlags
()
.
String
(
"title"
,
chain33Cfg
.
GetTitle
(),
"get title name"
)
rootCmd
.
PersistentFlags
()
.
String
(
"rpc_laddr"
,
"http://
127.0.0.1:8802"
,
"http url"
)
rootCmd
.
PersistentFlags
()
.
String
(
"rpc_laddr"
,
"http://
"
+
grpcUrl
,
"http url"
)
rootCmd
.
AddCommand
(
cmd
)
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"start"
,
"--topic"
,
"WorldCup Final"
,
"--options"
,
"A:France;B:Claodia"
,
"--category"
,
"football"
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"start"
,
"--topic"
,
"WorldCup Final"
,
"--options"
,
"A:France;B:Claodia"
,
"--category"
,
"football"
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
strGameID
:=
"0x20d78aabfa67701f7492261312575614f684b084efa2c13224f1505706c846e8"
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"bet"
,
"--gameId"
,
strGameID
,
"--option"
,
"A"
,
"--betsNumber"
,
"500000000"
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"bet"
,
"--gameId"
,
strGameID
,
"--option"
,
"A"
,
"--betsNumber"
,
"500000000"
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"stop"
,
"--gameId"
,
strGameID
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"stop"
,
"--gameId"
,
strGameID
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"abort"
,
"--gameId"
,
strGameID
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"abort"
,
"--gameId"
,
strGameID
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"publish"
,
"--gameId"
,
strGameID
,
"--result"
,
"A"
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"publish"
,
"--gameId"
,
strGameID
,
"--result"
,
"A"
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"ids"
,
"--gameIDs"
,
strGameID
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"ids"
,
"--gameIDs"
,
strGameID
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"id"
,
"--gameId"
,
strGameID
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"id"
,
"--gameId"
,
strGameID
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"addr"
,
"--addr"
,
userAAddr
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"addr"
,
"--addr"
,
userAAddr
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"status"
,
"--status"
,
"10"
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"status"
,
"--status"
,
"10"
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"adminAddr"
,
"--adminAddr"
,
adminAddr
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"adminAddr"
,
"--adminAddr"
,
adminAddr
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"addrStatus"
,
"--addr"
,
userAAddr
,
"--status"
,
"11"
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"addrStatus"
,
"--addr"
,
userAAddr
,
"--status"
,
"11"
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"adminStatus"
,
"--adminAddr"
,
adminAddr
,
"--status"
,
"11"
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"adminStatus"
,
"--adminAddr"
,
adminAddr
,
"--status"
,
"11"
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"categoryStatus"
,
"--category"
,
"football"
,
"--status"
,
"11"
,
"--rpc_laddr"
,
"http://
127.0.0.1:8801"
})
rootCmd
.
SetArgs
([]
string
{
"guess"
,
"query"
,
"--type"
,
"categoryStatus"
,
"--category"
,
"football"
,
"--status"
,
"11"
,
"--rpc_laddr"
,
"http://
"
+
jrpcUrl
})
rootCmd
.
Execute
()
}
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