Skip to content

Commit

Permalink
Merge pull request #5864 from filecoin-project/frrist/export-cli-comm…
Browse files Browse the repository at this point in the history
…ands

Export developer and network commands for consumption by derivatives of Lotus
  • Loading branch information
magik6k authored Mar 24, 2021
2 parents a227039 + bcf7aab commit a2e8731
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 146 deletions.
10 changes: 5 additions & 5 deletions cli/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import (
"github.com/filecoin-project/lotus/node/repo"
)

var authCmd = &cli.Command{
var AuthCmd = &cli.Command{
Name: "auth",
Usage: "Manage RPC permissions",
Subcommands: []*cli.Command{
authCreateAdminToken,
authApiInfoToken,
AuthCreateAdminToken,
AuthApiInfoToken,
},
}

var authCreateAdminToken = &cli.Command{
var AuthCreateAdminToken = &cli.Command{
Name: "create-token",
Usage: "Create token",
Flags: []cli.Flag{
Expand Down Expand Up @@ -70,7 +70,7 @@ var authCreateAdminToken = &cli.Command{
},
}

var authApiInfoToken = &cli.Command{
var AuthApiInfoToken = &cli.Command{
Name: "api-info",
Usage: "Get token with API info required to connect to this node",
Flags: []cli.Flag{
Expand Down
68 changes: 34 additions & 34 deletions cli/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,31 @@ import (
types "github.com/filecoin-project/lotus/chain/types"
)

var chainCmd = &cli.Command{
var ChainCmd = &cli.Command{
Name: "chain",
Usage: "Interact with filecoin blockchain",
Subcommands: []*cli.Command{
chainHeadCmd,
chainGetBlock,
chainReadObjCmd,
chainDeleteObjCmd,
chainStatObjCmd,
chainGetMsgCmd,
chainSetHeadCmd,
chainListCmd,
chainGetCmd,
chainBisectCmd,
chainExportCmd,
slashConsensusFault,
chainGasPriceCmd,
chainInspectUsage,
chainDecodeCmd,
chainEncodeCmd,
chainDisputeSetCmd,
ChainHeadCmd,
ChainGetBlock,
ChainReadObjCmd,
ChainDeleteObjCmd,
ChainStatObjCmd,
ChainGetMsgCmd,
ChainSetHeadCmd,
ChainListCmd,
ChainGetCmd,
ChainBisectCmd,
ChainExportCmd,
SlashConsensusFault,
ChainGasPriceCmd,
ChainInspectUsage,
ChainDecodeCmd,
ChainEncodeCmd,
ChainDisputeSetCmd,
},
}

var chainHeadCmd = &cli.Command{
var ChainHeadCmd = &cli.Command{
Name: "head",
Usage: "Print chain head",
Action: func(cctx *cli.Context) error {
Expand All @@ -85,7 +85,7 @@ var chainHeadCmd = &cli.Command{
},
}

var chainGetBlock = &cli.Command{
var ChainGetBlock = &cli.Command{
Name: "getblock",
Usage: "Get a block and print its details",
ArgsUsage: "[blockCid]",
Expand Down Expand Up @@ -176,7 +176,7 @@ func apiMsgCids(in []lapi.Message) []cid.Cid {
return out
}

var chainReadObjCmd = &cli.Command{
var ChainReadObjCmd = &cli.Command{
Name: "read-obj",
Usage: "Read the raw bytes of an object",
ArgsUsage: "[objectCid]",
Expand All @@ -203,7 +203,7 @@ var chainReadObjCmd = &cli.Command{
},
}

var chainDeleteObjCmd = &cli.Command{
var ChainDeleteObjCmd = &cli.Command{
Name: "delete-obj",
Usage: "Delete an object from the chain blockstore",
Description: "WARNING: Removing wrong objects from the chain blockstore may lead to sync issues",
Expand Down Expand Up @@ -240,7 +240,7 @@ var chainDeleteObjCmd = &cli.Command{
},
}

var chainStatObjCmd = &cli.Command{
var ChainStatObjCmd = &cli.Command{
Name: "stat-obj",
Usage: "Collect size and ipld link counts for objs",
ArgsUsage: "[cid]",
Expand Down Expand Up @@ -287,7 +287,7 @@ var chainStatObjCmd = &cli.Command{
},
}

var chainGetMsgCmd = &cli.Command{
var ChainGetMsgCmd = &cli.Command{
Name: "getmessage",
Usage: "Get and print a message by its cid",
ArgsUsage: "[messageCid]",
Expand Down Expand Up @@ -335,7 +335,7 @@ var chainGetMsgCmd = &cli.Command{
},
}

var chainSetHeadCmd = &cli.Command{
var ChainSetHeadCmd = &cli.Command{
Name: "sethead",
Usage: "manually set the local nodes head tipset (Caution: normally only used for recovery)",
ArgsUsage: "[tipsetkey]",
Expand Down Expand Up @@ -384,7 +384,7 @@ var chainSetHeadCmd = &cli.Command{
},
}

var chainInspectUsage = &cli.Command{
var ChainInspectUsage = &cli.Command{
Name: "inspect-usage",
Usage: "Inspect block space usage of a given tipset",
Flags: []cli.Flag{
Expand Down Expand Up @@ -529,7 +529,7 @@ var chainInspectUsage = &cli.Command{
},
}

var chainListCmd = &cli.Command{
var ChainListCmd = &cli.Command{
Name: "list",
Aliases: []string{"love"},
Usage: "View a segment of the chain",
Expand Down Expand Up @@ -658,7 +658,7 @@ var chainListCmd = &cli.Command{
},
}

var chainGetCmd = &cli.Command{
var ChainGetCmd = &cli.Command{
Name: "get",
Usage: "Get chain DAG node by path",
ArgsUsage: "[path]",
Expand Down Expand Up @@ -905,7 +905,7 @@ func printTipSet(format string, ts *types.TipSet) {
fmt.Println(format)
}

var chainBisectCmd = &cli.Command{
var ChainBisectCmd = &cli.Command{
Name: "bisect",
Usage: "bisect chain for an event",
ArgsUsage: "[minHeight maxHeight path shellCommand <shellCommandArgs (if any)>]",
Expand Down Expand Up @@ -1028,7 +1028,7 @@ var chainBisectCmd = &cli.Command{
},
}

var chainExportCmd = &cli.Command{
var ChainExportCmd = &cli.Command{
Name: "export",
Usage: "export chain to a car file",
ArgsUsage: "[outputPath]",
Expand Down Expand Up @@ -1106,7 +1106,7 @@ var chainExportCmd = &cli.Command{
},
}

var slashConsensusFault = &cli.Command{
var SlashConsensusFault = &cli.Command{
Name: "slash-consensus",
Usage: "Report consensus fault",
ArgsUsage: "[blockCid1 blockCid2]",
Expand Down Expand Up @@ -1227,7 +1227,7 @@ var slashConsensusFault = &cli.Command{
},
}

var chainGasPriceCmd = &cli.Command{
var ChainGasPriceCmd = &cli.Command{
Name: "gas-price",
Usage: "Estimate gas prices",
Action: func(cctx *cli.Context) error {
Expand All @@ -1254,7 +1254,7 @@ var chainGasPriceCmd = &cli.Command{
},
}

var chainDecodeCmd = &cli.Command{
var ChainDecodeCmd = &cli.Command{
Name: "decode",
Usage: "decode various types",
Subcommands: []*cli.Command{
Expand Down Expand Up @@ -1334,7 +1334,7 @@ var chainDecodeParamsCmd = &cli.Command{
},
}

var chainEncodeCmd = &cli.Command{
var ChainEncodeCmd = &cli.Command{
Name: "encode",
Usage: "encode various types",
Subcommands: []*cli.Command{
Expand Down
32 changes: 16 additions & 16 deletions cli/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ var GetStorageMinerAPI = cliutil.GetStorageMinerAPI
var GetWorkerAPI = cliutil.GetWorkerAPI

var CommonCommands = []*cli.Command{
netCmd,
authCmd,
logCmd,
waitApiCmd,
fetchParamCmd,
pprofCmd,
NetCmd,
AuthCmd,
LogCmd,
WaitApiCmd,
FetchParamCmd,
PprofCmd,
VersionCmd,
}

Expand All @@ -71,16 +71,16 @@ var Commands = []*cli.Command{
WithCategory("basic", clientCmd),
WithCategory("basic", multisigCmd),
WithCategory("basic", paychCmd),
WithCategory("developer", authCmd),
WithCategory("developer", mpoolCmd),
WithCategory("developer", stateCmd),
WithCategory("developer", chainCmd),
WithCategory("developer", logCmd),
WithCategory("developer", waitApiCmd),
WithCategory("developer", fetchParamCmd),
WithCategory("network", netCmd),
WithCategory("network", syncCmd),
pprofCmd,
WithCategory("developer", AuthCmd),
WithCategory("developer", MpoolCmd),
WithCategory("developer", StateCmd),
WithCategory("developer", ChainCmd),
WithCategory("developer", LogCmd),
WithCategory("developer", WaitApiCmd),
WithCategory("developer", FetchParamCmd),
WithCategory("network", NetCmd),
WithCategory("network", SyncCmd),
PprofCmd,
VersionCmd,
}

Expand Down
2 changes: 1 addition & 1 deletion cli/disputer.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type minerDeadline struct {
index uint64
}

var chainDisputeSetCmd = &cli.Command{
var ChainDisputeSetCmd = &cli.Command{
Name: "disputer",
Usage: "interact with the window post disputer",
Flags: []cli.Flag{
Expand Down
10 changes: 5 additions & 5 deletions cli/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import (
"golang.org/x/xerrors"
)

var logCmd = &cli.Command{
var LogCmd = &cli.Command{
Name: "log",
Usage: "Manage logging",
Subcommands: []*cli.Command{
logList,
logSetLevel,
LogList,
LogSetLevel,
},
}

var logList = &cli.Command{
var LogList = &cli.Command{
Name: "list",
Usage: "List log systems",
Action: func(cctx *cli.Context) error {
Expand All @@ -41,7 +41,7 @@ var logList = &cli.Command{
},
}

var logSetLevel = &cli.Command{
var LogSetLevel = &cli.Command{
Name: "set-level",
Usage: "Set log level",
ArgsUsage: "[level]",
Expand Down
34 changes: 17 additions & 17 deletions cli/mpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ import (
"github.com/filecoin-project/lotus/node/config"
)

var mpoolCmd = &cli.Command{
var MpoolCmd = &cli.Command{
Name: "mpool",
Usage: "Manage message pool",
Subcommands: []*cli.Command{
mpoolPending,
mpoolClear,
mpoolSub,
mpoolStat,
mpoolReplaceCmd,
mpoolFindCmd,
mpoolConfig,
mpoolGasPerfCmd,
MpoolPending,
MpoolClear,
MpoolSub,
MpoolStat,
MpoolReplaceCmd,
MpoolFindCmd,
MpoolConfig,
MpoolGasPerfCmd,
},
}

var mpoolPending = &cli.Command{
var MpoolPending = &cli.Command{
Name: "pending",
Usage: "Get pending messages",
Flags: []cli.Flag{
Expand Down Expand Up @@ -132,7 +132,7 @@ var mpoolPending = &cli.Command{
},
}

var mpoolClear = &cli.Command{
var MpoolClear = &cli.Command{
Name: "clear",
Usage: "Clear all pending messages from the mpool (USE WITH CARE)",
Flags: []cli.Flag{
Expand Down Expand Up @@ -165,7 +165,7 @@ var mpoolClear = &cli.Command{
},
}

var mpoolSub = &cli.Command{
var MpoolSub = &cli.Command{
Name: "sub",
Usage: "Subscribe to mpool changes",
Action: func(cctx *cli.Context) error {
Expand Down Expand Up @@ -197,7 +197,7 @@ var mpoolSub = &cli.Command{
},
}

var mpoolStat = &cli.Command{
var MpoolStat = &cli.Command{
Name: "stat",
Usage: "print mempool stats",
Flags: []cli.Flag{
Expand Down Expand Up @@ -356,7 +356,7 @@ var mpoolStat = &cli.Command{
},
}

var mpoolReplaceCmd = &cli.Command{
var MpoolReplaceCmd = &cli.Command{
Name: "replace",
Usage: "replace a message in the mempool",
Flags: []cli.Flag{
Expand Down Expand Up @@ -509,7 +509,7 @@ var mpoolReplaceCmd = &cli.Command{
},
}

var mpoolFindCmd = &cli.Command{
var MpoolFindCmd = &cli.Command{
Name: "find",
Usage: "find a message in the mempool",
Flags: []cli.Flag{
Expand Down Expand Up @@ -592,7 +592,7 @@ var mpoolFindCmd = &cli.Command{
},
}

var mpoolConfig = &cli.Command{
var MpoolConfig = &cli.Command{
Name: "config",
Usage: "get or set current mpool configuration",
ArgsUsage: "[new-config]",
Expand Down Expand Up @@ -637,7 +637,7 @@ var mpoolConfig = &cli.Command{
},
}

var mpoolGasPerfCmd = &cli.Command{
var MpoolGasPerfCmd = &cli.Command{
Name: "gas-perf",
Usage: "Check gas performance of messages in mempool",
Flags: []cli.Flag{
Expand Down
Loading

0 comments on commit a2e8731

Please sign in to comment.