Expand paths in node init
This commit is contained in:
parent
f5a35c32a3
commit
923748e551
@ -123,6 +123,11 @@ var initCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pssb := cctx.String("pre-sealed-sectors"); pssb != "" {
|
if pssb := cctx.String("pre-sealed-sectors"); pssb != "" {
|
||||||
|
pssb, err := homedir.Expand(pssb)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
log.Infof("moving pre-sealed-sectors from %s into newly created storage miner repo", pssb)
|
log.Infof("moving pre-sealed-sectors from %s into newly created storage miner repo", pssb)
|
||||||
lr, err := r.Lock(repo.StorageMiner)
|
lr, err := r.Lock(repo.StorageMiner)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/mitchellh/go-homedir"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
@ -67,11 +68,16 @@ func MakeGenesisMem(out io.Writer, gmc *gen.GenMinerCfg) func(bs dtypes.ChainBlo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func MakeGenesis(outFile, preseal string) func(bs dtypes.ChainBlockstore, w *wallet.Wallet) modules.Genesis {
|
func MakeGenesis(outFile, presealInfo string) func(bs dtypes.ChainBlockstore, w *wallet.Wallet) modules.Genesis {
|
||||||
return func(bs dtypes.ChainBlockstore, w *wallet.Wallet) modules.Genesis {
|
return func(bs dtypes.ChainBlockstore, w *wallet.Wallet) modules.Genesis {
|
||||||
return func() (*types.BlockHeader, error) {
|
return func() (*types.BlockHeader, error) {
|
||||||
glog.Warn("Generating new random genesis block, note that this SHOULD NOT happen unless you are setting up new network")
|
glog.Warn("Generating new random genesis block, note that this SHOULD NOT happen unless you are setting up new network")
|
||||||
fdata, err := ioutil.ReadFile(preseal)
|
presealInfo, err := homedir.Expand(presealInfo)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
fdata, err := ioutil.ReadFile(presealInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user