Answer the question
In order to leave comments, you need to log in
How to create a block using the go-ethereum library?
In general, I decided to study the issue of writing a program in the Go language that will create accounts in the test (private) Ethereum network and drive transactions between them (this is necessary to approach the real network environment, where more than one transaction passes per second). I immediately found go-ethereum, and quickly realized that there is very little information on this lib, and if there is, it comes down to creating a couple of accounts or interacting with geth.
Using the method of highly scientific poke, I learned how to create key pairs and create accounts based on them so that the same geth can see these accounts. I even learned how to send a transaction to the network. But I still don’t understand how to create a block (mining, mining). In geth, this is done indecently simply by miner.start (), but in go-ethereum you will understand horseradish. The only worthwhile thing that can somehow help is this method, which returns a pointer to the Miner type
func New(eth Backend, config *params.ChainConfig, mux *event.TypeMux, engine consensus.Engine, recommit time.Duration, gasFloor, gasCeil uint64, isLocalBlock func(block *types.Block) bool) *Miner
Answer the question
In order to leave comments, you need to log in
Well, if you get comfortable with geth itself and can run it in miner mode, why complicate your life?
There seems to be nothing about creating a block, but in any case, this is very useful material for working with go-ethereum:
https://goethereumbook.org/en/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question