Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
power-node
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
power-node
Commits
2e26cca3
Commit
2e26cca3
authored
Apr 17, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update time convert byte
parent
44c177e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
msg_resp.go
nm/msg_resp.go
+3
-4
No files found.
nm/msg_resp.go
View file @
2e26cca3
...
...
@@ -2,7 +2,6 @@ package nm
import
(
"bytes"
"encoding/binary"
"example.com/m/conf"
"example.com/m/log"
"example.com/m/models"
...
...
@@ -12,6 +11,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
nodemanagerV1
"github.com/odysseus/odysseus-protocol/gen/proto/go/nodemanager/v1"
"github.com/shirou/gopsutil/cpu"
"math/big"
"strconv"
"time"
)
...
...
@@ -131,12 +131,11 @@ func SubmitResourceMapRes(params ...interface{}) *nodemanagerV1.WorkerMessage {
func
RegisterInfoResp
(
params
...
interface
{})
*
nodemanagerV1
.
WorkerMessage
{
log
.
Info
(
"Register info response received params:"
,
params
)
nowTimeStamp
:=
time
.
Now
()
.
Unix
()
byteSlice
:=
make
([]
byte
,
8
)
binary
.
BigEndian
.
PutUint64
(
byteSlice
,
uint64
(
nowTimeStamp
))
nowTimeBytes
:=
big
.
NewInt
(
nowTimeStamp
)
.
Bytes
()
signHash
:=
crypto
.
Keccak256Hash
(
bytes
.
NewBufferString
(
conf
.
GetConfig
()
.
GetExternalIp
())
.
Bytes
(),
bytes
.
NewBufferString
(
conf
.
GetConfig
()
.
SignPub
)
.
Bytes
(),
bytes
.
NewBufferString
(
conf
.
GetConfig
()
.
BenefitAddress
)
.
Bytes
(),
byteSlice
)
nowTimeBytes
)
log
.
WithField
(
"hash"
,
signHash
.
String
())
.
Info
(
"register message sign result"
)
sign
,
_
:=
crypto
.
Sign
(
signHash
.
Bytes
(),
conf
.
GetConfig
()
.
SignPrivateKey
)
log
.
Info
(
"register message sign:"
,
common
.
Bytes2Hex
(
sign
))
...
...
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