github.com/unicornultrafoundation/go-u2u@v1.0.0-rc1.0.20240205080301-e74a83d3fadc/miner/miner.go (about) 1 // Copyright 2014 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 // Package miner implements Ethereum block creation and mining. 18 package miner 19 20 import ( 21 "math/big" 22 "time" 23 24 "github.com/unicornultrafoundation/go-u2u/common" 25 "github.com/unicornultrafoundation/go-u2u/common/hexutil" 26 ) 27 28 // Config is the configuration parameters of mining. 29 type Config struct { 30 Etherbase common.Address `toml:",omitempty"` // Public address for block mining rewards (default = first account) 31 Notify []string `toml:",omitempty"` // HTTP URL list to be notified of new work packages (only useful in ethash). 32 NotifyFull bool `toml:",omitempty"` // Notify with pending block headers instead of work packages 33 ExtraData hexutil.Bytes `toml:",omitempty"` // Block extra data set by the miner 34 GasFloor uint64 // Target gas floor for mined blocks. 35 GasCeil uint64 // Target gas ceiling for mined blocks. 36 GasPrice *big.Int // Minimum gas price for mining a transaction 37 Recommit time.Duration // The time interval for miner to re-create mining work. 38 Noverify bool // Disable remote mining solution verification(only useful in ethash). 39 }