can be registered. type Node struct { eventmux *event.TypeMux // Event multiplexer used between the services of a config *Config accman *accounts.Manager ephemeralKeystore string // if non-empty, the key directory that wi instanceDirLock flock.Releaser // prevents concurrent use of instance dir serverConfig p2p.Config server *p2p.Server // Currently running P2P networking layer serviceFuncs []ServiceConstructor // Service constructors (in dependenc services map[reflect.Type]Service // Currently running services rpcAPIs []rpc.API // List of APIs currently provided by the node inprocHandler *rpc.Server // In-process RPC request handler to process the ipcEndpoint string // IPC endpoint to listen at (empty = IPC disabled ipcListener net.Listener // IPC RPC listener socket to serve API requests ipcHandler *rpc.Server // IPC RPC request handler to process the API requ httpEndpoint string // HTTP endpoint (interface + port) to listen at httpWhitelist []string // HTTP RPC modules to allow through this endpoi httpListener net.Listener // HTTP RPC listener socket to server API reques httpHandler *rpc.Server // HTTP RPC request handler to process the API r wsEndpoint string // Websocket endpoint (interface + port) to listen wsListener net.Listener // Websocket RPC listener socket to server API requ wsHandler *rpc.Server // Websocket RPC request handler to process the API stop chan struct{} // Channel to wait for termination notifications lock sync.RWMutex log log.Logger } $ۢ ҳઑ۽ఋੑࢶ ёۄݶࢲjݫࢲ٘חয٣ী ӒѤਫ਼दٍীj
to update hash rate on every nonce, so update after after 2^X nonces attempts++ if (attempts % (1 << 15)) == 0 { ethash.hashrate.Mark(attempts) attempts = 0 } // Compute the PoW value of this nonce digest, result := hashimotoFull(dataset.dataset, hash, nonce) if new(big.Int).SetBytes(result).Cmp(target) <= 0 { // Correct nonce found, create a new header with it header = types.CopyHeader(header) header.Nonce = types.EncodeNonce(nonce) header.MixDigest = common.BytesToHash(digest) // Seal and return a block (if still needed) select { case found <- block.WithSeal(header): logger.Trace("Ethash nonce found and reported", "attempts", nonce-seed, "nonce", nonce) case <-abort: logger.Trace("Ethash nonce found but discarded", "attempts", nonce-seed, "nonce", nonce) } break search } nonce++ https://github.com/ethereum/go-ethereum/blob/1acefafe2201ba061a58b51afd7a7edf4aa0f120/consensus/ethash/sealer.go#L110-L165