Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
szh
chain33-pai
Commits
94238e0f
Commit
94238e0f
authored
Aug 03, 2021
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
节点更新 区分 arm 和 linux 版本
parent
ea5930ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
process.go
pkg/app/process.go
+7
-1
node.go
routers/api/v1/node.go
+10
-1
No files found.
pkg/app/process.go
View file @
94238e0f
...
...
@@ -8,6 +8,7 @@ import (
"chain33-pai/pkg/setting"
"chain33-pai/pkg/util"
"chain33-pai/service/pai_service"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
...
...
@@ -384,8 +385,13 @@ func Unlock() error {
return
err
}
pass
:=
strings
.
Replace
(
string
(
passwd
),
"
\n
"
,
""
,
-
1
)
passByte
,
err
:=
base64
.
StdEncoding
.
DecodeString
(
pass
)
if
err
!=
nil
{
tlog
.
Info
(
"decode err"
,
"err"
,
err
)
return
err
}
reply
,
err
:=
setting
.
PaiClient
.
Unlock
(
&
types
.
WalletUnLock
{
Passwd
:
pass
,
Passwd
:
string
(
passByte
)[
9
:
]
,
Timeout
:
0
,
WalletOrTicket
:
false
,
XXX_NoUnkeyedLiteral
:
struct
{}{},
...
...
routers/api/v1/node.go
View file @
94238e0f
...
...
@@ -5,9 +5,11 @@ import (
"chain33-pai/pkg/app"
"chain33-pai/pkg/chain33"
"chain33-pai/pkg/e"
pai2
"chain33-pai/pkg/pai"
"chain33-pai/pkg/setting"
"chain33-pai/pkg/util"
"chain33-pai/service/pai_service"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/33cn/chain33/types"
...
...
@@ -88,8 +90,14 @@ func UpdateNodeNew(c *gin.Context) {
stderr
:=
bytes
.
NewBuffer
(
nil
)
name
:=
setting
.
BityuanSetting
.
Name
+
"_"
+
latestVersion
+
".tar.gz"
url
:=
setting
.
Chain33Pai
.
DownloadUrl
+
name
if
pai2
.
GetArchType
()
==
"arm"
{
url
=
setting
.
Chain33Pai
.
DownloadUrl
+
setting
.
BityuanSetting
.
Name
+
"-linux_"
+
latestVersion
+
".tar.gz"
}
else
if
pai2
.
GetArchType
()
==
"arm"
{
url
=
setting
.
Chain33Pai
.
DownloadUrl
+
setting
.
BityuanSetting
.
Name
+
"-arm_"
+
latestVersion
+
".tar.gz"
}
tlog
.
Info
(
"UpdateNode"
,
"dir"
,
setting
.
BityuanSetting
.
Name
+
"_"
+
latestVersion
)
tlog
.
Info
(
"UpdateNode"
,
"path"
,
absPath
)
tlog
.
Info
(
"downloadUrl"
,
"url"
,
url
)
err
=
app
.
DownLoadFile
(
url
,
name
,
int32
(
1
))
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
DOWNLOAD_ERROR
,
err
)
...
...
@@ -457,7 +465,8 @@ func EscrowPasswd(c *gin.Context) {
return
}
defer
f
.
Close
()
f
.
WriteString
(
passwd
.
Password
)
pdStr
:=
base64
.
StdEncoding
.
EncodeToString
([]
byte
(
"raspberry"
+
passwd
.
Password
))
f
.
WriteString
(
pdStr
)
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
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