【正文】
bugCommand,licenseCommand,// See dumpConfigCommand,}(())// 所有能夠解析的Options = append(, nodeFlags...) = append(, rpcFlags...) = append(, consoleFlags...) = append(, ...) = append(, whisperFlags...) = func(ctx *) error {(())if err := (ctx)。 err != nil {return err}// Start system runtime metrics collectiongo (3 * )(ctx)return nil} = func(ctx *) error {()() // Resets terminal mode.return nil}}如果我們沒有輸入任何的參數(shù),那么會自動調(diào)用geth方法。// geth is the main entry point into the system if no special submand is ran.// It creates a default node based on the mand line arguments and runs it in// blocking mode, waiting for it to be shut down.// 如果沒有指定特殊的子命令,那么geth是系統(tǒng)主要的入口。// 它會根據(jù)提供的參數(shù)創(chuàng)建一個默認(rèn)的節(jié)點。并且以阻塞的模式運行這個節(jié)點,等待著節(jié)點被終止。func geth(ctx *) error {node := makeFullNode(ctx)startNode(ctx, node)()return nil}makeFullNode函數(shù),func makeFullNode(ctx *) * {// 根據(jù)命令行參數(shù)和一些特殊的配置來創(chuàng)建一個nodestack, cfg := makeConfigNode(ctx)// 把eth的服務(wù)注冊到這個節(jié)點上面。 eth服務(wù)是以太坊的主要的服務(wù)。 是以太坊功能的提供者。(stack, amp。)// Whisper must be explicitly enabled by specifying at least 1 whisper flag or in dev mode// Whisper是一個新的模塊,用來進(jìn)行加密通訊的功能。 需要顯式的提供參數(shù)來啟用,或者是處于開發(fā)模式。shhEnabled := enableWhisper(ctx)shhAutoEnabled := !() amp。amp。 ()if shhEnabled || shhAutoEnabled {if () { = uint32(())}if () { = ()}// 注冊Shh服務(wù)(stack, amp。)}// Add the Ethereum Stats da