在go-ethereum安装中使用的命令是什么?

huangapple go评论90阅读模式
英文:

Make command in go-ethereum installation?

问题

我正在尝试修改geth的源代码,我有一些疑问。
我需要修改tx_pool.go文件中的以下语句,以便接受更多数据的交易:txMaxSize = 4 * txSlotSize // 128KB
文件链接:https://github.com/ethereum/go-ethereum/blob/master/core/tx_pool.go
我已经运行了以下命令:

git clone https://github.com/ethereum/go-ethereum.git

我的疑问是在运行make geth之前还是之后修改文件。

谢谢。

英文:

i am trying to change the source code of geth and I have some doubts.
I need to modify the following sentence in order to admit transactions with more data in them: txMaxSize = 4 * txSlotSize // 128KB
of tx_pool.go file: https://github.com/ethereum/go-ethereum/blob/master/core/tx_pool.go
I have run

git clone https://github.com/ethereum/go-ethereum.git

My doubt is whether i have to modify the file before or after running make geth

Thanks

答案1

得分: 1

从构建应用程序的角度来看,你可以简单地执行以下步骤:

git clone $repo

对文件进行修改。然后执行以下命令:

make geth

或者

cd cmd/geth/
go build

来构建你的应用程序。只运行go build通常在开发/测试中会更快,但是make geth可以提供更可复制的构建。

不过,我要提醒你的是,除非你计划使用具有更大交易的单独客户端创建自己的网络,否则构建具有更大交易的Geth只会导致你创建的交易在网络中无法成功传播,因为网络上的其他节点将拒绝它们。大多数矿工使用Geth(或Geth的分叉版本)来组装新的区块,而你自己更改参数并不会影响网络上的其他节点。

英文:

From the perspective of building the application, you can simply:

git clone $repo

Make modifications to the file. Then

make geth

or

cd cmd/geth/
go build

to build your application. Just running go build will generally be faster for development / testing, but make geth gives more reproducible builds.

I would warn you though, that unless your plan is to make your own network with a separate client that has larger transactions, building Geth with larger transactions will just mean you can create transactions that won't propagate across the network very successfully as other nodes on the network will reject them. Most miners use Geth (or Geth forks) to assemble new blocks, and changing the parameters yourself won't change it for other nodes on the network.

huangapple
  • 本文由 发表于 2022年9月9日 04:53:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/73654928.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定