mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 12:01:20 +00:00
ecb10e8548
* save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * Squashed 'interfaces/' content from commit e5b1945d0 git-subtree-dir: interfaces git-subtree-split: e5b1945d02da7a7f00e2289034ee90a6edd60184 * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save
50 lines
917 B
Go
50 lines
917 B
Go
package snapshothashes
|
|
|
|
import (
|
|
_ "embed"
|
|
"encoding/json"
|
|
|
|
"github.com/ledgerwatch/erigon/params/networkname"
|
|
)
|
|
|
|
//go:embed erigon-snapshots/mainnet.json
|
|
var mainnet []byte
|
|
var Mainnet = fromJson(mainnet)
|
|
|
|
//go:embed erigon-snapshots/goerli.json
|
|
var goerli []byte
|
|
var Goerli = fromJson(goerli)
|
|
|
|
type Preverified map[string]string
|
|
|
|
func fromJson(in []byte) (out Preverified) {
|
|
if err := json.Unmarshal(in, &out); err != nil {
|
|
panic(err)
|
|
}
|
|
return out
|
|
}
|
|
|
|
var (
|
|
MainnetChainSnapshotConfig = &Config{}
|
|
GoerliChainSnapshotConfig = &Config{
|
|
ExpectBlocks: 5_900_000 - 1,
|
|
Preverified: Goerli,
|
|
}
|
|
)
|
|
|
|
type Config struct {
|
|
ExpectBlocks uint64
|
|
Preverified Preverified
|
|
}
|
|
|
|
func KnownConfig(networkName string) *Config {
|
|
switch networkName {
|
|
case networkname.MainnetChainName:
|
|
return MainnetChainSnapshotConfig
|
|
case networkname.GoerliChainName:
|
|
return GoerliChainSnapshotConfig
|
|
default:
|
|
return nil
|
|
}
|
|
}
|