main.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. /*
  2. This file is part of go-ethereum
  3. go-ethereum is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. go-ethereum is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. /**
  15. * @authors
  16. * Jeffrey Wilcke <i@jev.io>
  17. */
  18. package main
  19. import (
  20. "fmt"
  21. "io"
  22. "io/ioutil"
  23. _ "net/http/pprof"
  24. "os"
  25. "path/filepath"
  26. "runtime"
  27. "strconv"
  28. "strings"
  29. "time"
  30. "github.com/codegangsta/cli"
  31. "github.com/ethereum/ethash"
  32. "github.com/ethereum/go-ethereum/accounts"
  33. "github.com/ethereum/go-ethereum/cmd/utils"
  34. "github.com/ethereum/go-ethereum/common"
  35. "github.com/ethereum/go-ethereum/core"
  36. "github.com/ethereum/go-ethereum/core/types"
  37. "github.com/ethereum/go-ethereum/eth"
  38. "github.com/ethereum/go-ethereum/ethdb"
  39. "github.com/ethereum/go-ethereum/logger"
  40. "github.com/ethereum/go-ethereum/logger/glog"
  41. "github.com/ethereum/go-ethereum/metrics"
  42. "github.com/ethereum/go-ethereum/rpc/codec"
  43. "github.com/ethereum/go-ethereum/rpc/comms"
  44. "github.com/mattn/go-colorable"
  45. "github.com/mattn/go-isatty"
  46. )
  47. const (
  48. ClientIdentifier = "Geth"
  49. Version = "0.9.35"
  50. )
  51. var (
  52. gitCommit string // set via linker flag
  53. nodeNameVersion string
  54. app *cli.App
  55. )
  56. func init() {
  57. if gitCommit == "" {
  58. nodeNameVersion = Version
  59. } else {
  60. nodeNameVersion = Version + "-" + gitCommit[:8]
  61. }
  62. app = utils.NewApp(Version, "the go-ethereum command line interface")
  63. app.Action = run
  64. app.HideVersion = true // we have a command to print the version
  65. app.Commands = []cli.Command{
  66. {
  67. Action: blockRecovery,
  68. Name: "recover",
  69. Usage: "attempts to recover a corrupted database by setting a new block by number or hash. See help recover.",
  70. Description: `
  71. The recover commands will attempt to read out the last
  72. block based on that.
  73. recover #number recovers by number
  74. recover <hex> recovers by hash
  75. `,
  76. },
  77. blocktestCommand,
  78. importCommand,
  79. exportCommand,
  80. upgradedbCommand,
  81. removedbCommand,
  82. dumpCommand,
  83. monitorCommand,
  84. {
  85. Action: makedag,
  86. Name: "makedag",
  87. Usage: "generate ethash dag (for testing)",
  88. Description: `
  89. The makedag command generates an ethash DAG in /tmp/dag.
  90. This command exists to support the system testing project.
  91. Regular users do not need to execute it.
  92. `,
  93. },
  94. {
  95. Action: version,
  96. Name: "version",
  97. Usage: "print ethereum version numbers",
  98. Description: `
  99. The output of this command is supposed to be machine-readable.
  100. `,
  101. },
  102. {
  103. Name: "wallet",
  104. Usage: "ethereum presale wallet",
  105. Subcommands: []cli.Command{
  106. {
  107. Action: importWallet,
  108. Name: "import",
  109. Usage: "import ethereum presale wallet",
  110. },
  111. },
  112. Description: `
  113. get wallet import /path/to/my/presale.wallet
  114. will prompt for your password and imports your ether presale account.
  115. It can be used non-interactively with the --password option taking a
  116. passwordfile as argument containing the wallet password in plaintext.
  117. `},
  118. {
  119. Action: accountList,
  120. Name: "account",
  121. Usage: "manage accounts",
  122. Description: `
  123. Manage accounts lets you create new accounts, list all existing accounts,
  124. import a private key into a new account.
  125. ' help' shows a list of subcommands or help for one subcommand.
  126. It supports interactive mode, when you are prompted for password as well as
  127. non-interactive mode where passwords are supplied via a given password file.
  128. Non-interactive mode is only meant for scripted use on test networks or known
  129. safe environments.
  130. Make sure you remember the password you gave when creating a new account (with
  131. either new or import). Without it you are not able to unlock your account.
  132. Note that exporting your key in unencrypted format is NOT supported.
  133. Keys are stored under <DATADIR>/keys.
  134. It is safe to transfer the entire directory or the individual keys therein
  135. between ethereum nodes by simply copying.
  136. Make sure you backup your keys regularly.
  137. In order to use your account to send transactions, you need to unlock them using the
  138. '--unlock' option. The argument is a comma
  139. And finally. DO NOT FORGET YOUR PASSWORD.
  140. `,
  141. Subcommands: []cli.Command{
  142. {
  143. Action: accountList,
  144. Name: "list",
  145. Usage: "print account addresses",
  146. },
  147. {
  148. Action: accountCreate,
  149. Name: "new",
  150. Usage: "create a new account",
  151. Description: `
  152. ethereum account new
  153. Creates a new account. Prints the address.
  154. The account is saved in encrypted format, you are prompted for a passphrase.
  155. You must remember this passphrase to unlock your account in the future.
  156. For non-interactive use the passphrase can be specified with the --password flag:
  157. ethereum --password <passwordfile> account new
  158. Note, this is meant to be used for testing only, it is a bad idea to save your
  159. password to file or expose in any other way.
  160. `,
  161. },
  162. {
  163. Action: accountImport,
  164. Name: "import",
  165. Usage: "import a private key into a new account",
  166. Description: `
  167. ethereum account import <keyfile>
  168. Imports an unencrypted private key from <keyfile> and creates a new account.
  169. Prints the address.
  170. The keyfile is assumed to contain an unencrypted private key in hexadecimal format.
  171. The account is saved in encrypted format, you are prompted for a passphrase.
  172. You must remember this passphrase to unlock your account in the future.
  173. For non-interactive use the passphrase can be specified with the -password flag:
  174. ethereum --password <passwordfile> account import <keyfile>
  175. Note:
  176. As you can directly copy your encrypted accounts to another ethereum instance,
  177. this import mechanism is not needed when you transfer an account between
  178. nodes.
  179. `,
  180. },
  181. },
  182. },
  183. {
  184. Action: console,
  185. Name: "console",
  186. Usage: `Geth Console: interactive JavaScript environment`,
  187. Description: `
  188. The Geth console is an interactive shell for the JavaScript runtime environment
  189. which exposes a node admin interface as well as the Ðapp JavaScript API.
  190. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console
  191. `},
  192. {
  193. Action: attach,
  194. Name: "attach",
  195. Usage: `Geth Console: interactive JavaScript environment (connect to node)`,
  196. Description: `
  197. The Geth console is an interactive shell for the JavaScript runtime environment
  198. which exposes a node admin interface as well as the Ðapp JavaScript API.
  199. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console.
  200. This command allows to open a console on a running geth node.
  201. `,
  202. },
  203. {
  204. Action: execJSFiles,
  205. Name: "js",
  206. Usage: `executes the given JavaScript files in the Geth JavaScript VM`,
  207. Description: `
  208. The JavaScript VM exposes a node admin interface as well as the Ðapp
  209. JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console
  210. `,
  211. },
  212. }
  213. app.Flags = []cli.Flag{
  214. utils.IdentityFlag,
  215. utils.UnlockedAccountFlag,
  216. utils.PasswordFileFlag,
  217. utils.GenesisNonceFlag,
  218. utils.BootnodesFlag,
  219. utils.DataDirFlag,
  220. utils.BlockchainVersionFlag,
  221. utils.JSpathFlag,
  222. utils.ListenPortFlag,
  223. utils.MaxPeersFlag,
  224. utils.MaxPendingPeersFlag,
  225. utils.EtherbaseFlag,
  226. utils.GasPriceFlag,
  227. utils.MinerThreadsFlag,
  228. utils.MiningEnabledFlag,
  229. utils.AutoDAGFlag,
  230. utils.NATFlag,
  231. utils.NatspecEnabledFlag,
  232. utils.NoDiscoverFlag,
  233. utils.NodeKeyFileFlag,
  234. utils.NodeKeyHexFlag,
  235. utils.RPCEnabledFlag,
  236. utils.RPCListenAddrFlag,
  237. utils.RPCPortFlag,
  238. utils.RpcApiFlag,
  239. utils.IPCDisabledFlag,
  240. utils.IPCApiFlag,
  241. utils.IPCPathFlag,
  242. utils.ExecFlag,
  243. utils.WhisperEnabledFlag,
  244. utils.VMDebugFlag,
  245. utils.NetworkIdFlag,
  246. utils.RPCCORSDomainFlag,
  247. utils.VerbosityFlag,
  248. utils.BacktraceAtFlag,
  249. utils.LogToStdErrFlag,
  250. utils.LogVModuleFlag,
  251. utils.LogFileFlag,
  252. utils.LogJSONFlag,
  253. utils.PProfEanbledFlag,
  254. utils.PProfPortFlag,
  255. utils.MetricsEnabledFlag,
  256. utils.SolcPathFlag,
  257. utils.GpoMinGasPriceFlag,
  258. utils.GpoMaxGasPriceFlag,
  259. utils.GpoFullBlockRatioFlag,
  260. utils.GpobaseStepDownFlag,
  261. utils.GpobaseStepUpFlag,
  262. utils.GpobaseCorrectionFactorFlag,
  263. }
  264. app.Before = func(ctx *cli.Context) error {
  265. utils.SetupLogger(ctx)
  266. if ctx.GlobalBool(utils.PProfEanbledFlag.Name) {
  267. utils.StartPProf(ctx)
  268. }
  269. return nil
  270. }
  271. // Start system runtime metrics collection
  272. go metrics.CollectProcessMetrics(3 * time.Second)
  273. }
  274. func main() {
  275. runtime.GOMAXPROCS(runtime.NumCPU())
  276. defer logger.Flush()
  277. if err := app.Run(os.Args); err != nil {
  278. fmt.Fprintln(os.Stderr, err)
  279. os.Exit(1)
  280. }
  281. }
  282. func run(ctx *cli.Context) {
  283. utils.HandleInterrupt()
  284. cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
  285. ethereum, err := eth.New(cfg)
  286. if err != nil {
  287. utils.Fatalf("%v", err)
  288. }
  289. startEth(ctx, ethereum)
  290. // this blocks the thread
  291. ethereum.WaitForShutdown()
  292. }
  293. func attach(ctx *cli.Context) {
  294. // Wrap the standard output with a colorified stream (windows)
  295. if isatty.IsTerminal(os.Stdout.Fd()) {
  296. if pr, pw, err := os.Pipe(); err == nil {
  297. go io.Copy(colorable.NewColorableStdout(), pr)
  298. os.Stdout = pw
  299. }
  300. }
  301. var client comms.EthereumClient
  302. var err error
  303. if ctx.Args().Present() {
  304. client, err = comms.ClientFromEndpoint(ctx.Args().First(), codec.JSON)
  305. } else {
  306. cfg := comms.IpcConfig{
  307. Endpoint: ctx.GlobalString(utils.IPCPathFlag.Name),
  308. }
  309. client, err = comms.NewIpcClient(cfg, codec.JSON)
  310. }
  311. if err != nil {
  312. utils.Fatalf("Unable to attach to geth node - %v", err)
  313. }
  314. repl := newLightweightJSRE(
  315. ctx.GlobalString(utils.JSpathFlag.Name),
  316. client,
  317. true,
  318. nil)
  319. if ctx.GlobalString(utils.ExecFlag.Name) != "" {
  320. repl.batch(ctx.GlobalString(utils.ExecFlag.Name))
  321. } else {
  322. repl.welcome()
  323. repl.interactive()
  324. }
  325. }
  326. func console(ctx *cli.Context) {
  327. // Wrap the standard output with a colorified stream (windows)
  328. if isatty.IsTerminal(os.Stdout.Fd()) {
  329. if pr, pw, err := os.Pipe(); err == nil {
  330. go io.Copy(colorable.NewColorableStdout(), pr)
  331. os.Stdout = pw
  332. }
  333. }
  334. cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
  335. ethereum, err := eth.New(cfg)
  336. if err != nil {
  337. utils.Fatalf("%v", err)
  338. }
  339. client := comms.NewInProcClient(codec.JSON)
  340. startEth(ctx, ethereum)
  341. repl := newJSRE(
  342. ethereum,
  343. ctx.GlobalString(utils.JSpathFlag.Name),
  344. ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
  345. client,
  346. true,
  347. nil,
  348. )
  349. if ctx.GlobalString(utils.ExecFlag.Name) != "" {
  350. repl.batch(ctx.GlobalString(utils.ExecFlag.Name))
  351. } else {
  352. repl.welcome()
  353. repl.interactive()
  354. }
  355. ethereum.Stop()
  356. ethereum.WaitForShutdown()
  357. }
  358. func execJSFiles(ctx *cli.Context) {
  359. cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
  360. ethereum, err := eth.New(cfg)
  361. if err != nil {
  362. utils.Fatalf("%v", err)
  363. }
  364. client := comms.NewInProcClient(codec.JSON)
  365. startEth(ctx, ethereum)
  366. repl := newJSRE(
  367. ethereum,
  368. ctx.GlobalString(utils.JSpathFlag.Name),
  369. ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
  370. client,
  371. false,
  372. nil,
  373. )
  374. for _, file := range ctx.Args() {
  375. repl.exec(file)
  376. }
  377. ethereum.Stop()
  378. ethereum.WaitForShutdown()
  379. }
  380. func unlockAccount(ctx *cli.Context, am *accounts.Manager, account string, i int) {
  381. var err error
  382. // Load startup keys. XXX we are going to need a different format
  383. if !((len(account) == 40) || (len(account) == 42)) { // with or without 0x
  384. utils.Fatalf("Invalid account address '%s'", account)
  385. }
  386. // Attempt to unlock the account 3 times
  387. attempts := 3
  388. for tries := 0; tries < attempts; tries++ {
  389. msg := fmt.Sprintf("Unlocking account %s | Attempt %d/%d", account, tries+1, attempts)
  390. passphrase := getPassPhrase(ctx, msg, false, i)
  391. err = am.Unlock(common.HexToAddress(account), passphrase)
  392. if err == nil {
  393. break
  394. }
  395. }
  396. if err != nil {
  397. utils.Fatalf("Unlock account failed '%v'", err)
  398. }
  399. fmt.Printf("Account '%s' unlocked.\n", account)
  400. }
  401. func blockRecovery(ctx *cli.Context) {
  402. arg := ctx.Args().First()
  403. if len(ctx.Args()) < 1 && len(arg) > 0 {
  404. glog.Fatal("recover requires block number or hash")
  405. }
  406. cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
  407. blockDb, err := ethdb.NewLDBDatabase(filepath.Join(cfg.DataDir, "blockchain"))
  408. if err != nil {
  409. glog.Fatalln("could not open db:", err)
  410. }
  411. var block *types.Block
  412. if arg[0] == '#' {
  413. block = core.GetBlockByNumber(blockDb, common.String2Big(arg[1:]).Uint64())
  414. } else {
  415. block = core.GetBlockByHash(blockDb, common.HexToHash(arg))
  416. }
  417. if block == nil {
  418. glog.Fatalln("block not found. Recovery failed")
  419. }
  420. err = core.WriteHead(blockDb, block)
  421. if err != nil {
  422. glog.Fatalln("block write err", err)
  423. }
  424. glog.Infof("Recovery succesful. New HEAD %x\n", block.Hash())
  425. }
  426. func startEth(ctx *cli.Context, eth *eth.Ethereum) {
  427. // Start Ethereum itself
  428. utils.StartEthereum(eth)
  429. am := eth.AccountManager()
  430. account := ctx.GlobalString(utils.UnlockedAccountFlag.Name)
  431. accounts := strings.Split(account, " ")
  432. for i, account := range accounts {
  433. if len(account) > 0 {
  434. if account == "primary" {
  435. utils.Fatalf("the 'primary' keyword is deprecated. You can use integer indexes, but the indexes are not permanent, they can change if you add external keys, export your keys or copy your keystore to another node.")
  436. }
  437. unlockAccount(ctx, am, account, i)
  438. }
  439. }
  440. // Start auxiliary services if enabled.
  441. if !ctx.GlobalBool(utils.IPCDisabledFlag.Name) {
  442. if err := utils.StartIPC(eth, ctx); err != nil {
  443. utils.Fatalf("Error string IPC: %v", err)
  444. }
  445. }
  446. if ctx.GlobalBool(utils.RPCEnabledFlag.Name) {
  447. if err := utils.StartRPC(eth, ctx); err != nil {
  448. utils.Fatalf("Error starting RPC: %v", err)
  449. }
  450. }
  451. if ctx.GlobalBool(utils.MiningEnabledFlag.Name) {
  452. if err := eth.StartMining(ctx.GlobalInt(utils.MinerThreadsFlag.Name)); err != nil {
  453. utils.Fatalf("%v", err)
  454. }
  455. }
  456. }
  457. func accountList(ctx *cli.Context) {
  458. am := utils.MakeAccountManager(ctx)
  459. accts, err := am.Accounts()
  460. if err != nil {
  461. utils.Fatalf("Could not list accounts: %v", err)
  462. }
  463. for i, acct := range accts {
  464. fmt.Printf("Account #%d: %x\n", i, acct)
  465. }
  466. }
  467. func getPassPhrase(ctx *cli.Context, desc string, confirmation bool, i int) (passphrase string) {
  468. passfile := ctx.GlobalString(utils.PasswordFileFlag.Name)
  469. if len(passfile) == 0 {
  470. fmt.Println(desc)
  471. auth, err := utils.PromptPassword("Passphrase: ", true)
  472. if err != nil {
  473. utils.Fatalf("%v", err)
  474. }
  475. if confirmation {
  476. confirm, err := utils.PromptPassword("Repeat Passphrase: ", false)
  477. if err != nil {
  478. utils.Fatalf("%v", err)
  479. }
  480. if auth != confirm {
  481. utils.Fatalf("Passphrases did not match.")
  482. }
  483. }
  484. passphrase = auth
  485. } else {
  486. passbytes, err := ioutil.ReadFile(passfile)
  487. if err != nil {
  488. utils.Fatalf("Unable to read password file '%s': %v", passfile, err)
  489. }
  490. // this is backwards compatible if the same password unlocks several accounts
  491. // it also has the consequence that trailing newlines will not count as part
  492. // of the password, so --password <(echo -n 'pass') will now work without -n
  493. passphrases := strings.Split(string(passbytes), "\n")
  494. if i >= len(passphrases) {
  495. passphrase = passphrases[len(passphrases)-1]
  496. } else {
  497. passphrase = passphrases[i]
  498. }
  499. }
  500. return
  501. }
  502. func accountCreate(ctx *cli.Context) {
  503. am := utils.MakeAccountManager(ctx)
  504. passphrase := getPassPhrase(ctx, "Your new account is locked with a password. Please give a password. Do not forget this password.", true, 0)
  505. acct, err := am.NewAccount(passphrase)
  506. if err != nil {
  507. utils.Fatalf("Could not create the account: %v", err)
  508. }
  509. fmt.Printf("Address: %x\n", acct)
  510. }
  511. func importWallet(ctx *cli.Context) {
  512. keyfile := ctx.Args().First()
  513. if len(keyfile) == 0 {
  514. utils.Fatalf("keyfile must be given as argument")
  515. }
  516. keyJson, err := ioutil.ReadFile(keyfile)
  517. if err != nil {
  518. utils.Fatalf("Could not read wallet file: %v", err)
  519. }
  520. am := utils.MakeAccountManager(ctx)
  521. passphrase := getPassPhrase(ctx, "", false, 0)
  522. acct, err := am.ImportPreSaleKey(keyJson, passphrase)
  523. if err != nil {
  524. utils.Fatalf("Could not create the account: %v", err)
  525. }
  526. fmt.Printf("Address: %x\n", acct)
  527. }
  528. func accountImport(ctx *cli.Context) {
  529. keyfile := ctx.Args().First()
  530. if len(keyfile) == 0 {
  531. utils.Fatalf("keyfile must be given as argument")
  532. }
  533. am := utils.MakeAccountManager(ctx)
  534. passphrase := getPassPhrase(ctx, "Your new account is locked with a password. Please give a password. Do not forget this password.", true, 0)
  535. acct, err := am.Import(keyfile, passphrase)
  536. if err != nil {
  537. utils.Fatalf("Could not create the account: %v", err)
  538. }
  539. fmt.Printf("Address: %x\n", acct)
  540. }
  541. func makedag(ctx *cli.Context) {
  542. args := ctx.Args()
  543. wrongArgs := func() {
  544. utils.Fatalf(`Usage: geth makedag <block number> <outputdir>`)
  545. }
  546. switch {
  547. case len(args) == 2:
  548. blockNum, err := strconv.ParseUint(args[0], 0, 64)
  549. dir := args[1]
  550. if err != nil {
  551. wrongArgs()
  552. } else {
  553. dir = filepath.Clean(dir)
  554. // seems to require a trailing slash
  555. if !strings.HasSuffix(dir, "/") {
  556. dir = dir + "/"
  557. }
  558. _, err = ioutil.ReadDir(dir)
  559. if err != nil {
  560. utils.Fatalf("Can't find dir")
  561. }
  562. fmt.Println("making DAG, this could take awhile...")
  563. ethash.MakeDAG(blockNum, dir)
  564. }
  565. default:
  566. wrongArgs()
  567. }
  568. }
  569. func version(c *cli.Context) {
  570. fmt.Println(ClientIdentifier)
  571. fmt.Println("Version:", Version)
  572. if gitCommit != "" {
  573. fmt.Println("Git Commit:", gitCommit)
  574. }
  575. fmt.Println("Protocol Versions:", eth.ProtocolVersions)
  576. fmt.Println("Network Id:", c.GlobalInt(utils.NetworkIdFlag.Name))
  577. fmt.Println("Go Version:", runtime.Version())
  578. fmt.Println("OS:", runtime.GOOS)
  579. fmt.Printf("GOPATH=%s\n", os.Getenv("GOPATH"))
  580. fmt.Printf("GOROOT=%s\n", runtime.GOROOT())
  581. }