本文主要是介绍区块链实验室(36) - 交叉编译Ethereum的客户端全套工具,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
停滞了一段时间,重新回到区块链实验。前面在“区块链实验室(31) - 交叉编译Ethereum的客户端Geth”中仅编译出客户端工具geth。编译Ethereum全套工具的代码如下。
#!/bin/bash
## abigen
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/abigen ./cmd/abigen## abidump
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/abidump ./cmd/abidump## bootnode
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/bootnode ./cmd/bootnode## checkpoint-admin
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/checkpoint-admin ./cmd/checkpoint-admin## clef
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/clef ./cmd/clef## devp2p
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/devp2p ./cmd/devp2p## ethkey
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/ethkey ./cmd/ethkey## evm
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/evm ./cmd/evm### faucet
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/faucet ./cmd/faucet## geth
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/geth ./cmd/geth## p2psim
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/p2psim ./cmd/p2psim## rlpdump
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=e206d3f8975bd98cc86d14055dca40f996bacc60 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20231208 -extldflags '-Wl,-z,stack-size=0x800000'" -tags urfave_cli_no_docs,ckzg -trimpath -v -o ./build-arm64/bin/rlpdump ./cmd/rlpdump
最后编译的工具如下图所示。
这篇关于区块链实验室(36) - 交叉编译Ethereum的客户端全套工具的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!