【区块链 | 智能合约】Ethereum源代码(2)- go-ethereum 客户端入口代码和Node分析

一、geth makefile 以及编译逻辑

上篇提到用 make geth 来编译geth客户端。我们来看看make file做了什么:

.PHONY: geth android ios evm all test clean

GOBIN = ./build/bin
GO ?= latest
GORUN = env GO111MODULE=on go run

geth:
	$(GORUN) build/ci.go install ./cmd/geth
	@echo "Done building."
	@echo "Run \"$(GOBIN)/geth\" to launch geth."

all:
	$(GORUN) build/ci.go install

执行了 ci.go

func main() {
	log.SetFlags(log.Lshortfile)

	if !common.FileExist(filepath.Join("build", "ci.go")) {
		log.Fatal("this script must be run from the root of the repository")
	}
	if len(os.Args) < 2 {
		log.Fatal("need subcommand as first argument")
	}
	switch os.Args[1] {
	case "install":
		doInstall(os.Args[2:])

}

里面做了两件事情
1,ln -s命令在build/_workspace/ 目录上生成了go-etherum的一个文件镜像,不占用磁盘空间,与源文件同步更新

2

猜你喜欢

转载自blog.csdn.net/qq_28505809/article/details/127862322