Documentation ¶
Overview ¶
namesPkg implements the chifra names command.
chifra names is a surprisingly useful tool. It allows one to associate textual names with Ethereum addresses. One may ask why this is necessary given that ENS exists. The answer is a single word: "privacy". ENS names are public. In many cases, users desire to keep personal addresses private. Try to do this on a website.
Like chifra abis, this tool is useful from the command line but is primarily used in support of other tools, especially chifra export where naming addresses becomes the single best way to turn unintelligible blockchain data into understandable information.
The various options allow you to search and filter the results. The tags option is used primarily by the TrueBlocks explorer.
You may use the TrueBlocks explorer to manage (add, edit, delete) address-name associations.
Index ¶
- func ResetOptions(testMode bool)
- func RunNames(cmd *cobra.Command, args []string) error
- func ServeNames(w http.ResponseWriter, r *http.Request) error
- type NamesOptions
- func (opts *NamesOptions) HandleAutoname(rCtx *output.RenderCtx) error
- func (opts *NamesOptions) HandleClean(rCtx *output.RenderCtx) error
- func (opts *NamesOptions) HandleCrud(rCtx *output.RenderCtx) (err error)
- func (opts *NamesOptions) HandleShow(rCtx *output.RenderCtx) error
- func (opts *NamesOptions) HandleTags(rCtx *output.RenderCtx) error
- func (opts *NamesOptions) LoadCrudDataIfNeeded(request *http.Request) error
- func (opts *NamesOptions) NamesInternal(rCtx *output.RenderCtx) error
- func (opts *NamesOptions) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResetOptions ¶
func ResetOptions(testMode bool)
func RunNames ¶
RunNames handles the names command for the command line. Returns error only as per cobra.
func ServeNames ¶
func ServeNames(w http.ResponseWriter, r *http.Request) error
ServeNames handles the names command for the API. Returns an error.
Types ¶
type NamesOptions ¶
type NamesOptions struct { Terms []string `json:"terms,omitempty"` // A space separated list of one or more search terms Expand bool `json:"expand,omitempty"` // Expand search to include all fields (search name, address, and symbol otherwise) MatchCase bool `json:"matchCase,omitempty"` // Do case-sensitive search All bool `json:"all,omitempty"` // Include all (including custom) names in the search Custom bool `json:"custom,omitempty"` // Include only custom named accounts in the search Prefund bool `json:"prefund,omitempty"` // Include prefund accounts in the search Addr bool `json:"addr,omitempty"` // Display only addresses in the results (useful for scripting, assumes --no_header) Tags bool `json:"tags,omitempty"` // Export the list of tags and subtags only Clean bool `json:"clean,omitempty"` // Clean the data (addrs to lower case, sort by addr) Regular bool `json:"regular,omitempty"` // Only available with --clean, cleans regular names database DryRun bool `json:"dryRun,omitempty"` // Only available with --clean or --autoname, outputs changes to stdout instead of updating databases Autoname string `json:"autoname,omitempty"` // An address assumed to be a token, added automatically to names database if true Create bool `json:"create,omitempty"` // Create a new name record Update bool `json:"update,omitempty"` // Edit an existing name Delete bool `json:"delete,omitempty"` // Delete a name, but do not remove it Undelete bool `json:"undelete,omitempty"` // Undelete a previously deleted name Remove bool `json:"remove,omitempty"` // Remove a previously deleted name Globals globals.GlobalOptions `json:"globals,omitempty"` // The global options Conn *rpc.Connection `json:"conn,omitempty"` // The connection to the RPC server BadFlag error `json:"badFlag,omitempty"` // An error flag if needed AutonameAddr base.Address `json:"-"` OrigTerms []string `json:"-"` // contains filtered or unexported fields }
NamesOptions provides all command options for the chifra names command.
func GetNamesOptions ¶
func GetNamesOptions(args []string, g *globals.GlobalOptions) *NamesOptions
GetNamesOptions returns the options for this tool so other tools may use it.
func GetOptions ¶
func GetOptions() *NamesOptions
func NamesFinishParseInternal ¶
func NamesFinishParseInternal(w io.Writer, values url.Values) *NamesOptions
func (*NamesOptions) HandleAutoname ¶
func (opts *NamesOptions) HandleAutoname(rCtx *output.RenderCtx) error
func (*NamesOptions) HandleClean ¶
func (opts *NamesOptions) HandleClean(rCtx *output.RenderCtx) error
func (*NamesOptions) HandleCrud ¶
func (opts *NamesOptions) HandleCrud(rCtx *output.RenderCtx) (err error)
func (*NamesOptions) HandleShow ¶
func (opts *NamesOptions) HandleShow(rCtx *output.RenderCtx) error
func (*NamesOptions) HandleTags ¶
func (opts *NamesOptions) HandleTags(rCtx *output.RenderCtx) error
func (*NamesOptions) LoadCrudDataIfNeeded ¶
func (opts *NamesOptions) LoadCrudDataIfNeeded(request *http.Request) error
func (*NamesOptions) NamesInternal ¶
func (opts *NamesOptions) NamesInternal(rCtx *output.RenderCtx) error
NamesInternal handles the internal workings of the names command. Returns an error.
func (*NamesOptions) String ¶
func (opts *NamesOptions) String() string
String implements the Stringer interface