Lastly, we'll modify the makeFullNode() calls in the main entry point and start the streamer. In cmd/geth/main.go modify geth() to look like the following:
We'll also have to modify cmd/geth/consolecmd.go which also calls makeFullNode() and ignore the returned mevlink stream:
// cmd/geth/consolecmd.gofunclocalConsole(ctx *cli.Context) error {// Create and start the node based on the CLI flags prepare(ctx) stack, backend, _ := makeFullNode(ctx) startNode(ctx, stack, backend, true)defer stack.Close()// Attach to the newly started node and create the JavaScript console. client, err := stack.Attach()if err !=nil {return fmt.Errorf("failed to attach to the inproc geth: %v", err) } config :=console.Config{ DataDir: utils.MakeDataDir(ctx), DocRoot: ctx.String(utils.JSpathFlag.Name), Client: client, Preload: utils.MakeConsolePreloads(ctx), } console, err := console.New(config)if err !=nil {return fmt.Errorf("failed to start the JavaScript console: %v", err) }defer console.Stop(false)// If only a short execution was requested, evaluate and return.if script := ctx.String(utils.ExecFlag.Name); script !="" { console.Evaluate(script)returnnil }// Track node shutdown and stop the console when it goes down.// This happens when SIGTERM is sent to the process.gofunc() { stack.Wait() console.StopInteractive() }()// Print the welcome screen and enter interactive mode. console.Welcome() console.Interactive()returnnil}