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
bc8f0bd4
Commit
bc8f0bd4
authored
Aug 27, 2021
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.3.3
parent
2cf47178
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
14 deletions
+27
-14
version.go
pkg/app/version.go
+1
-1
node.go
routers/api/v1/node.go
+26
-13
No files found.
pkg/app/version.go
View file @
bc8f0bd4
package
app
package
app
const
version
=
"0.3.
2
"
const
version
=
"0.3.
3
"
var
(
var
(
GitCommit
string
GitCommit
string
...
...
routers/api/v1/node.go
View file @
bc8f0bd4
...
@@ -12,8 +12,6 @@ import (
...
@@ -12,8 +12,6 @@ import (
"encoding/base64"
"encoding/base64"
"encoding/json"
"encoding/json"
"fmt"
"fmt"
"github.com/33cn/chain33/types"
"github.com/gin-gonic/gin"
"io/ioutil"
"io/ioutil"
"log"
"log"
"net/http"
"net/http"
...
@@ -22,6 +20,9 @@ import (
...
@@ -22,6 +20,9 @@ import (
"reflect"
"reflect"
"strings"
"strings"
"time"
"time"
"github.com/33cn/chain33/types"
"github.com/gin-gonic/gin"
)
)
// @Summary 重置节点钱包
// @Summary 重置节点钱包
...
@@ -66,14 +67,26 @@ func UpdateNodeNew(c *gin.Context) {
...
@@ -66,14 +67,26 @@ func UpdateNodeNew(c *gin.Context) {
//app.UpdateInfo.Flag = false
//app.UpdateInfo.Flag = false
setting
.
FreshVersion
()
setting
.
FreshVersion
()
var
pai
pai_service
.
Pai
var
pai
pai_service
.
Pai
var
latestVersion
string
latestVersion
,
err
:=
pai
.
GetPaiLatestVersion
(
int32
(
1
))
//判断当前环境为测试环境还是正式环境
if
err
!=
nil
{
if
setting
.
Chain33Pai
.
Env
==
"formal"
{
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
"get online version err"
)
latestVersion
,
err
=
pai
.
GetPaiLatestVersion
(
int32
(
1
))
app
.
BityuanFlag
.
Flag
=
false
if
err
!=
nil
{
//app.UpdateInfo.Flag = true
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
"get online version err"
)
return
app
.
BityuanFlag
.
Flag
=
false
//app.UpdateInfo.Flag = true
return
}
}
else
if
setting
.
Chain33Pai
.
Env
==
"test"
{
latestVersion
,
err
=
pai
.
GetPaiVersionTest
(
int32
(
1
))
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
"get online version err"
)
app
.
BityuanFlag
.
Flag
=
false
//app.UpdateInfo.Flag = true
return
}
}
}
if
latestVersion
==
setting
.
BityuanSetting
.
Version
{
if
latestVersion
==
setting
.
BityuanSetting
.
Version
{
//app.UpdateInfo.Flag = true
//app.UpdateInfo.Flag = true
app
.
BityuanFlag
.
Flag
=
false
app
.
BityuanFlag
.
Flag
=
false
...
@@ -92,14 +105,14 @@ func UpdateNodeNew(c *gin.Context) {
...
@@ -92,14 +105,14 @@ func UpdateNodeNew(c *gin.Context) {
url
:=
setting
.
Chain33Pai
.
DownloadUrl
+
name
url
:=
setting
.
Chain33Pai
.
DownloadUrl
+
name
if
pai2
.
GetArchType
()
==
"x86_64"
{
if
pai2
.
GetArchType
()
==
"x86_64"
{
name
=
setting
.
BityuanSetting
.
Name
+
"-linux_"
+
latestVersion
+
".tar.gz"
name
=
setting
.
BityuanSetting
.
Name
+
"-linux_"
+
latestVersion
+
".tar.gz"
url
=
setting
.
Chain33Pai
.
DownloadUrl
+
name
url
=
setting
.
Chain33Pai
.
DownloadUrl
+
name
}
else
if
pai2
.
GetArchType
()
==
"arm"
{
}
else
if
pai2
.
GetArchType
()
==
"arm"
{
name
=
setting
.
BityuanSetting
.
Name
+
"-arm_"
+
latestVersion
+
".tar.gz"
name
=
setting
.
BityuanSetting
.
Name
+
"-arm_"
+
latestVersion
+
".tar.gz"
url
=
setting
.
Chain33Pai
.
DownloadUrl
+
name
url
=
setting
.
Chain33Pai
.
DownloadUrl
+
name
}
}
tlog
.
Info
(
"UpdateNode"
,
"dir"
,
setting
.
BityuanSetting
.
Name
+
"_"
+
latestVersion
)
tlog
.
Info
(
"UpdateNode"
,
"dir"
,
setting
.
BityuanSetting
.
Name
+
"_"
+
latestVersion
)
tlog
.
Info
(
"UpdateNode"
,
"path"
,
absPath
)
tlog
.
Info
(
"UpdateNode"
,
"path"
,
absPath
)
tlog
.
Info
(
"downloadUrl"
,
"url"
,
url
)
tlog
.
Info
(
"downloadUrl"
,
"url"
,
url
)
err
=
app
.
DownLoadFile
(
url
,
name
,
int32
(
1
))
err
=
app
.
DownLoadFile
(
url
,
name
,
int32
(
1
))
if
err
!=
nil
{
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
DOWNLOAD_ERROR
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
DOWNLOAD_ERROR
,
err
)
...
@@ -467,7 +480,7 @@ func EscrowPasswd(c *gin.Context) {
...
@@ -467,7 +480,7 @@ func EscrowPasswd(c *gin.Context) {
return
return
}
}
defer
f
.
Close
()
defer
f
.
Close
()
pdStr
:=
base64
.
StdEncoding
.
EncodeToString
([]
byte
(
"raspberry"
+
passwd
.
Password
))
pdStr
:=
base64
.
StdEncoding
.
EncodeToString
([]
byte
(
"raspberry"
+
passwd
.
Password
))
f
.
WriteString
(
pdStr
)
f
.
WriteString
(
pdStr
)
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
nil
)
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