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
06cad79e
Commit
06cad79e
authored
Mar 17, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0a3a1223
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
main.go
main.go
+4
-1
process.go
pkg/app/process.go
+10
-4
client.go
pkg/chain33/client.go
+0
-1
No files found.
main.go
View file @
06cad79e
...
@@ -55,7 +55,10 @@ func main() {
...
@@ -55,7 +55,10 @@ func main() {
tlog
.
Info
(
"[info] start http server listening "
,
"port"
,
endPoint
)
tlog
.
Info
(
"[info] start http server listening "
,
"port"
,
endPoint
)
go
func
(){
go
func
(){
time
.
Sleep
(
time
.
Second
*
10
)
time
.
Sleep
(
time
.
Second
*
10
)
app
.
Unlock
()
err
:=
app
.
Unlock
()
if
err
==
nil
{
//app.AutoOpenTicket()
}
}()
}()
server
.
ListenAndServe
()
server
.
ListenAndServe
()
select
{}
select
{}
...
...
pkg/app/process.go
View file @
06cad79e
...
@@ -439,17 +439,17 @@ func MVScripts(src,dst string){//Absolute Path
...
@@ -439,17 +439,17 @@ func MVScripts(src,dst string){//Absolute Path
os
.
Chdir
(
path
)
os
.
Chdir
(
path
)
}
}
func
Unlock
(){
func
Unlock
()
error
{
var
passwd
[]
byte
var
passwd
[]
byte
f
,
err
:=
os
.
Open
(
setting
.
BityuanSetting
.
Passwd
)
f
,
err
:=
os
.
Open
(
setting
.
BityuanSetting
.
Passwd
)
if
err
!=
nil
{
if
err
!=
nil
{
tlog
.
Info
(
"password dose not set"
)
tlog
.
Info
(
"password dose not set"
)
return
return
err
}
}
passwd
,
err
=
ioutil
.
ReadAll
(
f
)
passwd
,
err
=
ioutil
.
ReadAll
(
f
)
if
err
!=
nil
{
if
err
!=
nil
{
tlog
.
Info
(
"Read passwd failed"
)
tlog
.
Info
(
"Read passwd failed"
)
return
return
err
}
}
_
,
err
=
setting
.
PaiClient
.
Unlock
(
&
types
.
WalletUnLock
{
_
,
err
=
setting
.
PaiClient
.
Unlock
(
&
types
.
WalletUnLock
{
Passwd
:
string
(
passwd
),
Passwd
:
string
(
passwd
),
...
@@ -461,9 +461,15 @@ func Unlock(){
...
@@ -461,9 +461,15 @@ func Unlock(){
})
})
if
err
!=
nil
{
if
err
!=
nil
{
tlog
.
Info
(
"unlock auth failed"
)
tlog
.
Info
(
"unlock auth failed"
)
return
err
}
}
return
nil
}
}
func
AutoOpenTicket
()
error
{
return
nil
}
func
AutoUpdate
(
tick
*
time
.
Ticker
)
{
func
AutoUpdate
(
tick
*
time
.
Ticker
)
{
for
{
for
{
...
@@ -501,7 +507,7 @@ func AutoUpdatePai() error {
...
@@ -501,7 +507,7 @@ func AutoUpdatePai() error {
return
err
return
err
}
}
//解压缩文件
//解压缩文件
tar
:=
exec
.
Command
(
"tar"
,
"-xvf"
,
setting
.
Chain33Pai
.
Name
)
tar
:=
exec
.
Command
(
"tar"
,
"-xvf"
,
name
,
"../"
)
err
=
tar
.
Start
()
err
=
tar
.
Start
()
if
err
!=
nil
{
if
err
!=
nil
{
tlog
.
Error
(
"tar"
,
"err"
,
err
)
tlog
.
Error
(
"tar"
,
"err"
,
err
)
...
...
pkg/chain33/client.go
View file @
06cad79e
...
@@ -13,7 +13,6 @@ type PaiClient struct {
...
@@ -13,7 +13,6 @@ type PaiClient struct {
var
(
var
(
paiClient
types
.
Chain33Client
paiClient
types
.
Chain33Client
paiNetgrpcAddr
=
"localhost:8802"
paiNetgrpcAddr
=
"localhost:8802"
)
)
...
...
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