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
e4aaa752
Commit
e4aaa752
authored
Apr 01, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部分接口升级 参数,部分功能调整
parent
aee656e6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
process.go
pkg/app/process.go
+1
-0
client.go
pkg/chain33/client.go
+2
-2
node.go
routers/api/v1/node.go
+3
-0
pai.go
service/pai_service/pai.go
+4
-5
No files found.
pkg/app/process.go
View file @
e4aaa752
...
...
@@ -146,6 +146,7 @@ func CornProcessJob(ticker *time.Ticker){
if
!
BityuanFlag
{
//有更新,重置等节点重启操作时 禁止运行,防止冲突
//节点未启动 会调用auto启动
NodeError
=
getWalletInfo
()
//升级6.4.0bityuan
updateBityuan640
()
}
}
...
...
pkg/chain33/client.go
View file @
e4aaa752
...
...
@@ -30,7 +30,7 @@ func (p *PaiClient) GetWalletStatus() (*types.WalletStatus,error) {
}
func
(
p
*
PaiClient
)
GetPeerInfo
()
(
*
types
.
PeerList
,
error
)
{
return
paiClient
.
GetPeerInfo
(
context
.
Background
(),
&
types
.
ReqNil
{})
return
paiClient
.
GetPeerInfo
(
context
.
Background
(),
&
types
.
P2PGetPeerReq
{})
}
func
(
p
*
PaiClient
)
IsNtpClockSync
()
(
*
types
.
Reply
,
error
)
{
...
...
@@ -38,7 +38,7 @@ func (p *PaiClient) IsNtpClockSync() (*types.Reply,error) {
}
func
(
p
*
PaiClient
)
GetNetInfo
()
(
*
types
.
NodeNetInfo
,
error
)
{
return
paiClient
.
NetInfo
(
context
.
Background
(),
&
types
.
ReqNil
{})
return
paiClient
.
NetInfo
(
context
.
Background
(),
&
types
.
P2PGetNetInfoReq
{})
}
func
(
p
*
PaiClient
)
Version
()(
*
types
.
VersionInfo
,
error
){
...
...
routers/api/v1/node.go
View file @
e4aaa752
...
...
@@ -19,6 +19,7 @@ import (
"chain33-pai/pkg/chain33"
"github.com/33cn/chain33/types"
"strings"
"time"
)
var
flag
bool
//判断是否正在更新
...
...
@@ -274,6 +275,8 @@ func CloseNode(c* gin.Context){
app
.
BityuanFlag
=
false
return
}
//防止其他模块未关闭
time
.
Sleep
(
time
.
Second
*
2
)
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
"node close safe"
)
}
...
...
service/pai_service/pai.go
View file @
e4aaa752
...
...
@@ -6,7 +6,6 @@ import (
"strings"
"bufio"
"chain33-pai/pkg/chain33"
"chain33-pai/pkg/logging"
"github.com/33cn/chain33/types"
log
"github.com/33cn/chain33/common/log/log15"
"net/http"
...
...
@@ -62,7 +61,7 @@ func (p *Pai) GetDevstatus() error {
client
:=
&
chain33
.
PaiClient
{}
peerinfo
,
err
:=
client
.
GetPeerInfo
()
if
err
!=
nil
{
logging
.
Error
(
"GetDevstatus peerinfo
err"
,
err
)
tlog
.
Error
(
"GetDevstatus peerinfo "
,
"
err"
,
err
)
return
err
}
...
...
@@ -76,19 +75,19 @@ func (p *Pai) GetDevstatus() error {
}
sync
,
err
:=
client
.
IsNtpClockSync
()
if
err
!=
nil
{
logging
.
Error
(
"GetDevstatus IsNtpClockSync
err"
,
err
)
tlog
.
Error
(
"GetDevstatus IsNtpClockSync"
,
"
err"
,
err
)
return
err
}
p
.
IsNtpSync
=
sync
.
IsOk
netinfo
,
err
:=
client
.
GetNetInfo
()
if
err
!=
nil
{
logging
.
Error
(
"GetDevstatus GetNetInfo
err"
,
err
)
tlog
.
Error
(
"GetDevstatus GetNetInfo"
,
"
err"
,
err
)
return
err
}
p
.
NetInfo
=
netinfo
walletstatus
,
err
:=
client
.
GetWalletStatus
()
if
err
!=
nil
{
logging
.
Error
(
"GetDevstatus GetWalletStatus
err"
,
err
)
tlog
.
Error
(
"GetDevstatus GetWalletStatus "
,
"
err"
,
err
)
return
err
}
p
.
WalletStatus
=
walletstatus
...
...
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