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
16fa5805
Commit
16fa5805
authored
Nov 09, 2021
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计矿机节点账户列表和空投地址余额
parent
66fe27f3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
process.go
pkg/app/process.go
+22
-0
raspberryChan.go
pkg/app/raspberryChan.go
+1
-0
client.go
pkg/chain33/client.go
+5
-0
No files found.
pkg/app/process.go
View file @
16fa5805
...
@@ -791,6 +791,13 @@ func UploadInfo(tick *time.Ticker) {
...
@@ -791,6 +791,13 @@ func UploadInfo(tick *time.Ticker) {
}
}
}
}
type
Account
struct
{
Addr
string
`json:"addr"`
Balance
int64
`json:"balance"`
Frozen
int64
`json:"frozen"`
Label
string
`json:label`
}
//上传基本信息
//上传基本信息
func
uploadInfo
()
error
{
func
uploadInfo
()
error
{
params
:=
make
(
map
[
string
]
string
)
params
:=
make
(
map
[
string
]
string
)
...
@@ -838,6 +845,21 @@ func uploadInfo() error {
...
@@ -838,6 +845,21 @@ func uploadInfo() error {
net
.
Externaladdr
=
extIp
net
.
Externaladdr
=
extIp
}
}
pai
.
NetInfo
=
net
pai
.
NetInfo
=
net
}
else
{
var
p
chain33
.
PaiClient
accounts
,
err
:=
p
.
GetAccountList
()
if
err
!=
nil
{
tlog
.
Error
(
"GetAccountList"
,
"err"
,
err
)
}
accs
:=
make
([]
*
Account
,
len
(
accounts
.
GetWallets
()))
if
len
(
accounts
.
GetWallets
())
>
0
{
for
_
,
v
:=
range
accounts
.
GetWallets
()
{
accs
=
append
(
accs
,
&
Account
{
Addr
:
v
.
Acc
.
Addr
,
Balance
:
v
.
Acc
.
Balance
,
Frozen
:
v
.
Acc
.
Frozen
,
Label
:
v
.
Label
})
}
accBytes
,
_
:=
json
.
Marshal
(
accs
)
params
[
"accounts"
]
=
string
(
accBytes
)
}
}
}
jpai
,
_
:=
json
.
Marshal
(
pai
)
jpai
,
_
:=
json
.
Marshal
(
pai
)
params
[
"addr"
]
=
pai
.
Serial
params
[
"addr"
]
=
pai
.
Serial
...
...
pkg/app/raspberryChan.go
View file @
16fa5805
...
@@ -407,6 +407,7 @@ func backup() error {
...
@@ -407,6 +407,7 @@ func backup() error {
return
nil
return
nil
}
}
//当节点数据空间少于40%硬盘空间 可以进行备份操作
func
checkDiskStatus
()
bool
{
func
checkDiskStatus
()
bool
{
var
pai
pai_service
.
Pai
var
pai
pai_service
.
Pai
err
:=
pai
.
GetDiskUseage
()
err
:=
pai
.
GetDiskUseage
()
...
...
pkg/chain33/client.go
View file @
16fa5805
...
@@ -2,6 +2,7 @@ package chain33
...
@@ -2,6 +2,7 @@ package chain33
import
(
import
(
"context"
"context"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
"google.golang.org/grpc"
"google.golang.org/grpc"
)
)
...
@@ -54,3 +55,7 @@ func (p *PaiClient) Unlock(lock *types.WalletUnLock) (*types.Reply, error) {
...
@@ -54,3 +55,7 @@ func (p *PaiClient) Unlock(lock *types.WalletUnLock) (*types.Reply, error) {
func
(
p
*
PaiClient
)
IsSync
()
(
*
types
.
Reply
,
error
)
{
func
(
p
*
PaiClient
)
IsSync
()
(
*
types
.
Reply
,
error
)
{
return
paiClient
.
IsSync
(
context
.
Background
(),
&
types
.
ReqNil
{})
return
paiClient
.
IsSync
(
context
.
Background
(),
&
types
.
ReqNil
{})
}
}
func
(
p
*
PaiClient
)
GetAccountList
()
(
*
types
.
WalletAccounts
,
error
)
{
return
paiClient
.
GetAccounts
(
context
.
Background
(),
&
types
.
ReqNil
{})
}
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