This commit is contained in:
Łukasz Magiera 2020-03-06 20:01:28 +01:00
parent 3d1a5f4bf3
commit 3cab8bd5d1
10 changed files with 74 additions and 75 deletions

View File

@ -87,7 +87,7 @@ func (k *KeyManager) newBLSKey() *wallet.Key {
//sk := ffi.PrivateKeyGenerate(s.blsSeed) //sk := ffi.PrivateKeyGenerate(s.blsSeed)
// s.blsSeed++ // s.blsSeed++
sk := [32]byte{} sk := [32]byte{}
sk[0] = uint8(k.blsSeed+1) // hack to keep gas values determinist sk[0] = uint8(k.blsSeed + 1) // hack to keep gas values determinist
key, err := wallet.NewKey(types.KeyInfo{ key, err := wallet.NewKey(types.KeyInfo{
Type: wallet.KTBLS, Type: wallet.KTBLS,
PrivateKey: sk[:], PrivateKey: sk[:],

View File

@ -35,8 +35,8 @@ var clientCmd = &cli.Command{
} }
var clientImportCmd = &cli.Command{ var clientImportCmd = &cli.Command{
Name: "import", Name: "import",
Usage: "Import data", Usage: "Import data",
ArgsUsage: "[inputPath]", ArgsUsage: "[inputPath]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -82,8 +82,8 @@ var clientLocalCmd = &cli.Command{
} }
var clientDealCmd = &cli.Command{ var clientDealCmd = &cli.Command{
Name: "deal", Name: "deal",
Usage: "Initialize storage deal with a miner", Usage: "Initialize storage deal with a miner",
ArgsUsage: "[dataCid miner price duration]", ArgsUsage: "[dataCid miner price duration]",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
@ -193,8 +193,8 @@ var clientDealCmd = &cli.Command{
} }
var clientFindCmd = &cli.Command{ var clientFindCmd = &cli.Command{
Name: "find", Name: "find",
Usage: "find data in the network", Usage: "find data in the network",
ArgsUsage: "[dataCid]", ArgsUsage: "[dataCid]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if !cctx.Args().Present() { if !cctx.Args().Present() {
@ -243,8 +243,8 @@ var clientFindCmd = &cli.Command{
} }
var clientRetrieveCmd = &cli.Command{ var clientRetrieveCmd = &cli.Command{
Name: "retrieve", Name: "retrieve",
Usage: "retrieve data from network", Usage: "retrieve data from network",
ArgsUsage: "[dataCid outputPath]", ArgsUsage: "[dataCid outputPath]",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{
@ -314,8 +314,8 @@ var clientRetrieveCmd = &cli.Command{
} }
var clientQueryAskCmd = &cli.Command{ var clientQueryAskCmd = &cli.Command{
Name: "query-ask", Name: "query-ask",
Usage: "find a miners ask", Usage: "find a miners ask",
ArgsUsage: "[minerAddress]", ArgsUsage: "[minerAddress]",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{

View File

@ -47,8 +47,8 @@ var multisigCmd = &cli.Command{
} }
var msigCreateCmd = &cli.Command{ var msigCreateCmd = &cli.Command{
Name: "create", Name: "create",
Usage: "Create a new multisig wallet", Usage: "Create a new multisig wallet",
ArgsUsage: "[address1 address2 ...]", ArgsUsage: "[address1 address2 ...]",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.Int64Flag{ &cli.Int64Flag{
@ -158,10 +158,10 @@ var msigCreateCmd = &cli.Command{
} }
var msigInspectCmd = &cli.Command{ var msigInspectCmd = &cli.Command{
Name: "inspect", Name: "inspect",
Usage: "Inspect a multisig wallet", Usage: "Inspect a multisig wallet",
ArgsUsage: "[address]", ArgsUsage: "[address]",
Flags: []cli.Flag{}, Flags: []cli.Flag{},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
if err != nil { if err != nil {
@ -271,10 +271,10 @@ func state(tx *samsig.Transaction) string {
} }
var msigProposeCmd = &cli.Command{ var msigProposeCmd = &cli.Command{
Name: "propose", Name: "propose",
Usage: "Propose a multisig transaction", Usage: "Propose a multisig transaction",
ArgsUsage: "[multisigAddress destinationAddress value <methodName methodParams> (optional)]", ArgsUsage: "[multisigAddress destinationAddress value <methodName methodParams> (optional)]",
Flags: []cli.Flag{}, Flags: []cli.Flag{},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
if err != nil { if err != nil {
@ -385,10 +385,10 @@ var msigProposeCmd = &cli.Command{
} }
var msigApproveCmd = &cli.Command{ var msigApproveCmd = &cli.Command{
Name: "approve", Name: "approve",
Usage: "Approve a multisig message", Usage: "Approve a multisig message",
ArgsUsage: "[multisigAddress messageId]", ArgsUsage: "[multisigAddress messageId]",
Flags: []cli.Flag{}, Flags: []cli.Flag{},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
if err != nil { if err != nil {

View File

@ -23,8 +23,8 @@ var paychCmd = &cli.Command{
} }
var paychGetCmd = &cli.Command{ var paychGetCmd = &cli.Command{
Name: "get", Name: "get",
Usage: "Create a new payment channel or get existing one", Usage: "Create a new payment channel or get existing one",
ArgsUsage: "[fromAddress toAddress amount]", ArgsUsage: "[fromAddress toAddress amount]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.Args().Len() != 3 { if cctx.Args().Len() != 3 {
@ -102,8 +102,8 @@ var paychVoucherCmd = &cli.Command{
} }
var paychVoucherCreateCmd = &cli.Command{ var paychVoucherCreateCmd = &cli.Command{
Name: "create", Name: "create",
Usage: "Create a signed payment channel voucher", Usage: "Create a signed payment channel voucher",
ArgsUsage: "[channelAddress amount]", ArgsUsage: "[channelAddress amount]",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.IntFlag{ &cli.IntFlag{
@ -153,8 +153,8 @@ var paychVoucherCreateCmd = &cli.Command{
} }
var paychVoucherCheckCmd = &cli.Command{ var paychVoucherCheckCmd = &cli.Command{
Name: "check", Name: "check",
Usage: "Check validity of payment channel voucher", Usage: "Check validity of payment channel voucher",
ArgsUsage: "[channelAddress voucher]", ArgsUsage: "[channelAddress voucher]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.Args().Len() != 2 { if cctx.Args().Len() != 2 {
@ -189,8 +189,8 @@ var paychVoucherCheckCmd = &cli.Command{
} }
var paychVoucherAddCmd = &cli.Command{ var paychVoucherAddCmd = &cli.Command{
Name: "add", Name: "add",
Usage: "Add payment channel voucher to local datastore", Usage: "Add payment channel voucher to local datastore",
ArgsUsage: "[channelAddress voucher]", ArgsUsage: "[channelAddress voucher]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.Args().Len() != 2 { if cctx.Args().Len() != 2 {
@ -225,8 +225,8 @@ var paychVoucherAddCmd = &cli.Command{
} }
var paychVoucherListCmd = &cli.Command{ var paychVoucherListCmd = &cli.Command{
Name: "list", Name: "list",
Usage: "List stored vouchers for a given payment channel", Usage: "List stored vouchers for a given payment channel",
ArgsUsage: "[channelAddress]", ArgsUsage: "[channelAddress]",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
@ -275,8 +275,8 @@ var paychVoucherListCmd = &cli.Command{
} }
var paychVoucherBestSpendableCmd = &cli.Command{ var paychVoucherBestSpendableCmd = &cli.Command{
Name: "best-spendable", Name: "best-spendable",
Usage: "Print voucher with highest value that is currently spendable", Usage: "Print voucher with highest value that is currently spendable",
ArgsUsage: "[channelAddress]", ArgsUsage: "[channelAddress]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.Args().Len() != 1 { if cctx.Args().Len() != 1 {
@ -330,8 +330,8 @@ var paychVoucherBestSpendableCmd = &cli.Command{
} }
var paychVoucherSubmitCmd = &cli.Command{ var paychVoucherSubmitCmd = &cli.Command{
Name: "submit", Name: "submit",
Usage: "Submit voucher to chain to update payment channel state", Usage: "Submit voucher to chain to update payment channel state",
ArgsUsage: "[channelAddress voucher]", ArgsUsage: "[channelAddress voucher]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.Args().Len() != 2 { if cctx.Args().Len() != 2 {

View File

@ -61,8 +61,8 @@ var stateCmd = &cli.Command{
} }
var stateMinerInfo = &cli.Command{ var stateMinerInfo = &cli.Command{
Name: "miner-info", Name: "miner-info",
Usage: "Retrieve miner information", Usage: "Retrieve miner information",
ArgsUsage: "[minerAddress]", ArgsUsage: "[minerAddress]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -153,8 +153,8 @@ func loadTipSet(ctx context.Context, cctx *cli.Context, api api.FullNode) (*type
} }
var statePowerCmd = &cli.Command{ var statePowerCmd = &cli.Command{
Name: "power", Name: "power",
Usage: "Query network or miner power", Usage: "Query network or miner power",
ArgsUsage: "[<minerAddress> (optional)]", ArgsUsage: "[<minerAddress> (optional)]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -197,8 +197,8 @@ var statePowerCmd = &cli.Command{
} }
var stateSectorsCmd = &cli.Command{ var stateSectorsCmd = &cli.Command{
Name: "sectors", Name: "sectors",
Usage: "Query the sector set of a miner", Usage: "Query the sector set of a miner",
ArgsUsage: "[minerAddress]", ArgsUsage: "[minerAddress]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -237,8 +237,8 @@ var stateSectorsCmd = &cli.Command{
} }
var stateProvingSetCmd = &cli.Command{ var stateProvingSetCmd = &cli.Command{
Name: "proving", Name: "proving",
Usage: "Query the proving set of a miner", Usage: "Query the proving set of a miner",
ArgsUsage: "[minerAddress]", ArgsUsage: "[minerAddress]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -277,8 +277,8 @@ var stateProvingSetCmd = &cli.Command{
} }
var stateReplaySetCmd = &cli.Command{ var stateReplaySetCmd = &cli.Command{
Name: "replay", Name: "replay",
Usage: "Replay a particular message within a tipset", Usage: "Replay a particular message within a tipset",
ArgsUsage: "[tipsetKey messageCid]", ArgsUsage: "[tipsetKey messageCid]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.Args().Len() < 1 { if cctx.Args().Len() < 1 {
@ -384,8 +384,8 @@ var statePledgeCollateralCmd = &cli.Command{
} }
var stateGetDealSetCmd = &cli.Command{ var stateGetDealSetCmd = &cli.Command{
Name: "get-deal", Name: "get-deal",
Usage: "View on-chain deal info", Usage: "View on-chain deal info",
ArgsUsage: "[dealId]", ArgsUsage: "[dealId]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -486,8 +486,8 @@ var stateListActorsCmd = &cli.Command{
} }
var stateGetActorCmd = &cli.Command{ var stateGetActorCmd = &cli.Command{
Name: "get-actor", Name: "get-actor",
Usage: "Print actor information", Usage: "Print actor information",
ArgsUsage: "[actorrAddress]", ArgsUsage: "[actorrAddress]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -528,8 +528,8 @@ var stateGetActorCmd = &cli.Command{
} }
var stateLookupIDCmd = &cli.Command{ var stateLookupIDCmd = &cli.Command{
Name: "lookup", Name: "lookup",
Usage: "Find corresponding ID address", Usage: "Find corresponding ID address",
ArgsUsage: "[address]", ArgsUsage: "[address]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -566,8 +566,8 @@ var stateLookupIDCmd = &cli.Command{
} }
var stateSectorSizeCmd = &cli.Command{ var stateSectorSizeCmd = &cli.Command{
Name: "sector-size", Name: "sector-size",
Usage: "Look up miners sector size", Usage: "Look up miners sector size",
ArgsUsage: "[minerAddress]", ArgsUsage: "[minerAddress]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -603,8 +603,8 @@ var stateSectorSizeCmd = &cli.Command{
} }
var stateReadStateCmd = &cli.Command{ var stateReadStateCmd = &cli.Command{
Name: "read-state", Name: "read-state",
Usage: "View a json representation of an actors state", Usage: "View a json representation of an actors state",
ArgsUsage: "[actorAddress]", ArgsUsage: "[actorAddress]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -796,8 +796,8 @@ var stateComputeStateCmd = &cli.Command{
} }
var stateWaitMsgCmd = &cli.Command{ var stateWaitMsgCmd = &cli.Command{
Name: "wait-msg", Name: "wait-msg",
Usage: "Wait for a message to appear on chain", Usage: "Wait for a message to appear on chain",
ArgsUsage: "[messageCid]", ArgsUsage: "[messageCid]",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{
@ -837,8 +837,8 @@ var stateWaitMsgCmd = &cli.Command{
} }
var stateCallCmd = &cli.Command{ var stateCallCmd = &cli.Command{
Name: "call", Name: "call",
Usage: "Invoke a method on an actor locally", Usage: "Invoke a method on an actor locally",
ArgsUsage: "[toAddress methodId <param1 param2 ...> (optional)]", ArgsUsage: "[toAddress methodId <param1 param2 ...> (optional)]",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{

View File

@ -94,8 +94,8 @@ var syncWaitCmd = &cli.Command{
} }
var syncMarkBadCmd = &cli.Command{ var syncMarkBadCmd = &cli.Command{
Name: "mark-bad", Name: "mark-bad",
Usage: "Mark the given block as bad, will prevent syncing to a chain that contains it", Usage: "Mark the given block as bad, will prevent syncing to a chain that contains it",
ArgsUsage: "[blockCid]", ArgsUsage: "[blockCid]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
napi, closer, err := GetFullNodeAPI(cctx) napi, closer, err := GetFullNodeAPI(cctx)
@ -119,8 +119,8 @@ var syncMarkBadCmd = &cli.Command{
} }
var syncCheckBadCmd = &cli.Command{ var syncCheckBadCmd = &cli.Command{
Name: "check-bad", Name: "check-bad",
Usage: "check if the given block was marked bad, and for what reason", Usage: "check if the given block was marked bad, and for what reason",
ArgsUsage: "[blockCid]", ArgsUsage: "[blockCid]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
napi, closer, err := GetFullNodeAPI(cctx) napi, closer, err := GetFullNodeAPI(cctx)

View File

@ -135,8 +135,8 @@ var walletGetDefault = &cli.Command{
} }
var walletSetDefault = &cli.Command{ var walletSetDefault = &cli.Command{
Name: "set-default", Name: "set-default",
Usage: "Set default wallet address", Usage: "Set default wallet address",
ArgsUsage: "[address]", ArgsUsage: "[address]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -160,8 +160,8 @@ var walletSetDefault = &cli.Command{
} }
var walletExport = &cli.Command{ var walletExport = &cli.Command{
Name: "export", Name: "export",
Usage: "export keys", Usage: "export keys",
ArgsUsage: "[address]", ArgsUsage: "[address]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
@ -196,8 +196,8 @@ var walletExport = &cli.Command{
} }
var walletImport = &cli.Command{ var walletImport = &cli.Command{
Name: "import", Name: "import",
Usage: "import keys", Usage: "import keys",
ArgsUsage: "[<path> (optional, will read from stdin if omitted)]", ArgsUsage: "[<path> (optional, will read from stdin if omitted)]",
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)

View File

@ -179,8 +179,8 @@ func main() {
} }
sbfs := &fs.Basic{ sbfs := &fs.Basic{
Miner: maddr, Miner: maddr,
Root: sbdir, Root: sbdir,
} }
sb, err := sectorbuilder.New(sbfs, cfg) sb, err := sectorbuilder.New(sbfs, cfg)

View File

@ -55,8 +55,8 @@ func PreSeal(maddr address.Address, pt abi.RegisteredProof, offset abi.SectorNum
next := offset next := offset
sbfs := &fs.Basic{ sbfs := &fs.Basic{
Miner: maddr, Miner: maddr,
Root: sbroot, Root: sbroot,
} }
sb, err := sectorbuilder.New(sbfs, cfg) sb, err := sectorbuilder.New(sbfs, cfg)

1
go.mod
View File

@ -85,7 +85,6 @@ require (
github.com/multiformats/go-multiaddr-dns v0.2.0 github.com/multiformats/go-multiaddr-dns v0.2.0
github.com/multiformats/go-multiaddr-net v0.1.2 github.com/multiformats/go-multiaddr-net v0.1.2
github.com/multiformats/go-multihash v0.0.13 github.com/multiformats/go-multihash v0.0.13
github.com/multiformats/go-varint v0.0.5
github.com/opentracing/opentracing-go v1.1.0 github.com/opentracing/opentracing-go v1.1.0
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
github.com/prometheus/common v0.4.0 github.com/prometheus/common v0.4.0