区块链实验室(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

最后编译的工具如下图所示。

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_18807043/article/details/139600221