{"modulePath":"github.com/chainopen/matrixchaincode","version":"v0.0.0-20190924071332-ddf2b42e220f","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\nPackage utils contains internal helper functions for go-matrix commands.\n\nPackage utils contains internal helper functions for go-matrix commands.\n\n## Constants\n\n```go\nconst (\n\tOnce = iota\n\tTwice\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// General settings\n\tDataDirFlag = DirectoryFlag{\n\t\tName:  \"datadir\",\n\t\tUsage: \"Data directory for the databases and keystore\",\n\t\tValue: DirectoryString{pod.DefaultDataDir()},\n\t}\n\tKeyStoreDirFlag = DirectoryFlag{\n\t\tName:  \"keystore\",\n\t\tUsage: \"Directory for the keystore (default = inside the datadir)\",\n\t}\n\tNoUSBFlag = cli.BoolFlag{\n\t\tName:  \"nousb\",\n\t\tUsage: \"Disables monitoring for and managing USB hardware wallets\",\n\t}\n\tNetworkIdFlag = cli.Uint64Flag{\n\t\tName:  \"networkid\",\n\t\tUsage: \"Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)\",\n\t\tValue: man.DefaultConfig.NetworkId,\n\t}\n\tTestnetFlag = cli.BoolFlag{\n\t\tName:  \"testnet\",\n\t\tUsage: \"Ropsten network: pre-configured proof-of-work test network\",\n\t}\n\tRinkebyFlag = cli.BoolFlag{\n\t\tName:  \"rinkeby\",\n\t\tUsage: \"Rinkeby network: pre-configured proof-of-authority test network\",\n\t}\n\tDeveloperFlag = cli.BoolFlag{\n\t\tName:  \"dev\",\n\t\tUsage: \"Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled\",\n\t}\n\tDeveloperPeriodFlag = cli.IntFlag{\n\t\tName:  \"dev.period\",\n\t\tUsage: \"Block period to use in developer mode (0 = mine only if transaction pending)\",\n\t}\n\tIdentityFlag = cli.StringFlag{\n\t\tName:  \"identity\",\n\t\tUsage: \"Custom node name\",\n\t}\n\tDocRootFlag = DirectoryFlag{\n\t\tName:  \"docroot\",\n\t\tUsage: \"Document Root for HTTPClient file scheme\",\n\t\tValue: DirectoryString{homeDir()},\n\t}\n\tFastSyncFlag = cli.BoolFlag{\n\t\tName:  \"fast\",\n\t\tUsage: \"Enable fast syncing through state downloads (replaced by --syncmode)\",\n\t}\n\tLightModeFlag = cli.BoolFlag{\n\t\tName:  \"light\",\n\t\tUsage: \"Enable light client mode (replaced by --syncmode)\",\n\t}\n\tGetGenesisFlag = cli.StringFlag{\n\t\tName:  \"getGenesis\",\n\t\tUsage: \"Output the actual configuration used\",\n\t}\n\n\tSyncModeFlag = TextMarshalerFlag{\n\t\tName:  \"syncmode\",\n\t\tUsage: `Blockchain sync mode (\"fast\", \"full\", or \"light\")`,\n\t\tValue: \u0026defaultSyncMode,\n\t}\n\tGCModeFlag = cli.StringFlag{\n\t\tName:  \"gcmode\",\n\t\tUsage: `Blockchain garbage collection mode (\"full\", \"archive\")`,\n\t\tValue: \"archive\",\n\t}\n\tDbTableSizeFlag = cli.IntFlag{\n\t\tName:  \"dbsize\",\n\t\tUsage: \"db store size \",\n\t\tValue: 2,\n\t}\n\tLightServFlag = cli.IntFlag{\n\t\tName:  \"lightserv\",\n\t\tUsage: \"Maximum percentage of time allowed for serving LES requests (0-90)\",\n\t\tValue: 0,\n\t}\n\tLightPeersFlag = cli.IntFlag{\n\t\tName:  \"lightpeers\",\n\t\tUsage: \"Maximum number of LES client peers\",\n\t\tValue: man.DefaultConfig.LightPeers,\n\t}\n\tLightKDFFlag = cli.BoolFlag{\n\t\tName:  \"lightkdf\",\n\t\tUsage: \"Reduce key-derivation RAM \u0026 CPU usage at some expense of KDF strength\",\n\t}\n\tAesInputFlag = cli.StringFlag{\n\t\tName:  \"aesin\",\n\t\tUsage: \"aes 输入\",\n\t}\n\tAesOutputFlag = cli.StringFlag{\n\t\tName:  \"aesout\",\n\t\tUsage: \"aes 输出\",\n\t}\n\t// Dashboard settings\n\tDashboardEnabledFlag = cli.BoolFlag{\n\t\tName:  \"dashboard\",\n\t\tUsage: \"Enable the dashboard\",\n\t}\n\tDashboardAddrFlag = cli.StringFlag{\n\t\tName:  \"dashboard.addr\",\n\t\tUsage: \"Dashboard listening interface\",\n\t\tValue: dashboard.DefaultConfig.Host,\n\t}\n\tDashboardPortFlag = cli.IntFlag{\n\t\tName:  \"dashboard.host\",\n\t\tUsage: \"Dashboard listening port\",\n\t\tValue: dashboard.DefaultConfig.Port,\n\t}\n\tDashboardRefreshFlag = cli.DurationFlag{\n\t\tName:  \"dashboard.refresh\",\n\t\tUsage: \"Dashboard metrics collection refresh rate\",\n\t\tValue: dashboard.DefaultConfig.Refresh,\n\t}\n\t// Manash settings\n\tManashCacheDirFlag = DirectoryFlag{\n\t\tName:  \"manash.cachedir\",\n\t\tUsage: \"Directory to store the manash verification caches (default = inside the datadir)\",\n\t}\n\tManashCachesInMemoryFlag = cli.IntFlag{\n\t\tName:  \"manash.cachesinmem\",\n\t\tUsage: \"Number of recent manash caches to keep in memory (16MB each)\",\n\t\tValue: man.DefaultConfig.Manash.CachesInMem,\n\t}\n\tManashCachesOnDiskFlag = cli.IntFlag{\n\t\tName:  \"manash.cachesondisk\",\n\t\tUsage: \"Number of recent manash caches to keep on disk (16MB each)\",\n\t\tValue: man.DefaultConfig.Manash.CachesOnDisk,\n\t}\n\tManashDatasetDirFlag = DirectoryFlag{\n\t\tName:  \"manash.dagdir\",\n\t\tUsage: \"Directory to store the manash mining DAGs (default = inside home folder)\",\n\t\tValue: DirectoryString{man.DefaultConfig.Manash.DatasetDir},\n\t}\n\tManashDatasetsInMemoryFlag = cli.IntFlag{\n\t\tName:  \"manash.dagsinmem\",\n\t\tUsage: \"Number of recent manash mining DAGs to keep in memory (1+GB each)\",\n\t\tValue: man.DefaultConfig.Manash.DatasetsInMem,\n\t}\n\tManashDatasetsOnDiskFlag = cli.IntFlag{\n\t\tName:  \"manash.dagsondisk\",\n\t\tUsage: \"Number of recent manash mining DAGs to keep on disk (1+GB each)\",\n\t\tValue: man.DefaultConfig.Manash.DatasetsOnDisk,\n\t}\n\t// Transaction pool settings\n\tTxPoolNoLocalsFlag = cli.BoolFlag{\n\t\tName:  \"txpool.nolocals\",\n\t\tUsage: \"Disables price exemptions for locally submitted transactions\",\n\t}\n\t//TxPoolJournalFlag = cli.StringFlag{ //Y\n\t//\tName:  \"txpool.journal\",\n\t//\tUsage: \"Disk journal for local transaction to survive node restarts\",\n\t//\tValue: core.DefaultTxPoolConfig.Journal,\n\t//}\n\t//TxPoolRejournalFlag = cli.DurationFlag{\n\t//\tName:  \"txpool.rejournal\",\n\t//\tUsage: \"Time interval to regenerate the local transaction journal\",\n\t//\tValue: core.DefaultTxPoolConfig.Rejournal,\n\t//}\n\tTxPoolPriceLimitFlag = cli.Uint64Flag{\n\t\tName:  \"txpool.pricelimit\",\n\t\tUsage: \"Minimum gas price limit to enforce for acceptance into the pool\",\n\t\tValue: man.DefaultConfig.TxPool.PriceLimit,\n\t}\n\t//TxPoolPriceBumpFlag = cli.Uint64Flag{ //Y\n\t//\tName:  \"txpool.pricebump\",\n\t//\tUsage: \"Price bump percentage to replace an already existing transaction\",\n\t//\tValue: eth.DefaultConfig.TxPool.PriceBump,\n\t//}\n\tTxPoolAccountSlotsFlag = cli.Uint64Flag{\n\t\tName:  \"txpool.accountslots\",\n\t\tUsage: \"Minimum number of executable transaction slots guaranteed per account\",\n\t\tValue: man.DefaultConfig.TxPool.AccountSlots,\n\t}\n\tTxPoolGlobalSlotsFlag = cli.Uint64Flag{\n\t\tName:  \"txpool.globalslots\",\n\t\tUsage: \"Maximum number of executable transaction slots for all accounts\",\n\t\tValue: man.DefaultConfig.TxPool.GlobalSlots,\n\t}\n\tTxPoolAccountQueueFlag = cli.Uint64Flag{\n\t\tName:  \"txpool.accountqueue\",\n\t\tUsage: \"Maximum number of non-executable transaction slots permitted per account\",\n\t\tValue: man.DefaultConfig.TxPool.AccountQueue,\n\t}\n\tTxPoolGlobalQueueFlag = cli.Uint64Flag{\n\t\tName:  \"txpool.globalqueue\",\n\t\tUsage: \"Maximum number of non-executable transaction slots for all accounts\",\n\t\tValue: man.DefaultConfig.TxPool.GlobalQueue,\n\t}\n\t//TxPoolLifetimeFlag = cli.DurationFlag{ //Y\n\t//\tName:  \"txpool.lifetime\",\n\t//\tUsage: \"Maximum amount of time non-executable transaction are queued\",\n\t//\tValue: eth.DefaultConfig.TxPool.Lifetime,\n\t//}\n\t// Performance tuning settings\n\tCacheFlag = cli.IntFlag{\n\t\tName:  \"cache\",\n\t\tUsage: \"Megabytes of memory allocated to internal caching\",\n\t\tValue: 1024,\n\t}\n\tCacheDatabaseFlag = cli.IntFlag{\n\t\tName:  \"cache.database\",\n\t\tUsage: \"Percentage of cache memory allowance to use for database io\",\n\t\tValue: 75,\n\t}\n\tCacheGCFlag = cli.IntFlag{\n\t\tName:  \"cache.gc\",\n\t\tUsage: \"Percentage of cache memory allowance to use for trie pruning\",\n\t\tValue: 25,\n\t}\n\tTrieCacheGenFlag = cli.IntFlag{\n\t\tName:  \"trie-cache-gens\",\n\t\tUsage: \"Number of trie node generations to keep in memory\",\n\t\tValue: int(state.MaxTrieCacheGen),\n\t}\n\t// Miner settings\n\tMiningEnabledFlag = cli.BoolFlag{\n\t\tName:  \"mine\",\n\t\tUsage: \"Enable mining\",\n\t}\n\tMinerThreadsFlag = cli.IntFlag{\n\t\tName:  \"minerthreads\",\n\t\tUsage: \"Number of CPU threads to use for mining\",\n\t\tValue: runtime.NumCPU(),\n\t}\n\tTargetGasLimitFlag = cli.Uint64Flag{\n\t\tName:  \"targetgaslimit\",\n\t\tUsage: \"Target gas limit sets the artificial target gas floor for the blocks to mine\",\n\t\tValue: params.GenesisGasLimit,\n\t}\n\tManerbaseFlag = cli.StringFlag{\n\t\tName:  \"manbase\",\n\t\tUsage: \"Public address for block mining rewards (default = first account created)\",\n\t\tValue: \"0\",\n\t}\n\tGasPriceFlag = BigFlag{\n\t\tName:  \"gasprice\",\n\t\tUsage: \"Minimal gas price to accept for mining a transactions\",\n\t\tValue: man.DefaultConfig.GasPrice,\n\t}\n\tExtraDataFlag = cli.StringFlag{\n\t\tName:  \"extradata\",\n\t\tUsage: \"Block extra data set by the miner (default = client version)\",\n\t}\n\tTestLocalMiningFlag = cli.StringFlag{\n\t\tName:  \"testlocalmining\",\n\t\tUsage: \"print a string\",\n\t}\n\tSuperBlockElectGenFlag = cli.BoolFlag{\n\t\tName:  \"electflag\",\n\t\tUsage: \" super block elect gen\",\n\t}\n\tTestChangeRoleFlag = cli.StringFlag{\n\t\tName:  \"testchangerole\",\n\t\tUsage: \"change role\",\n\t}\n\tGetCommitFlag = cli.StringFlag{\n\t\tName:  \"testgetcommit\",\n\t\tUsage: \"get commit\",\n\t}\n\t// Account settings\n\tUnlockedAccountFlag = cli.StringFlag{\n\t\tName:  \"unlock\",\n\t\tUsage: \"Comma separated list of accounts to unlock\",\n\t\tValue: \"\",\n\t}\n\tPasswordFileFlag = cli.StringFlag{\n\t\tName:  \"password\",\n\t\tUsage: \"Password file to use for non-interactive password input\",\n\t\tValue: \"\",\n\t}\n\tManAddressFlag = cli.StringFlag{\n\t\tName:  \"manAddress\",\n\t\tUsage: \"deposit user signature account.\",\n\t\tValue: \"\",\n\t}\n\tAccountPasswordFileFlag = cli.StringFlag{\n\t\tName:  \"entrust\",\n\t\tUsage: \"Password file to entrustment transaction\",\n\t\tValue: \"\",\n\t}\n\tTestEntrustFlag = cli.StringFlag{\n\t\tName:  \"testmode\",\n\t\tUsage: \"\",\n\t\tValue: \"\",\n\t}\n\tVMEnableDebugFlag = cli.BoolFlag{\n\t\tName:  \"vmdebug\",\n\t\tUsage: \"Record information useful for VM and contract debugging\",\n\t}\n\t// Logging and debug settings\n\tManStatsURLFlag = cli.StringFlag{\n\t\tName:  \"manstats\",\n\t\tUsage: \"Reporting URL of a manstats service (nodename:secret@host:port)\",\n\t}\n\tMetricsEnabledFlag = cli.BoolFlag{\n\t\tName:  metrics.MetricsEnabledFlag,\n\t\tUsage: \"Enable metrics collection and reporting\",\n\t}\n\tFakePoWFlag = cli.BoolFlag{\n\t\tName:  \"fakepow\",\n\t\tUsage: \"Disables proof-of-work verification\",\n\t}\n\tNoCompactionFlag = cli.BoolFlag{\n\t\tName:  \"nocompaction\",\n\t\tUsage: \"Disables db compaction after import\",\n\t}\n\t// RPC settings\n\tRPCEnabledFlag = cli.BoolFlag{\n\t\tName:  \"rpc\",\n\t\tUsage: \"Enable the HTTP-RPC server\",\n\t}\n\tRPCListenAddrFlag = cli.StringFlag{\n\t\tName:  \"rpcaddr\",\n\t\tUsage: \"HTTP-RPC server listening interface\",\n\t\tValue: pod.DefaultHTTPHost,\n\t}\n\tRPCPortFlag = cli.IntFlag{\n\t\tName:  \"rpcport\",\n\t\tUsage: \"HTTP-RPC server listening port\",\n\t\tValue: pod.DefaultHTTPPort,\n\t}\n\tRPCCORSDomainFlag = cli.StringFlag{\n\t\tName:  \"rpccorsdomain\",\n\t\tUsage: \"Comma separated list of domains from which to accept cross origin requests (browser enforced)\",\n\t\tValue: \"\",\n\t}\n\tRPCVirtualHostsFlag = cli.StringFlag{\n\t\tName:  \"rpcvhosts\",\n\t\tUsage: \"Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.\",\n\t\tValue: strings.Join(pod.DefaultConfig.HTTPVirtualHosts, \",\"),\n\t}\n\tRPCApiFlag = cli.StringFlag{\n\t\tName:  \"rpcapi\",\n\t\tUsage: \"API's offered over the HTTP-RPC interface\",\n\t\tValue: \"\",\n\t}\n\tIPCDisabledFlag = cli.BoolFlag{\n\t\tName:  \"ipcdisable\",\n\t\tUsage: \"Disable the IPC-RPC server\",\n\t}\n\tIPCPathFlag = DirectoryFlag{\n\t\tName:  \"ipcpath\",\n\t\tUsage: \"Filename for IPC socket/pipe within the datadir (explicit paths escape it)\",\n\t}\n\tWSEnabledFlag = cli.BoolFlag{\n\t\tName:  \"ws\",\n\t\tUsage: \"Enable the WS-RPC server\",\n\t}\n\tWSListenAddrFlag = cli.StringFlag{\n\t\tName:  \"wsaddr\",\n\t\tUsage: \"WS-RPC server listening interface\",\n\t\tValue: pod.DefaultWSHost,\n\t}\n\tWSPortFlag = cli.IntFlag{\n\t\tName:  \"wsport\",\n\t\tUsage: \"WS-RPC server listening port\",\n\t\tValue: pod.DefaultWSPort,\n\t}\n\tWSApiFlag = cli.StringFlag{\n\t\tName:  \"wsapi\",\n\t\tUsage: \"API's offered over the WS-RPC interface\",\n\t\tValue: \"\",\n\t}\n\tWSAllowedOriginsFlag = cli.StringFlag{\n\t\tName:  \"wsorigins\",\n\t\tUsage: \"Origins from which to accept websockets requests\",\n\t\tValue: \"\",\n\t}\n\tExecFlag = cli.StringFlag{\n\t\tName:  \"exec\",\n\t\tUsage: \"Execute JavaScript statement\",\n\t}\n\tPreloadJSFlag = cli.StringFlag{\n\t\tName:  \"preload\",\n\t\tUsage: \"Comma separated list of JavaScript files to preload into the console\",\n\t}\n\n\t// Network Settings\n\tMaxPeersFlag = cli.IntFlag{\n\t\tName:  \"maxpeers\",\n\t\tUsage: \"Maximum number of network peers (network disabled if set to 0)\",\n\t\tValue: 25,\n\t}\n\tMaxPendingPeersFlag = cli.IntFlag{\n\t\tName:  \"maxpendpeers\",\n\t\tUsage: \"Maximum number of pending connection attempts (defaults used if set to 0)\",\n\t\tValue: 0,\n\t}\n\tListenPortFlag = cli.IntFlag{\n\t\tName:  \"port\",\n\t\tUsage: \"Network listening port\",\n\t\tValue: 50505,\n\t}\n\tBootnodesFlag = cli.StringFlag{\n\t\tName:  \"bootnodes\",\n\t\tUsage: \"Comma separated enode URLs for P2P discovery bootstrap (set v4+v5 instead for light servers)\",\n\t\tValue: \"\",\n\t}\n\tBootnodesV4Flag = cli.StringFlag{\n\t\tName:  \"bootnodesv4\",\n\t\tUsage: \"Comma separated enode URLs for P2P v4 discovery bootstrap (light server, full nodes)\",\n\t\tValue: \"\",\n\t}\n\tBootnodesV5Flag = cli.StringFlag{\n\t\tName:  \"bootnodesv5\",\n\t\tUsage: \"Comma separated enode URLs for P2P v5 discovery bootstrap (light server, light nodes)\",\n\t\tValue: \"\",\n\t}\n\tNodeKeyFileFlag = cli.StringFlag{\n\t\tName:  \"nodekey\",\n\t\tUsage: \"P2P node key file\",\n\t}\n\tNodeKeyHexFlag = cli.StringFlag{\n\t\tName:  \"nodekeyhex\",\n\t\tUsage: \"P2P node key as hex (for testing)\",\n\t}\n\tNATFlag = cli.StringFlag{\n\t\tName:  \"nat\",\n\t\tUsage: \"NAT port mapping mechanism (any|none|upnp|pmp|extip:\u003cIP\u003e)\",\n\t\tValue: \"any\",\n\t}\n\tNoDiscoverFlag = cli.BoolFlag{\n\t\tName:  \"nodiscover\",\n\t\tUsage: \"Disables the peer discovery mechanism (manual peer addition)\",\n\t}\n\tDiscoveryV5Flag = cli.BoolFlag{\n\t\tName:  \"v5disc\",\n\t\tUsage: \"Enables the experimental RLPx V5 (Topic Discovery) mechanism\",\n\t}\n\tNetrestrictFlag = cli.StringFlag{\n\t\tName:  \"netrestrict\",\n\t\tUsage: \"Restricts network communication to the given IP networks (CIDR masks)\",\n\t}\n\n\t// ATM the url is left to the user and deployment to\n\tJSpathFlag = cli.StringFlag{\n\t\tName:  \"jspath\",\n\t\tUsage: \"JavaScript root path for `loadScript`\",\n\t\tValue: \".\",\n\t}\n\n\t// Gas price oracle settings\n\tGpoBlocksFlag = cli.IntFlag{\n\t\tName:  \"gpoblocks\",\n\t\tUsage: \"Number of recent blocks to check for gas prices\",\n\t\tValue: man.DefaultConfig.GPO.Blocks,\n\t}\n\tGpoPercentileFlag = cli.IntFlag{\n\t\tName:  \"gpopercentile\",\n\t\tUsage: \"Suggested gas price is the given percentile of a set of recent transaction gas prices\",\n\t\tValue: man.DefaultConfig.GPO.Percentile,\n\t}\n\tSynSnapshootNumFlg = cli.Uint64Flag{\n\t\tName:  \"snapnumber\",\n\t\tUsage: \"snapshoot sync block number\",\n\t\tValue: man.SnapshootNumber,\n\t}\n\tSynSnapshootHashFlg = cli.StringFlag{\n\t\tName:  \"snaphash\",\n\t\tUsage: \"snapshoot sync block hash\",\n\t\tValue: man.SnapshootHash,\n\t}\n\tSnapModeFlg = cli.IntFlag{\n\t\tName:  \"snapFlag\",\n\t\tUsage: \"snapFlag 0:from broadcast, 1:local\",\n\t\tValue: man.SnaploadFromLocal,\n\t}\n\tSaveSnapStartFlg = cli.Uint64Flag{\n\t\tName:  \"snapstart\",\n\t\tUsage: \"snapshoot start switch\",\n\t\tValue: man.SaveSnapStart,\n\t}\n\tSaveSnapPeriodFlg = cli.Uint64Flag{\n\t\tName:  \"snapperiod\",\n\t\tUsage: \"snapshoot save period,default 300\",\n\t\tValue: man.SaveSnapPeriod,\n\t}\n\tLessDiskEnabledFlag = cli.BoolFlag{\n\t\tName:  \"lessdisk\",\n\t\tUsage: \"Enable the Less Disk Server\",\n\t}\n\tManualSaveSnapNum = cli.Uint64Flag{\n\t\tName:  \"manualsavesnapnum\",\n\t\tUsage: \"manual save snap number begin\",\n\t\tValue: man.SaveSnapStart,\n\t}\n\tAutoSnapStartFlag = cli.BoolFlag{\n\t\tName:  \"autosnap\",\n\t\tUsage: \"auto load snap and start matrix with it\",\n\t}\n\tSnapLoadFileName = cli.StringFlag{\n\t\tName:  \"loadsnapfile\",\n\t\tUsage: \"load snap withName and start matrix with it\",\n\t\tValue: man.SnapLoadFile,\n\t}\n)\n```\n\n```go\nvar (\n\tCommandHelpTemplate = `{{.cmd.Name}}{{if .cmd.Subcommands}} command{{end}}{{if .cmd.Flags}} [command options]{{end}} [arguments...]\n{{if .cmd.Description}}{{.cmd.Description}}\n{{end}}{{if .cmd.Subcommands}}\nSUBCOMMANDS:\n\t{{range .cmd.Subcommands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ \"\\t\" }}{{.Usage}}\n\t{{end}}{{end}}{{if .categorizedFlags}}\n{{range $idx, $categorized := .categorizedFlags}}{{$categorized.Name}} OPTIONS:\n{{range $categorized.Flags}}{{\"\\t\"}}{{.}}\n{{end}}\n{{end}}{{end}}`\n)\n```\n\n## Functions\n\n```go\nfunc CheckPassword(password string) bool\n```\n\n```go\nfunc ExportAppendChain(blockchain *core.BlockChain, fn string, first uint64, last uint64) error\n```\nExportAppendChain exports a blockchain into the specified file, appending to the file if data already exists in it.\n\n```go\nfunc ExportChain(blockchain *core.BlockChain, fn string) error\n```\nExportChain exports a blockchain into the specified file, truncating any data already present in the file.\n\n```go\nfunc ExportPreimages(db *mandb.LDBDatabase, fn string) error\n```\nExportPreimages exports all known hash preimages into the specified file, truncating any data already present in the file.\n\n```go\nfunc Fatalf(format string, args ...interface{})\n```\nFatalf formats a message to standard error and exits the program. The message is also printed to standard output if standard error is redirected to a different file.\n\n```go\nfunc GetPassword(inputTimes int) (string, error)\n```\n\n```go\nfunc GetSignPassword(ctx *cli.Context) ([]string, error)\n```\nGetSignPassword returns password specified by the global --testmode flag.\n\n```go\nfunc GlobalBig(ctx *cli.Context, name string) *big.Int\n```\nGlobalBig returns the value of a BigFlag from the global flag set.\n\n```go\nfunc ImportChain(chain *core.BlockChain, fn string) error\n```\n\n```go\nfunc ImportPreimages(db *mandb.LDBDatabase, fn string) error\n```\nImportPreimages imports a batch of exported hash preimages into the database.\n\n```go\nfunc IsValidChar(aim byte) bool\n```\n\n```go\nfunc MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error)\n```\nMakeAddress converts an account specified directly as a hex encoded string or a key index in the key store to an internal account representation.\n\n```go\nfunc MakeChain(ctx *cli.Context, stack *pod.Node) (chain *core.BlockChain, chainDb mandb.Database)\n```\nMakeChain creates a chain manager from set command line flags.\n\n```go\nfunc MakeChainDatabase(ctx *cli.Context, stack *pod.Node) mandb.Database\n```\nMakeChainDatabase open an LevelDB using the flags passed to the client and will hard crash if it fails.\n\n```go\nfunc MakeConsolePreloads(ctx *cli.Context) []string\n```\nMakeConsolePreloads retrieves the absolute paths for the console JavaScript scripts to preload before starting.\n\n```go\nfunc MakeDataDir(ctx *cli.Context) string\n```\nMakeDataDir retrieves the currently requested data directory, terminating if none (or the empty string) is specified. If the node is starting a testnet, the a subdirectory of the specified datadir will be used.\n\n```go\nfunc MakeGenesis(ctx *cli.Context) *core.Genesis\n```\n\n```go\nfunc MakePasswordList(ctx *cli.Context) []string\n```\nMakePasswordList reads password lines from the file specified by the global --password flag.\n\n```go\nfunc MigrateFlags(action func(ctx *cli.Context) error) func(*cli.Context) error\n```\nMigrateFlags sets the global flag from a local flag when it's set. This is a temporary function used for migrating old command/flags to the new format.\n\ne.g. gman account new --keystore /tmp/mykeystore --lightkdf\n\nis equivalent after calling this method with:\n\ngman --keystore /tmp/mykeystore --lightkdf account new\n\nThis allows the use of the existing configuration functionality. When all flags are migrated this function can be removed and the existing configuration functionality must be changed that is uses local flags\n\n```go\nfunc NewApp(gitCommit, usage string) *cli.App\n```\nNewApp creates an app with sane defaults.\n\n```go\nfunc RegisterDashboardService(stack *pod.Node, cfg *dashboard.Config, commit string)\n```\nRegisterDashboardService adds a dashboard to the stack.\n\n```go\nfunc RegisterManService(stack *pod.Node, cfg *man.Config)\n```\nRegisterManService adds an Matrix client to the stack.\n\n```go\nfunc RegisterManStatsService(stack *pod.Node, url string)\n```\nRegisterManStatsService configures the Matrix Stats daemon and adds it to th egiven node.\n\n```go\nfunc SetDashboardConfig(ctx *cli.Context, cfg *dashboard.Config)\n```\nSetDashboardConfig applies dashboard related command line flags to the config.\n\n```go\nfunc SetManConfig(ctx *cli.Context, stack *pod.Node, cfg *man.Config)\n```\nSetManConfig applies man-related command line flags to the config.\n\n```go\nfunc SetNodeConfig(ctx *cli.Context, cfg *pod.Config)\n```\nSetNodeConfig applies node-related command line flags to the config.\n\n```go\nfunc SetP2PConfig(ctx *cli.Context, cfg *p2p.Config)\n```\n\n```go\nfunc SetupNetwork(ctx *cli.Context)\n```\nSetupNetwork configures the system for either the main net or some test network.\n\n```go\nfunc StartNode(stack *pod.Node)\n```\n\n## Types\n\n```go\ntype BigFlag struct {\n\tName  string\n\tValue *big.Int\n\tUsage string\n}\n```\nBigFlag is a command line flag that accepts 256 bit big integers in decimal or hexadecimal syntax.\n\n```go\nfunc (f BigFlag) Apply(set *flag.FlagSet)\n```\n\n```go\nfunc (f BigFlag) GetName() string\n```\n\n```go\nfunc (f BigFlag) String() string\n```\n\n```go\ntype DirectoryFlag struct {\n\tName  string\n\tValue DirectoryString\n\tUsage string\n}\n```\nCustom cli.Flag type which expand the received string to an absolute path. e.g. ~/.matrix -\u003e /home/username/.matrix\n\n```go\nfunc (self DirectoryFlag) Apply(set *flag.FlagSet)\n```\ncalled by cli library, grabs variable from environment (if in env) and adds variable to flag set for parsing.\n\n```go\nfunc (self DirectoryFlag) GetName() string\n```\n\n```go\nfunc (self *DirectoryFlag) Set(value string)\n```\n\n```go\nfunc (self DirectoryFlag) String() string\n```\n\n```go\ntype DirectoryString struct {\n\tValue string\n}\n```\nCustom type which is registered in the flags library which cli uses for argument parsing. This allows us to expand Value to an absolute path when the argument is parsed\n\n```go\nfunc (self *DirectoryString) Set(value string) error\n```\n\n```go\nfunc (self *DirectoryString) String() string\n```\n\n```go\ntype EntrustPassword struct {\n\tPassword map[common.Address]string\n}\n```\n\n```go\ntype JsonStruct struct {\n}\n```\n\n```go\nfunc NewJsonStruct() *JsonStruct\n```\n\n```go\nfunc (jst *JsonStruct) Load(filename string, v interface{})\n```\n\n```go\ntype TextMarshaler interface {\n\tencoding.TextMarshaler\n\tencoding.TextUnmarshaler\n}\n```\n\n```go\nfunc GlobalTextMarshaler(ctx *cli.Context, name string) TextMarshaler\n```\nGlobalTextMarshaler returns the value of a TextMarshalerFlag from the global flag set.\n\n```go\ntype TextMarshalerFlag struct {\n\tName  string\n\tValue TextMarshaler\n\tUsage string\n}\n```\nTextMarshalerFlag wraps a TextMarshaler value.\n\n```go\nfunc (f TextMarshalerFlag) Apply(set *flag.FlagSet)\n```\n\n```go\nfunc (f TextMarshalerFlag) GetName() string\n```\n\n```go\nfunc (f TextMarshalerFlag) String() string\n```\n\n","path":"github.com/chainopen/matrixchaincode/run/utils","name":"utils","synopsis":"Package utils contains internal helper functions for go-matrix commands.","isRedistributable":true}
