Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sdk-api
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
Odysseus
sdk-api
Commits
cf4183ee
Commit
cf4183ee
authored
Jun 30, 2024
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
cda38955
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
main.go
cmd/main.go
+2
-1
gassender.go
gassender/gassender.go
+2
-2
user.go
server/user.go
+1
-1
No files found.
cmd/main.go
View file @
cf4183ee
...
...
@@ -46,6 +46,7 @@ func runGasSender(cfg *config.Config) *gassender.GasSender {
panic
(
err
)
}
gs
.
Run
()
// gs.AonLogin(common.HexToAddress("aaaa"), "1", "1")
// gs.AonLogin(common.HexToAddress("11111"), "1", "1")
// gs.SendAONGas(common.HexToAddress("11111").Hex(), 1)
return
gs
}
gassender/gassender.go
View file @
cf4183ee
...
...
@@ -142,7 +142,7 @@ func (gs *GasSender) sendGas(task *gasTask) {
txLog
:=
log
.
WithField
(
"txHash"
,
signedTx
.
Hash
()
.
Hex
())
txLog
.
Info
(
"tx broadcasted"
)
for
i
:=
0
;
i
<
5
;
i
++
{
time
.
Sleep
(
time
.
Second
*
2
)
time
.
Sleep
(
time
.
Second
*
1
)
receipt
,
err
:=
gs
.
client
.
TransactionReceipt
(
context
.
Background
(),
signedTx
.
Hash
())
if
err
!=
nil
&&
err
==
ethereum
.
NotFound
{
txLog
.
Info
(
"tx receipt not found, retrying..."
)
...
...
@@ -187,7 +187,7 @@ func (gs *GasSender) login(task *gasTask) {
txLog
:=
log
.
WithField
(
"txHash"
,
signedTx
.
Hash
()
.
Hex
())
txLog
.
Info
(
"tx broadcasted"
)
for
i
:=
0
;
i
<
5
;
i
++
{
time
.
Sleep
(
time
.
Second
*
2
)
time
.
Sleep
(
time
.
Second
*
1
)
receipt
,
err
:=
gs
.
client
.
TransactionReceipt
(
context
.
Background
(),
signedTx
.
Hash
())
if
err
!=
nil
&&
err
==
ethereum
.
NotFound
{
txLog
.
Info
(
"tx receipt not found, retrying..."
)
...
...
server/user.go
View file @
cf4183ee
...
...
@@ -114,7 +114,7 @@ func createUser(c *gin.Context) {
c
.
JSON
(
200
,
withError
(
"keystore already exist"
))
return
}
srv
.
AONSendGas
(
fmt
.
Sprintf
(
"0x%s"
,
address
))
srv
.
AONSendGas
(
addr
.
Hex
(
))
c
.
JSON
(
200
,
withSuccess
(
""
))
}
...
...
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