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
46fe699c
Commit
46fe699c
authored
Mar 08, 2022
by
李伟@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug consensus tx
parent
0740a8c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
client_eth.go
client_eth.go
+14
-0
transactor.go
transactor.go
+1
-1
No files found.
client_eth.go
View file @
46fe699c
...
@@ -6,11 +6,14 @@ import (
...
@@ -6,11 +6,14 @@ import (
"math/big"
"math/big"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"code.wuban.net.cn/multisend/internal/logging"
)
)
var
toAddress
common
.
Address
=
common
.
HexToAddress
(
"0x0071B39fd266F8aeF392fb50F078A233b2218a0b"
)
var
toAddress
common
.
Address
=
common
.
HexToAddress
(
"0x0071B39fd266F8aeF392fb50F078A233b2218a0b"
)
...
@@ -31,6 +34,7 @@ type EthClient struct {
...
@@ -31,6 +34,7 @@ type EthClient struct {
GasPrice
*
big
.
Int
GasPrice
*
big
.
Int
ChainId
*
big
.
Int
ChainId
*
big
.
Int
GasLimit
uint64
GasLimit
uint64
logger
logging
.
Logger
}
}
var
_
ClientFactory
=
(
*
EthClientFactory
)(
nil
)
var
_
ClientFactory
=
(
*
EthClientFactory
)(
nil
)
...
@@ -61,6 +65,7 @@ func (f *EthClientFactory) NewClient(cfg Config) (Client, error) {
...
@@ -61,6 +65,7 @@ func (f *EthClientFactory) NewClient(cfg Config) (Client, error) {
PrivateKey
:
sendTxPrivatekeyAsECDSA
,
PrivateKey
:
sendTxPrivatekeyAsECDSA
,
FromAddr
:
sendTxFromAddress
,
FromAddr
:
sendTxFromAddress
,
NodeUrl
:
"http://13.40.31.153:8545"
,
NodeUrl
:
"http://13.40.31.153:8545"
,
logger
:
logging
.
NewLogrusLogger
(
"EthClient"
),
}
}
cli
,
err
:=
ethclient
.
Dial
(
buildTxParam
.
NodeUrl
)
cli
,
err
:=
ethclient
.
Dial
(
buildTxParam
.
NodeUrl
)
...
@@ -117,6 +122,15 @@ func (c *EthClient) GenerateTx() (*types.Transaction, error) {
...
@@ -117,6 +122,15 @@ func (c *EthClient) GenerateTx() (*types.Transaction, error) {
return
nil
,
err
return
nil
,
err
}
}
data
,
err
:=
tx
.
MarshalBinary
()
if
err
!=
nil
{
return
nil
,
err
}
args
:=
hexutil
.
Encode
(
data
)
c
.
logger
.
Info
(
"build tx"
,
"nonce"
,
c
.
Nonce
,
"TxAsHex"
,
args
)
c
.
Nonce
+=
1
c
.
Nonce
+=
1
return
tx
,
nil
return
tx
,
nil
...
...
transactor.go
View file @
46fe699c
...
@@ -285,7 +285,7 @@ func (t *Transactor) sendTransactions() error {
...
@@ -285,7 +285,7 @@ func (t *Transactor) sendTransactions() error {
args
:=
hexutil
.
Encode
(
data
)
args
:=
hexutil
.
Encode
(
data
)
method
:=
"eth_sendRawTransaction"
method
:=
"eth_sendRawTransaction"
t
.
logger
.
Info
(
"send tx"
,
"idx"
,
sent
,
"TxAsHex"
,
args
)
t
.
logger
.
Info
(
"send tx"
,
"idx"
,
sent
)
msg
,
err
:=
t
.
newMessage
(
method
,
args
)
msg
,
err
:=
t
.
newMessage
(
method
,
args
)
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