Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
ChainGrpcPro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
duanjinfei
ChainGrpcPro
Commits
9fee0495
Commit
9fee0495
authored
Mar 10, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change continued send tx
parent
1c343e93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
main.go
main.go
+1
-1
startTest.go
startTest.go
+4
-1
signedTx.go
transaction/signedTx.go
+1
-1
No files found.
main.go
View file @
9fee0495
...
@@ -22,7 +22,7 @@ func init() {
...
@@ -22,7 +22,7 @@ func init() {
startCmd
.
PersistentFlags
()
.
StringVar
(
&
cpuProfile
,
"cpuProfile"
,
"cpuProfile.prof"
,
"Statistics cpu profile"
)
startCmd
.
PersistentFlags
()
.
StringVar
(
&
cpuProfile
,
"cpuProfile"
,
"cpuProfile.prof"
,
"Statistics cpu profile"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
startCount
,
"startCount"
,
0
,
"read excel start count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
startCount
,
"startCount"
,
0
,
"read excel start count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
endCount
,
"endCount"
,
100
,
"read excel end count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
endCount
,
"endCount"
,
100
,
"read excel end count"
)
startCmd
.
PersistentFlags
()
.
BoolVar
(
&
broadcastTxArr
,
"broadcastTxArr"
,
tru
e
,
"test grpc interface -> broadcastTxArr"
)
startCmd
.
PersistentFlags
()
.
BoolVar
(
&
broadcastTxArr
,
"broadcastTxArr"
,
fals
e
,
"test grpc interface -> broadcastTxArr"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
txCount
,
"txCount"
,
1000
,
"send tran count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
txCount
,
"txCount"
,
1000
,
"send tran count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
goRoutineCount
,
"goRoutineCount"
,
10
,
"send tran goRoutine count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
goRoutineCount
,
"goRoutineCount"
,
10
,
"send tran goRoutine count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
batchCount
,
"batchCount"
,
100
,
"batch send tran count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
batchCount
,
"batchCount"
,
100
,
"batch send tran count"
)
...
...
startTest.go
View file @
9fee0495
...
@@ -21,7 +21,7 @@ func init() {
...
@@ -21,7 +21,7 @@ func init() {
return
return
}
}
cfg
.
StorageAccFileName
+=
".xlsx"
cfg
.
StorageAccFileName
+=
".xlsx"
tranArrChan
=
make
(
chan
[]
*
types
.
Transaction
,
10000
00000
)
tranArrChan
=
make
(
chan
[]
*
types
.
Transaction
,
10000
)
}
}
func
startTest
()
{
func
startTest
()
{
...
@@ -47,9 +47,12 @@ func startTest() {
...
@@ -47,9 +47,12 @@ func startTest() {
}
}
}()
}()
for
{
for
{
log
.
Info
(
"----------------------------------start"
)
arr
:=
transaction
.
SignedTxArr
(
syncMap
,
SendTxAccountArr
,
cfg
)
arr
:=
transaction
.
SignedTxArr
(
syncMap
,
SendTxAccountArr
,
cfg
)
log
.
Info
(
"----------------------------------end"
)
tranArrChan
<-
arr
tranArrChan
<-
arr
syncMap
=
updateNonce
(
syncMap
,
cfg
)
syncMap
=
updateNonce
(
syncMap
,
cfg
)
}
}
}
}
}
}
...
...
transaction/signedTx.go
View file @
9fee0495
...
@@ -109,7 +109,7 @@ func InitAccNonce(sendTxAccountArr [][]string, cfg *tool.Config) (error, sync.Ma
...
@@ -109,7 +109,7 @@ func InitAccNonce(sendTxAccountArr [][]string, cfg *tool.Config) (error, sync.Ma
nonceReq
:=
&
ring
.
NonceRequest
{
nonceReq
:=
&
ring
.
NonceRequest
{
Address
:
(
*
metatypes
.
Address
)(
fromAddr
.
Bytes
()),
Address
:
(
*
metatypes
.
Address
)(
fromAddr
.
Bytes
()),
}
}
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
time
.
Second
*
1
0
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
time
.
Second
*
2
0
)
defer
cancel
()
defer
cancel
()
response
,
err
:=
serviceClient
.
Nonce
(
ctx
,
nonceReq
)
response
,
err
:=
serviceClient
.
Nonce
(
ctx
,
nonceReq
)
if
err
!=
nil
{
if
err
!=
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