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
b8e06008
Commit
b8e06008
authored
Mar 10, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change continued send tx
parent
246d11b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
main.go
main.go
+1
-1
startTest.go
startTest.go
+6
-4
No files found.
main.go
View file @
b8e06008
...
...
@@ -22,7 +22,7 @@ func init() {
startCmd
.
PersistentFlags
()
.
StringVar
(
&
cpuProfile
,
"cpuProfile"
,
"cpuProfile.prof"
,
"Statistics cpu profile"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
startCount
,
"startCount"
,
0
,
"read excel start count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
endCount
,
"endCount"
,
100
,
"read excel end count"
)
startCmd
.
PersistentFlags
()
.
BoolVar
(
&
broadcastTxArr
,
"broadcastTxArr"
,
fals
e
,
"test grpc interface -> broadcastTxArr"
)
startCmd
.
PersistentFlags
()
.
BoolVar
(
&
broadcastTxArr
,
"broadcastTxArr"
,
tru
e
,
"test grpc interface -> broadcastTxArr"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
txCount
,
"txCount"
,
1000
,
"send tran count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
goRoutineCount
,
"goRoutineCount"
,
10
,
"send tran goRoutine count"
)
startCmd
.
PersistentFlags
()
.
IntVar
(
&
batchCount
,
"batchCount"
,
100
,
"batch send tran count"
)
...
...
startTest.go
View file @
b8e06008
...
...
@@ -50,22 +50,24 @@ func startTest() {
for
{
arr
:=
transaction
.
SignedTxArr
(
syncMap
,
SendTxAccountArr
,
cfg
)
tranArrChan
<-
arr
updateNonce
(
syncMap
,
cfg
)
syncMap
=
updateNonce
(
syncMap
,
cfg
)
}
}
}
func
updateNonce
(
nonceMap
sync
.
Map
,
cfg
*
tool
.
Config
)
{
func
updateNonce
(
nonceMap
sync
.
Map
,
cfg
*
tool
.
Config
)
sync
.
Map
{
var
newNonceMap
sync
.
Map
nonceMap
.
Range
(
func
(
key
,
value
any
)
bool
{
load
,
ok
:=
nonceMap
.
Load
(
key
)
if
!
ok
{
return
false
}
nonceMap
.
Store
(
key
,
load
.
(
int
)
+
cfg
.
SignCount
)
load
,
ok
=
nonceMap
.
Load
(
key
)
n
ewN
onceMap
.
Store
(
key
,
load
.
(
int
)
+
cfg
.
SignCount
)
load
,
ok
=
n
ewN
onceMap
.
Load
(
key
)
if
!
ok
{
return
false
}
log
.
Info
(
"updated addr nonce:"
,
load
)
return
true
})
return
newNonceMap
}
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