aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2019-02-25 19:08:17 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitf3658a11e0a72da8da4c716cbcecc69d79f396ce (patch)
treebec0b457f6305f58473974bb855bf69519a873e3 /core
parentd779f5aead9e91b97c8d05136ddb7a6bd84f4276 (diff)
downloaddexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.tar.gz
dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.tar.zst
dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.zip
params: add Yilan network (#207)
* Add Yilan network * Fixup: remove dummy log
Diffstat (limited to 'core')
-rw-r--r--core/genesis.go14
-rw-r--r--core/genesis_alloc.go1
-rw-r--r--core/genesis_test.go10
3 files changed, 25 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 2b42fa2cc..ea521dc9b 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -237,6 +237,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
return params.MainnetChainConfig
case ghash == params.TestnetGenesisHash:
return params.TestnetChainConfig
+ case ghash == params.YilanGenesisHash:
+ return params.YilanChainConfig
default:
return params.AllEthashProtocolChanges
}
@@ -435,6 +437,18 @@ func DefaultTaipeiGenesisBlock() *Genesis {
}
}
+// DefaultYilanGenesisBlock returns the Yilan network genesis block.
+func DefaultYilanGenesisBlock() *Genesis {
+ return &Genesis{
+ Config: params.YilanChainConfig,
+ Nonce: 0x42,
+ ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"),
+ GasLimit: 40000000,
+ Difficulty: big.NewInt(1),
+ Alloc: decodePrealloc(yilanAllocData),
+ }
+}
+
// DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must
// be seeded with the
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
diff --git a/core/genesis_alloc.go b/core/genesis_alloc.go
index 8cea595d8..ff65c801e 100644
--- a/core/genesis_alloc.go
+++ b/core/genesis_alloc.go
@@ -25,3 +25,4 @@ const mainnetAllocData = testnetAllocData
const testnetAllocData = "\xf9\x053\xf8\u0194\t\xfc\xb0\xfbfb+\xce~\x17\x86\x96\xfe\xc4p.D\x88k+\xf8\xaf\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04Vx\xa0\xa7N +{=\xe29\xdd|\x0e\xfb\u03f7\x98p\xeb\xcb\aU\xb0\xd0\x05e\x1e\xae\x1c\xa0\xf4\xa7\u00c2\x95\xe5\x8b+\xa7\xeb^\u04a1z\bzv\u0218~\x12-O\xc5>\x9e\x1e\x04\x1a\x9eq\x8en\xf8R\x93Node - asia-east1-2\x9etestnet-asia-east1-2@dexon.org\x8casia-east1-2\x91https://dexon.org\xf8\u0194&(\xe3N\xe04\a29U\uff7b\x02\b\u02c8^\xc3\xcd\xf8\xaf\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x94\xa3R\xd3_yv\xcb_\x15\xb1^i\xe9{v\xbb\xd1Z`\x87\x0e\x98r\u065a\xa4d\xd1\xfa\xbd}\f\xb6\xad\u0106\xbd\xdfqY\xe7\xbe\xc0\x17\xeds\x96\xd2\xf4-\u0349\xc1\xdc\u007fw\xdf\xc3]\xa8\x85\xbb\xf3\xf8R\x93Node - asia-east1-0\x9etestnet-asia-east1-0@dexon.org\x8casia-east1-0\x91https://dexon.org\xf8\u05546_\x0f\xb5\x82NlH\xdak\xa5\xae\xeaF\xf4V\xba:q0\xf8\xbe\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x97Ka!\x8a\xa6_\xcd\x00S\xb9\xc5j\x03\x18\x9b\xa9\a\x93p\xba\xbc\x9f\xb5\xf4\xa4y\xe1\x1ac\x1d\x83\xc7.;l[\xdc:G\b\v\x0f\xa6\x0f\xa9Y\xf2\xc7yzeq\x92x\xd2*[k\xa7\x9e\xb2\xb6\xe0\xf8a\x98Node - asia-northeast1-1\xa3testnet-asia-northeast1-1@dexon.org\x91asia-northeast1-1\x91https://dexon.org\xf8\u0554`\xceWCm\x96%\x9f}\x90\u00e7}\xe9&\xb8'*\xf65\xf8\xbe\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\xfa\x90`=Bm\b\x9fx\xbb\b!\a\x05y[\bB\xa1Io\x99$*\x06\x89\x9d{}\u0737\x1f!|\x95h\xa9df\xec\xb1\x14\x12\x91r}A\xc7p\uf843\xa6\xe9\x00Y\x97\xba\x1dT\x9bu\xf2\xcd\xf8a\x98Node - asia-northeast1-0\xa3testnet-asia-northeast1-0@dexon.org\x91asia-northeast1-0\x91https://dexon.org\ua53f\x8cH\xa6 \xba\xccF\x90\u007f\x9b\x89s-%\xe4z-|\xf7\u050b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x80\x80\x80\u0100\x80\x80\x80\xea\x94\xe0\xf8Y4\x03S\x85F\x93\xf57\xea3q\x06\xa3>\x9f\xea\xb0\u050b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x80\x80\x80\u0100\x80\x80\x80\xf8\u0194\xf01\x10\x8e\x17\u04da\x9e\x8d\x8e\xe2a\x81\xe1\x85sF.\xe4\x85\xf8\xaf\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x86\xfbL^Q^oA\b&\xcd\x00@\x10\xb0ly\xe7\xbb\x1f\x95\x89\x8e\x82\xaf\x957\x1c\xac\x9a4\x97s0\x86iN\x9du0\xf1T\u02ebe,\xd9ZE\u015f\x1b \xe9O\u0179RD\vN\xdc\b\xe8\xf8R\x93Node - asia-east1-1\x9etestnet-asia-east1-1@dexon.org\x8casia-east1-1\x91https://dexon.org\xf8\u0554\xf3\xbb\xe2@\x1b\xd0\xcb\xe7\x8ca\xdbc\x92\x84\x81\xf3\xbd\xc2\xfe\x1a\xf8\xbe\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x96\xce\x05\xc4(\xbe%ge\x8e\xb9\x8d\xdf\xdd\xee\x15\xafg\x94\xbe\xabyQ#\xac\xa1n\x8f\u007f\x14\x91\xe53z\x15Q\xe4b]b8@K\xa0\x881\xcbk\xbd~\xce\xf0TU%AW\x14\u01b0\x10\xe6qc\xf8a\x98Node - asia-northeast1-2\xa3testnet-asia-northeast1-2@dexon.org\x91asia-northeast1-2\x91https://dexon.org"
const taipeiAllocData = "\xf9\x053\xf8\u0194\t\xfc\xb0\xfbfb+\xce~\x17\x86\x96\xfe\xc4p.D\x88k+\xf8\xaf\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04Vx\xa0\xa7N +{=\xe29\xdd|\x0e\xfb\u03f7\x98p\xeb\xcb\aU\xb0\xd0\x05e\x1e\xae\x1c\xa0\xf4\xa7\u00c2\x95\xe5\x8b+\xa7\xeb^\u04a1z\bzv\u0218~\x12-O\xc5>\x9e\x1e\x04\x1a\x9eq\x8en\xf8R\x93Node - asia-east1-2\x9etestnet-asia-east1-2@dexon.org\x8casia-east1-2\x91https://dexon.org\xf8\u0194&(\xe3N\xe04\a29U\uff7b\x02\b\u02c8^\xc3\xcd\xf8\xaf\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x94\xa3R\xd3_yv\xcb_\x15\xb1^i\xe9{v\xbb\xd1Z`\x87\x0e\x98r\u065a\xa4d\xd1\xfa\xbd}\f\xb6\xad\u0106\xbd\xdfqY\xe7\xbe\xc0\x17\xeds\x96\xd2\xf4-\u0349\xc1\xdc\u007fw\xdf\xc3]\xa8\x85\xbb\xf3\xf8R\x93Node - asia-east1-0\x9etestnet-asia-east1-0@dexon.org\x8casia-east1-0\x91https://dexon.org\xf8\u05546_\x0f\xb5\x82NlH\xdak\xa5\xae\xeaF\xf4V\xba:q0\xf8\xbe\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x97Ka!\x8a\xa6_\xcd\x00S\xb9\xc5j\x03\x18\x9b\xa9\a\x93p\xba\xbc\x9f\xb5\xf4\xa4y\xe1\x1ac\x1d\x83\xc7.;l[\xdc:G\b\v\x0f\xa6\x0f\xa9Y\xf2\xc7yzeq\x92x\xd2*[k\xa7\x9e\xb2\xb6\xe0\xf8a\x98Node - asia-northeast1-1\xa3testnet-asia-northeast1-1@dexon.org\x91asia-northeast1-1\x91https://dexon.org\xf8\u0554`\xceWCm\x96%\x9f}\x90\u00e7}\xe9&\xb8'*\xf65\xf8\xbe\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\xfa\x90`=Bm\b\x9fx\xbb\b!\a\x05y[\bB\xa1Io\x99$*\x06\x89\x9d{}\u0737\x1f!|\x95h\xa9df\xec\xb1\x14\x12\x91r}A\xc7p\uf843\xa6\xe9\x00Y\x97\xba\x1dT\x9bu\xf2\xcd\xf8a\x98Node - asia-northeast1-0\xa3testnet-asia-northeast1-0@dexon.org\x91asia-northeast1-0\x91https://dexon.org\ua53f\x8cH\xa6 \xba\xccF\x90\u007f\x9b\x89s-%\xe4z-|\xf7\u050b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x80\x80\x80\u0100\x80\x80\x80\xea\x94\xe0\xf8Y4\x03S\x85F\x93\xf57\xea3q\x06\xa3>\x9f\xea\xb0\u050b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x80\x80\x80\u0100\x80\x80\x80\xf8\u0194\xf01\x10\x8e\x17\u04da\x9e\x8d\x8e\xe2a\x81\xe1\x85sF.\xe4\x85\xf8\xaf\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x86\xfbL^Q^oA\b&\xcd\x00@\x10\xb0ly\xe7\xbb\x1f\x95\x89\x8e\x82\xaf\x957\x1c\xac\x9a4\x97s0\x86iN\x9du0\xf1T\u02ebe,\xd9ZE\u015f\x1b \xe9O\u0179RD\vN\xdc\b\xe8\xf8R\x93Node - asia-east1-1\x9etestnet-asia-east1-1@dexon.org\x8casia-east1-1\x91https://dexon.org\xf8\u0554\xf3\xbb\xe2@\x1b\xd0\xcb\xe7\x8ca\xdbc\x92\x84\x81\xf3\xbd\xc2\xfe\x1a\xf8\xbe\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x96\xce\x05\xc4(\xbe%ge\x8e\xb9\x8d\xdf\xdd\xee\x15\xafg\x94\xbe\xabyQ#\xac\xa1n\x8f\u007f\x14\x91\xe53z\x15Q\xe4b]b8@K\xa0\x881\xcbk\xbd~\xce\xf0TU%AW\x14\u01b0\x10\xe6qc\xf8a\x98Node - asia-northeast1-2\xa3testnet-asia-northeast1-2@dexon.org\x91asia-northeast1-2\x91https://dexon.org"
+const yilanAllocData = "\xf9\x053\xf8\xbe\x94\x16\x0f \x11\xbd\xa9w\x8d\xfci\xfb\xd3\v\x1b\x11d\t\xa9\xd2\xf2\xf8\xa7\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04M\xd1\xd4~\x1a\xb9\x9aZc\xb9\xcbD\xed\x8d\xe9\xa9V\xdbr\x14\x94\x89\xb5\xbc|#\xa8\xcc!\"\xf3\xee\xed\x01\x10B\xa8WW\u0570\x0eLz\x91\xdd'\t\x8f^\xa1\xab\x92'zV\x00t\x15\x1c\xf4&#\x93\xf8J\x91Node - us-east1-0\x9ayilan-us-east1-0@dexon.org\x8aus-east1-0\x91https://dexon.org\xf8\u0294>P\xe4\n\u007fE\x9e\xabN\t\x04\xfa\xaaf>r\x8f\x01u,\xf8\xb3\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04k8\xc7\xe3\x1e\xa5E\xd0EC\f\xf4>\x9b\xfc\u057f\x0eEY\x82\xe8\x13\x1c\xd7\x06\x8aK\xae\xaa\xe5\xaeN \v?Ol\xbaO>\x8e\x04J\xad\x88 m!)T]\x10)\xe0\xa4\x1bst\x87\xd5\u01189\xf8V\x95Node - europe-west4-0\x9eyilan-europe-west4-0@dexon.org\x8eeurope-west4-0\x91https://dexon.org\xf8\u04d4\x87\xbc\xba\xd4\u048b\x19\x87>\xed^\xc7c\u021e<\f\xfb\xcf_\xf8\xbc\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04\x16\xfb\xdc,\xc1\x1bN\x1a\xf1\x00$w\uf6cc\xe0\xdf\xe5\x14'\x8f\xa7\xe9@c\xe8\xa7V\xbd\xb1\u0313\x16(U\xb9|J\x87@\\\a4\x94\xdd\x1c\x8f7\xd9\bq\xa9n9\xf1BL,'\x8bO`\x18\xdb\xf8_\x98Node - asia-northeast1-0\xa1yilan-asia-northeast1-0@dexon.org\x91asia-northeast1-0\x91https://dexon.org\xf8\u0114\x88\x1a|\u02426\u0264\xfe\u007fUj\xbc\x90E*\xbfW(\x89\xf8\xad\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04d\xa6,2\xbd;^s,G\x1d\xebv\xd37\\\xf0\x1f\xd32\xc6\f\x14m\xd7\xe9@\xc1\x14\x8c\xe1\x10\x03n\xb4\x8ctz{A\xcf\u0772m\x1f\xfa\xfa\x84\xbdsSq\xd6\xf3\xff#\x1a\x1b\x8e\xf4\x14\u0391\x98\xf8P\x93Node - asia-east1-0\x9cyilan-asia-east1-0@dexon.org\x8casia-east1-0\x91https://dexon.org\xf8\ub510\x8d\xb9<ys\xf1\xa6\xa1{\u05dd\xaa\x9f\xdeL1\x18'L\xf8\u050b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x04E\xa6_\xcaj\x9c\xae+\xa5\xb4\u02f4\xff\x8btR\xbde%\xef\x0f\xfa\x01\u046e~\xd8\x13\xd0+J\x11\xcd6\u02bc)\xb0e\xd0Z\xe2\xfc\"\xb7?l\xa9\xc6]uy\x9c\x00\xe6\x88\xcc\xcc~\x1d\xec\xe8\xcbh\xf8w\xa0Node - northamerica-northeast1-0\xa9yilan-northamerica-northeast1-0@dexon.org\x99northamerica-northeast1-0\x91https://dexon.org\xf8\u01d4\xbd\xbf_Y\x84D[G\xab\x02x\xb3m\x18\xb6r~\xb4\xf9\xf4\xf8\xb0\x8b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x8a\xd3\xc2\x1b\xce\xcc\xed\xa1\x00\x00\x00\x80\xb8A\x044\u86fe\x81Y=_C\xde)S{\xa5N%\xfa\t\x03\xa9\x00C#\x90\xa6\xe9\xab\xd5b\x83\x88^\xcd}\x15\x9d\xf1\xbd\x1b\\B{\xf8z+g\nB\xd6*\xa2\xed$\xact\xcb\xec\x16\xb30GV\"\x94\xf8S\x94Node - us-central1-0\x9dyilan-us-central1-0@dexon.org\x8dus-central1-0\x91https://dexon.org\ua53f\x8cH\xa6 \xba\xccF\x90\u007f\x9b\x89s-%\xe4z-|\xf7\u050b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x80\x80\x80\u0100\x80\x80\x80\xea\x94\xe0\xf8Y4\x03S\x85F\x93\xf57\xea3q\x06\xa3>\x9f\xea\xb0\u050b\x01\xa7\x847\x9d\x99\xdbB\x00\x00\x00\x80\x80\x80\u0100\x80\x80\x80"
diff --git a/core/genesis_test.go b/core/genesis_test.go
index 9db96c271..c083ed9aa 100644
--- a/core/genesis_test.go
+++ b/core/genesis_test.go
@@ -105,6 +105,16 @@ func TestSetupGenesis(t *testing.T) {
wantConfig: params.TestnetChainConfig,
},
{
+ name: "custom block in DB, genesis == yilan",
+ fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
+ customg.MustCommit(db)
+ return SetupGenesisBlock(db, DefaultYilanGenesisBlock())
+ },
+ wantErr: &GenesisMismatchError{Stored: customghash, New: params.YilanGenesisHash},
+ wantHash: params.YilanGenesisHash,
+ wantConfig: params.YilanChainConfig,
+ },
+ {
name: "compatible config in DB",
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
oldcustomg.MustCommit(db)