Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
4f5ec772
Commit
4f5ec772
authored
8 years ago
by
zramsay
Browse files
Options
Downloads
Patches
Plain Diff
start sorting dependencies
parent
f54d91d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
genesis/make_genesis_file.go
+16
-13
16 additions, 13 deletions
genesis/make_genesis_file.go
with
16 additions
and
13 deletions
genesis/
cli
.go
→
genesis/
make_genesis_file
.go
+
16
−
13
View file @
4f5ec772
...
...
@@ -12,14 +12,17 @@ import (
"strings"
"time"
.
"github.com/eris-ltd/common/go/common"
"github.com/eris-ltd/
mint-client/Godeps/_workspace/src/github.com/eris-ltd/tendermint
/types"
//
"github.com/
spf13/cobra
"
"github.com/eris-ltd/common/go/common"
stypes
"github.com/eris-ltd/
eris-db/manager/eris-mint/state
/types"
ptypes
"github.com/
eris-ltd/eris-db/permission/types
"
wire
"github.com/tendermint/go-wire"
// TODO
"github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/eris-ltd/tendermint/types"
// TODO
"github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/eris-ltd/tendermint/account"
ptypes
"github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/eris-ltd/tendermint/permission/types"
stypes
"github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/eris-ltd/tendermint/state/types"
//"github.com/eris-ltd/eris-db/account"
)
//------------------------------------------------------------------------------------
...
...
@@ -105,7 +108,7 @@ func genesisFromPrivValBytes(chainID string, privJSON []byte) *stypes.GenesisDoc
var
err
error
privVal
:=
wire
.
ReadJSON
(
&
types
.
PrivValidator
{},
privJSON
,
&
err
)
.
(
*
types
.
PrivValidator
)
if
err
!=
nil
{
Exit
(
fmt
.
Errorf
(
"Error reading PrivValidator on stdin: %v
\n
"
,
err
))
common
.
Exit
(
fmt
.
Errorf
(
"Error reading PrivValidator on stdin: %v
\n
"
,
err
))
}
pubKey
:=
privVal
.
PubKey
amt
:=
int64
(
1
)
<<
50
...
...
@@ -166,7 +169,7 @@ func pubKeyStringsToPubKeys(pubkeys []string) []account.PubKeyEd25519 {
for
i
,
k
:=
range
pubkeys
{
pubBytes
,
err
:=
hex
.
DecodeString
(
k
)
if
err
!=
nil
{
Exit
(
fmt
.
Errorf
(
"Pubkey (%s) is invalid hex: %v"
,
k
,
err
))
common
.
Exit
(
fmt
.
Errorf
(
"Pubkey (%s) is invalid hex: %v"
,
k
,
err
))
}
copy
(
pubKeys
[
i
][
:
],
pubBytes
)
}
...
...
@@ -188,7 +191,7 @@ func parseCsv(filePath string) (pubKeys []account.PubKeyEd25519, amts []int64, n
csvFile
,
err
:=
os
.
Open
(
filePath
)
if
err
!=
nil
{
Exit
(
fmt
.
Errorf
(
"Couldn't open file: %s: %v"
,
filePath
,
err
))
common
.
Exit
(
fmt
.
Errorf
(
"Couldn't open file: %s: %v"
,
filePath
,
err
))
}
defer
csvFile
.
Close
()
...
...
@@ -196,7 +199,7 @@ func parseCsv(filePath string) (pubKeys []account.PubKeyEd25519, amts []int64, n
//r.FieldsPerRecord = # of records expected
params
,
err
:=
r
.
ReadAll
()
if
err
!=
nil
{
Exit
(
fmt
.
Errorf
(
"Couldn't read file: %v"
,
err
))
common
.
Exit
(
fmt
.
Errorf
(
"Couldn't read file: %v"
,
err
))
}
...
...
@@ -218,7 +221,7 @@ func parseCsv(filePath string) (pubKeys []account.PubKeyEd25519, amts []int64, n
for
i
,
perm
:=
range
permsS
{
pflag
,
err
:=
strconv
.
Atoi
(
perm
)
if
err
!=
nil
{
Exit
(
fmt
.
Errorf
(
"Permissions must be an integer"
))
common
.
Exit
(
fmt
.
Errorf
(
"Permissions must be an integer"
))
}
perms
[
i
]
=
ptypes
.
PermFlag
(
pflag
)
}
...
...
@@ -226,7 +229,7 @@ func parseCsv(filePath string) (pubKeys []account.PubKeyEd25519, amts []int64, n
for
i
,
setbit
:=
range
setbitS
{
setbitsFlag
,
err
:=
strconv
.
Atoi
(
setbit
)
if
err
!=
nil
{
Exit
(
fmt
.
Errorf
(
"SetBits must be an integer"
))
common
.
Exit
(
fmt
.
Errorf
(
"SetBits must be an integer"
))
}
setbits
[
i
]
=
ptypes
.
PermFlag
(
setbitsFlag
)
}
...
...
@@ -253,13 +256,13 @@ func readStdinTimeout() []byte {
ch
:=
make
(
chan
[]
byte
,
1
)
go
func
()
{
privJSON
,
err
:=
ioutil
.
ReadAll
(
os
.
Stdin
)
IfExit
(
err
)
common
.
IfExit
(
err
)
ch
<-
privJSON
}()
ticker
:=
time
.
Tick
(
time
.
Second
*
stdinTimeoutSeconds
)
select
{
case
<-
ticker
:
Exit
(
fmt
.
Errorf
(
"Please pass a priv_validator.json on stdin, or specify either a pubkey with --pub or csv file with --csv"
))
common
.
Exit
(
fmt
.
Errorf
(
"Please pass a priv_validator.json on stdin, or specify either a pubkey with --pub or csv file with --csv"
))
case
privJSON
:=
<-
ch
:
return
privJSON
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment