README
¶
go-etchash
Etchash go module intended for use by open-etc-pool (and open-ethereum-pool).
- for open-etc-pool see https://github.com/etclabscore/open-etc-pool
- for more information on etchash see https://github.com/eth-classic/etchash
usage
var ecip1099FBlockClassic uint64 = 11700000 // classic mainnet
var ecip1099FBlockMordor uint64 = 2520000 // mordor testnet
var hasher = etchash.New(&ecip1099FBlockMordor)
if hasher.Verify(block) {
...
}
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDir = defaultDir()
View Source
var (
ErrInvalidDumpMagic = errors.New("invalid dump magic")
)
Functions ¶
Types ¶
type Etchash ¶
Etchash combines block verification with Light and nonce searching with Full into a single proof of work.
func NewForTesting ¶
NewForTesting creates a proof of work for use in unit tests. It uses a smaller DAG and cache size to keep test times low. DAG files are stored in a temporary directory.
Nonces found by a testing instance are not verifiable with a regular-size cache.
type Full ¶
type Full struct { Dir string // use this to specify a non-default DAG directory // contains filtered or unexported fields }
Full implements the Search half of the proof of work.
func (*Full) GetHashrate ¶
type Light ¶
type Light struct { NumCaches int // Maximum number of caches to keep before eviction (only init, don't modify) // contains filtered or unexported fields }
Light implements the Verify half of the proof of work. It uses a few small in-memory caches to verify the nonces found by Full.
Click to show internal directories.
Click to hide internal directories.