Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
multisend
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
李伟@五瓣科技
multisend
Commits
8fcd8558
Commit
8fcd8558
authored
Mar 01, 2022
by
Ubuntu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test ok
parent
76c4f4de
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
originalTx.go
originalTx.go
+1
-1
redis.go
redis.go
+3
-3
transactor.go
transactor.go
+1
-1
transactor_test.go
transactor_test.go
+12
-12
No files found.
originalTx.go
View file @
8fcd8558
...
...
@@ -20,7 +20,7 @@ var originalTxsHashQueue chan *[]byte = make(chan *[]byte, 1000)
var
batchTxsForRedis
chan
*
OriginalBatchTxs
=
make
(
chan
*
OriginalBatchTxs
,
batchTxHashSize
*
batchTxHashQueueSize
)
const
batchTxSize
=
10000
const
batchTxHashSize
=
10
0
const
batchTxHashSize
=
3
0
const
batchTxHashQueueSize
=
10
type
OriginalBatchTxs
struct
{
...
...
redis.go
View file @
8fcd8558
...
...
@@ -3,7 +3,7 @@ package multisend
import
(
"context"
"encoding/json"
"fmt"
//
"fmt"
"runtime"
"time"
...
...
@@ -49,7 +49,7 @@ func Start() {
limiter
.
Wait
(
cxt
)
select
{
case
batchTxs
:=
<-
batchTxsForRedis
:
startTime
:=
time
.
Now
()
//
startTime := time.Now()
// data, err := proto.Marshal(txs)
// if err != nil {
// panic(err)
...
...
@@ -66,7 +66,7 @@ func Start() {
}
count
+=
1
fmt
.
Printf
(
"count %d txs size: %d takes %v time: %s
\n
"
,
count
,
len
(
batchTxsAsBytes
),
time
.
Since
(
startTime
),
time
.
Now
())
//
fmt.Printf("count %d txs size: %d takes %v time: %s \n", count, len(batchTxsAsBytes), time.Since(startTime), time.Now())
}
}
}
transactor.go
View file @
8fcd8558
...
...
@@ -17,7 +17,7 @@ import (
const
(
connSendTimeout
=
10
*
time
.
Second
connPingPeriod
=
(
30
*
9
/
10
)
*
time
.
Second
connPingPeriod
=
3
*
time
.
Second
defaultProgressCallbackInterval
=
5
*
time
.
Second
)
...
...
transactor_test.go
View file @
8fcd8558
...
...
@@ -9,19 +9,19 @@ func TestTransactor(t *testing.T) {
go
StartProduceTx
()
for
{
if
len
(
originalTxsHashQueue
)
>=
10
{
break
}
t
.
Logf
(
"waiting for produce original tx, len(originalTxsHashQueue):%d
\n
"
,
len
(
originalTxsHashQueue
))
time
.
Sleep
(
1
*
time
.
Second
)
}
//
for {
//
if len(originalTxsHashQueue) >= 10 {
//
break
//
}
//
t.Logf("waiting for produce original tx, len(originalTxsHashQueue):%d \n", len(originalTxsHashQueue))
//
time.Sleep(1 * time.Second)
//
}
cfg
:=
Config
{
Rate
:
5
,
Count
:
30
,
Rate
:
1
,
Count
:
30
00
,
Connections
:
1
,
Time
:
100
,
Time
:
100
0000
,
SendPeriod
:
3
,
ClientFactory
:
"ethclient"
,
}
...
...
@@ -36,6 +36,6 @@ func TestTransactor(t *testing.T) {
//transactor.sendLoop()
transactor
.
Start
()
time
.
Sleep
(
time
.
Second
*
120
)
time
.
Sleep
(
time
.
Hour
*
1
)
}
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