Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleans up a few command line descriptions #3493

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions docs/content/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ paths:
schema:
type: boolean
- name: count
description: >
only available for --appearances mode, if present, return only the number of records
description: for --appearances mode only, display only the count of records
required: false
style: form
in: query
Expand Down Expand Up @@ -1092,7 +1091,7 @@ paths:
type: number
format: uint64
- name: count
description: display the number of the lists of appearances for --addrs or --uniq
description: display only the count of appearances for --addrs or --uniq
required: false
style: form
in: query
Expand Down Expand Up @@ -1446,7 +1445,7 @@ paths:
schema:
type: string
- name: count
description: show the number of traces for the transaction only (fast)
description: display only the number of traces for the transaction (fast)
required: false
style: form
in: query
Expand Down Expand Up @@ -2346,6 +2345,25 @@ paths:
explode: true
schema:
type: boolean
- name: source
description: the source of the slurped data
required: false
style: form
in: query
explode: true
schema:
type: string
enum:
- etherscan
- key
- name: count
description: for --appearances mode only, display only the count of records
required: false
style: form
in: query
explode: true
schema:
type: boolean
- name: perPage
description: the number of records to request on each page
required: false
Expand Down
2 changes: 1 addition & 1 deletion docs/content/chifra/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Flags:
-i, --withdrawals export withdrawals for the given address
-a, --articulate articulate transactions, traces, logs, and outputs
-R, --cache_traces force the transaction's traces into the cache
-U, --count only available for --appearances mode, if present, return only the number of records
-U, --count for --appearances mode only, display only the count of records
-c, --first_record uint the first record to process
-e, --max_records uint the maximum number of records to process (default 250)
-N, --relevant for log and accounting export only, export only logs relevant to one of the given export addresses
Expand Down
4 changes: 2 additions & 2 deletions docs/content/chifra/chaindata.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Flags:
-i, --withdrawals export the withdrawals from the block as opposed to the block data
-a, --articulate for the --logs option only, articulate the retrieved data if ABIs can be found
-r, --big_range uint for the --logs option only, allow for block ranges larger than 500 (default 500)
-U, --count display the number of the lists of appearances for --addrs or --uniq
-U, --count display only the count of appearances for --addrs or --uniq
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
-o, --cache force the results of the query into the cache
Expand Down Expand Up @@ -274,7 +274,7 @@ Arguments:
Flags:
-a, --articulate articulate the retrieved data if ABIs can be found
-f, --filter string call the node's trace_filter routine with bang-separated filter
-U, --count show the number of traces for the transaction only (fast)
-U, --count display only the number of traces for the transaction (fast)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
-o, --cache force the results of the query into the cache
Expand Down
4 changes: 4 additions & 0 deletions docs/content/chifra/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ Flags:
One or more of [ ext | int | token | nfts | 1155 | miner | uncles | withdrawals | all ]
-p, --appearances show only the blocknumber.tx_id appearances of the exported transactions
-a, --articulate articulate the retrieved data if ABIs can be found
-S, --source string the source of the slurped data
One of [ etherscan | key ]
-U, --count for --appearances mode only, display only the count of records
-P, --per_page uint the number of records to request on each page (default 5000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
Expand All @@ -100,6 +103,7 @@ Notes:
- An address must be either an ENS name or start with '0x' and be forty-two characters long.
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
```

Data models produced by this tool:
Expand Down
2 changes: 1 addition & 1 deletion docs/readmes/accounts-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Flags:
-i, --withdrawals export withdrawals for the given address
-a, --articulate articulate transactions, traces, logs, and outputs
-R, --cache_traces force the transaction's traces into the cache
-U, --count only available for --appearances mode, if present, return only the number of records
-U, --count for --appearances mode only, display only the count of records
-c, --first_record uint the first record to process
-e, --max_records uint the maximum number of records to process (default 250)
-N, --relevant for log and accounting export only, export only logs relevant to one of the given export addresses
Expand Down
2 changes: 1 addition & 1 deletion docs/readmes/chaindata-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Flags:
-i, --withdrawals export the withdrawals from the block as opposed to the block data
-a, --articulate for the --logs option only, articulate the retrieved data if ABIs can be found
-r, --big_range uint for the --logs option only, allow for block ranges larger than 500 (default 500)
-U, --count display the number of the lists of appearances for --addrs or --uniq
-U, --count display only the count of appearances for --addrs or --uniq
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
-o, --cache force the results of the query into the cache
Expand Down
2 changes: 1 addition & 1 deletion docs/readmes/chaindata-traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Arguments:
Flags:
-a, --articulate articulate the retrieved data if ABIs can be found
-f, --filter string call the node's trace_filter routine with bang-separated filter
-U, --count show the number of traces for the transaction only (fast)
-U, --count display only the number of traces for the transaction (fast)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
-o, --cache force the results of the query into the cache
Expand Down
4 changes: 4 additions & 0 deletions docs/readmes/other-slurp.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Flags:
One or more of [ ext | int | token | nfts | 1155 | miner | uncles | withdrawals | all ]
-p, --appearances show only the blocknumber.tx_id appearances of the exported transactions
-a, --articulate articulate the retrieved data if ABIs can be found
-S, --source string the source of the slurped data
One of [ etherscan | key ]
-U, --count for --appearances mode only, display only the count of records
-P, --per_page uint the number of records to request on each page (default 5000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
Expand All @@ -42,6 +45,7 @@ Notes:
- An address must be either an ENS name or start with '0x' and be forty-two characters long.
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
```

Data models produced by this tool:
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/src/_slurp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"types": {"hotkey": "-t", "type": "flag"},
"appearances": {"hotkey": "-p", "type": "switch"},
"articulate": {"hotkey": "-a", "type": "switch"},
"source": {"hotkey": "-S", "type": "flag"},
"count": {"hotkey": "-U", "type": "switch"},
"perPage": {"hotkey": "-P", "type": "flag"},
"sleep": {"hotkey": "-s", "type": "flag"},
"raw": {"hotkey": "-w", "type": "switch"},
Expand Down
2 changes: 2 additions & 0 deletions sdk/typescript/src/paths/slurp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export function getSlurp(
types?: string[],
appearances?: boolean,
articulate?: boolean,
source?: 'etherscan*' | 'key',
count?: boolean,
perPage?: uint64,
sleep?: double,
chain: string,
Expand Down
2 changes: 1 addition & 1 deletion src/apps/chifra/cmd/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ One of [ from | to | reward ]`)
blocksCmd.Flags().BoolVarP(&blocksPkg.GetOptions().Withdrawals, "withdrawals", "i", false, "export the withdrawals from the block as opposed to the block data")
blocksCmd.Flags().BoolVarP(&blocksPkg.GetOptions().Articulate, "articulate", "a", false, "for the --logs option only, articulate the retrieved data if ABIs can be found")
blocksCmd.Flags().Uint64VarP(&blocksPkg.GetOptions().BigRange, "big_range", "r", 500, "for the --logs option only, allow for block ranges larger than 500")
blocksCmd.Flags().BoolVarP(&blocksPkg.GetOptions().Count, "count", "U", false, "display the number of the lists of appearances for --addrs or --uniq")
blocksCmd.Flags().BoolVarP(&blocksPkg.GetOptions().Count, "count", "U", false, "display only the count of appearances for --addrs or --uniq")
blocksCmd.Flags().BoolVarP(&blocksPkg.GetOptions().CacheTxs, "cache_txs", "", false, "force a write of the block's transactions to the cache (slow) (hidden)")
blocksCmd.Flags().BoolVarP(&blocksPkg.GetOptions().CacheTraces, "cache_traces", "", false, "force a write of the block's traces to the cache (slower) (hidden)")
blocksCmd.Flags().Uint64VarP(&blocksPkg.GetOptions().List, "list", "L", 0, "summary list of blocks running backwards from latest block minus num (hidden)")
Expand Down
2 changes: 1 addition & 1 deletion src/apps/chifra/cmd/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func init() {
exportCmd.Flags().BoolVarP(&exportPkg.GetOptions().Withdrawals, "withdrawals", "i", false, "export withdrawals for the given address")
exportCmd.Flags().BoolVarP(&exportPkg.GetOptions().Articulate, "articulate", "a", false, "articulate transactions, traces, logs, and outputs")
exportCmd.Flags().BoolVarP(&exportPkg.GetOptions().CacheTraces, "cache_traces", "R", false, "force the transaction's traces into the cache")
exportCmd.Flags().BoolVarP(&exportPkg.GetOptions().Count, "count", "U", false, "only available for --appearances mode, if present, return only the number of records")
exportCmd.Flags().BoolVarP(&exportPkg.GetOptions().Count, "count", "U", false, "for --appearances mode only, display only the count of records")
exportCmd.Flags().Uint64VarP(&exportPkg.GetOptions().FirstRecord, "first_record", "c", 0, "the first record to process")
exportCmd.Flags().Uint64VarP(&exportPkg.GetOptions().MaxRecords, "max_records", "e", 250, "the maximum number of records to process")
exportCmd.Flags().BoolVarP(&exportPkg.GetOptions().Relevant, "relevant", "N", false, "for log and accounting export only, export only logs relevant to one of the given export addresses")
Expand Down
6 changes: 5 additions & 1 deletion src/apps/chifra/cmd/slurp.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ const notesSlurp = `
Notes:
- An address must be either an ENS name or start with '0x' and be forty-two characters long.
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.`
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.`

func init() {
var capabilities = caps.Default // Additional global caps for chifra slurp
Expand All @@ -67,6 +68,9 @@ func init() {
One or more of [ ext | int | token | nfts | 1155 | miner | uncles | withdrawals | all ]`)
slurpCmd.Flags().BoolVarP(&slurpPkg.GetOptions().Appearances, "appearances", "p", false, "show only the blocknumber.tx_id appearances of the exported transactions")
slurpCmd.Flags().BoolVarP(&slurpPkg.GetOptions().Articulate, "articulate", "a", false, "articulate the retrieved data if ABIs can be found")
slurpCmd.Flags().StringVarP(&slurpPkg.GetOptions().Source, "source", "S", "", `the source of the slurped data
One of [ etherscan | key ]`)
slurpCmd.Flags().BoolVarP(&slurpPkg.GetOptions().Count, "count", "U", false, "for --appearances mode only, display only the count of records")
slurpCmd.Flags().Uint64VarP(&slurpPkg.GetOptions().PerPage, "per_page", "P", 5000, "the number of records to request on each page")
slurpCmd.Flags().Float64VarP(&slurpPkg.GetOptions().Sleep, "sleep", "s", .25, "seconds to sleep between requests")
globals.InitGlobals("slurp", slurpCmd, &slurpPkg.GetOptions().Globals, capabilities)
Expand Down
2 changes: 1 addition & 1 deletion src/apps/chifra/cmd/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func init() {

tracesCmd.Flags().BoolVarP(&tracesPkg.GetOptions().Articulate, "articulate", "a", false, "articulate the retrieved data if ABIs can be found")
tracesCmd.Flags().StringVarP(&tracesPkg.GetOptions().Filter, "filter", "f", "", "call the node's trace_filter routine with bang-separated filter")
tracesCmd.Flags().BoolVarP(&tracesPkg.GetOptions().Count, "count", "U", false, "show the number of traces for the transaction only (fast)")
tracesCmd.Flags().BoolVarP(&tracesPkg.GetOptions().Count, "count", "U", false, "display only the number of traces for the transaction (fast)")
globals.InitGlobals("traces", tracesCmd, &tracesPkg.GetOptions().Globals, capabilities)

tracesCmd.SetUsageTemplate(UsageWithNotes(notesTraces))
Expand Down
2 changes: 1 addition & 1 deletion src/apps/chifra/internal/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Flags:
-i, --withdrawals export the withdrawals from the block as opposed to the block data
-a, --articulate for the --logs option only, articulate the retrieved data if ABIs can be found
-r, --big_range uint for the --logs option only, allow for block ranges larger than 500 (default 500)
-U, --count display the number of the lists of appearances for --addrs or --uniq
-U, --count display only the count of appearances for --addrs or --uniq
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
-o, --cache force the results of the query into the cache
Expand Down
2 changes: 1 addition & 1 deletion src/apps/chifra/internal/blocks/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type BlocksOptions struct {
Withdrawals bool `json:"withdrawals,omitempty"` // Export the withdrawals from the block as opposed to the block data
Articulate bool `json:"articulate,omitempty"` // For the --logs option only, articulate the retrieved data if ABIs can be found
BigRange uint64 `json:"bigRange,omitempty"` // For the --logs option only, allow for block ranges larger than 500
Count bool `json:"count,omitempty"` // Display the number of the lists of appearances for --addrs or --uniq
Count bool `json:"count,omitempty"` // Display only the count of appearances for --addrs or --uniq
CacheTxs bool `json:"cacheTxs,omitempty"` // Force a write of the block's transactions to the cache (slow)
CacheTraces bool `json:"cacheTraces,omitempty"` // Force a write of the block's traces to the cache (slower)
List uint64 `json:"list,omitempty"` // Summary list of blocks running backwards from latest block minus num
Expand Down
2 changes: 1 addition & 1 deletion src/apps/chifra/internal/export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Flags:
-i, --withdrawals export withdrawals for the given address
-a, --articulate articulate transactions, traces, logs, and outputs
-R, --cache_traces force the transaction's traces into the cache
-U, --count only available for --appearances mode, if present, return only the number of records
-U, --count for --appearances mode only, display only the count of records
-c, --first_record uint the first record to process
-e, --max_records uint the maximum number of records to process (default 250)
-N, --relevant for log and accounting export only, export only logs relevant to one of the given export addresses
Expand Down
2 changes: 1 addition & 1 deletion src/apps/chifra/internal/export/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type ExportOptions struct {
Withdrawals bool `json:"withdrawals,omitempty"` // Export withdrawals for the given address
Articulate bool `json:"articulate,omitempty"` // Articulate transactions, traces, logs, and outputs
CacheTraces bool `json:"cacheTraces,omitempty"` // Force the transaction's traces into the cache
Count bool `json:"count,omitempty"` // Only available for --appearances mode, if present, return only the number of records
Count bool `json:"count,omitempty"` // For --appearances mode only, display only the count of records
FirstRecord uint64 `json:"firstRecord,omitempty"` // The first record to process
MaxRecords uint64 `json:"maxRecords,omitempty"` // The maximum number of records to process
Relevant bool `json:"relevant,omitempty"` // For log and accounting export only, export only logs relevant to one of the given export addresses
Expand Down
4 changes: 4 additions & 0 deletions src/apps/chifra/internal/slurp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Flags:
One or more of [ ext | int | token | nfts | 1155 | miner | uncles | withdrawals | all ]
-p, --appearances show only the blocknumber.tx_id appearances of the exported transactions
-a, --articulate articulate the retrieved data if ABIs can be found
-S, --source string the source of the slurped data
One of [ etherscan | key ]
-U, --count for --appearances mode only, display only the count of records
-P, --per_page uint the number of records to request on each page (default 5000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
Expand All @@ -42,6 +45,7 @@ Notes:
- An address must be either an ENS name or start with '0x' and be forty-two characters long.
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
```

Data models produced by this tool:
Expand Down
8 changes: 8 additions & 0 deletions src/apps/chifra/internal/slurp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type SlurpOptions struct {
Types []string `json:"types,omitempty"` // Which types of transactions to request
Appearances bool `json:"appearances,omitempty"` // Show only the blocknumber.tx_id appearances of the exported transactions
Articulate bool `json:"articulate,omitempty"` // Articulate the retrieved data if ABIs can be found
Source string `json:"source,omitempty"` // The source of the slurped data
Count bool `json:"count,omitempty"` // For --appearances mode only, display only the count of records
PerPage uint64 `json:"perPage,omitempty"` // The number of records to request on each page
Sleep float64 `json:"sleep,omitempty"` // Seconds to sleep between requests
Globals globals.GlobalOptions `json:"globals,omitempty"` // The global options
Expand All @@ -49,6 +51,8 @@ func (opts *SlurpOptions) testLog() {
logger.TestLog(len(opts.Types) > 0, "Types: ", opts.Types)
logger.TestLog(opts.Appearances, "Appearances: ", opts.Appearances)
logger.TestLog(opts.Articulate, "Articulate: ", opts.Articulate)
logger.TestLog(len(opts.Source) > 0, "Source: ", opts.Source)
logger.TestLog(opts.Count, "Count: ", opts.Count)
logger.TestLog(opts.PerPage != 5000, "PerPage: ", opts.PerPage)
logger.TestLog(opts.Sleep != float64(.25), "Sleep: ", opts.Sleep)
opts.Conn.TestLog(opts.getCaches())
Expand Down Expand Up @@ -88,6 +92,10 @@ func slurpFinishParseApi(w http.ResponseWriter, r *http.Request) *SlurpOptions {
opts.Appearances = true
case "articulate":
opts.Articulate = true
case "source":
opts.Source = value[0]
case "count":
opts.Count = true
case "perPage":
opts.PerPage = globals.ToUint64(value[0])
case "sleep":
Expand Down
Loading
Loading