Skip to content

Commit

Permalink
feat(testnet): define permanent Testent genesis (#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
themantre authored Mar 15, 2024
1 parent 1e3304d commit 23bfa48
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 19 deletions.
7 changes: 6 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ func DefaultConfigMainnet() *Config {

func DefaultConfigTestnet() *Config {
conf := defaultConfig()
conf.Network.DefaultBootstrapAddrStrings = []string{}
conf.Network.DefaultBootstrapAddrStrings = []string{
"/dns/testnet1.pactus.org/tcp/21777/p2p/12D3KooWR7ZB3nGih1Fz7Yg83Zap8Cpxr73T6PPihBsEpTG5BZyk",
"/dns/testnet2.pactus.org/tcp/21777/p2p/12D3KooWQcDuFDMGsw6gG7oNFw7C4x7ozoMu69J7WEAojKCaNzji",
"/dns/testnet3.pactus.org/tcp/21777/p2p/12D3KooWLsAPSJ4xowd9thGbPmbweBT6sg3nEiPjDJccaWZacsUR",
"/dns/testnet4.pactus.org/tcp/21777/p2p/12D3KooWJKYdHzWZGibnj74NSSgKRu4Ez6MijDWMfLfXxeL4un6v",
}
conf.Network.MaxConns = 64
conf.Network.EnableNATService = false
conf.Network.EnableUPnP = false
Expand Down
8 changes: 4 additions & 4 deletions genesis/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ func TestGenesisTestnet(t *testing.T) {

gen := genesis.TestnetGenesis()
assert.Equal(t, len(gen.Validators()), 4)
assert.Equal(t, len(gen.Accounts()), 2)
assert.Equal(t, len(gen.Accounts()), 5)

genTime, _ := time.Parse("2006-01-02", "2023-10-15")
expected, _ := hash.FromString("da602b28f75902c35e3bafeb5733a686c94d5508c92aae68cbd9b37d81cfccf4")
genTime, _ := time.Parse("2006-01-02", "2024-03-16")
expected, _ := hash.FromString("13f96e6fbc9e0de0d53537ac5e894fc8e66be1600436db2df1511dc30696e822")
assert.Equal(t, gen.Hash(), expected)
assert.Equal(t, gen.GenesisTime(), genTime)
assert.Equal(t, gen.Params().BondInterval, uint32(120))
assert.Equal(t, gen.Params().BondInterval, uint32(360))
assert.Equal(t, gen.ChainType(), genesis.Testnet)
assert.Equal(t, gen.TotalSupply(), int64(42*1e15))

Expand Down
36 changes: 24 additions & 12 deletions genesis/testnet.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"genesis_time": "2023-10-15T00:00:00Z",
"genesis_time": "2024-03-16T00:00:00Z",
"params": {
"block_version": 1,
"block_interval_in_second": 10,
"committee_size": 51,
"block_reward": 1000000000,
"transaction_to_live_interval": 2880,
"bond_interval": 120,
"unbond_interval": 60480,
"transaction_to_live_interval": 8640,
"bond_interval": 360,
"unbond_interval": 181440,
"sortition_interval": 17,
"fee_fraction": 0.0001,
"minimum_fee": 1000,
"maximum_fee": 1000000,
"minimum_stake": 0,
"minimum_stake": 1000000000,
"maximum_stake": 1000000000000
},
"accounts": [
Expand All @@ -21,22 +21,34 @@
"balance": 21000000000000000
},
{
"address": "tpc1zwrzfhge53z0ydey2hz6zca7tjfznmr58xmhh67",
"balance": 21000000000000000
"address": "tpc1zeszhgvffmf2fx7arpp935n40ek09kx200evaga",
"balance": 8400000000000000
},
{
"address": "tpc1z76trjq323tp8cs2staa4vnhaegpxaqc8zm7uzk",
"balance": 6300000000000000
},
{
"address": "tpc1zty5pa3x0h879r5zdze6tat4exu97l4y2hyplkm",
"balance": 4200000000000000
},
{
"address": "tpc1zq6r4qjkgdn7qg7fdnusa9wsvepc94xeqd6rf6d",
"balance": 2100000000000000
}
],
"validators": [
{
"public_key": "tpublic1pksusffz7832s6hwyanjh5ujldq25gexmycsq59m9afwn78w0unfu2p7qzzljvzy8dkc2tp3039k3yqvvwd72g23ujxe2uuxhjvus08st47mxfp34d4pdlazwk2ntutzu8l9xu466cu0hzvgas3ddy9j00c2ewaky"
"public_key": "tpublic1ps5e3k3x9v3q0wdgw48sswx5za45w36fkeay8hkcwhgpl3q3w8zqs4uu7ewzhn537d5pnkmum3lf0yzqk9f2sld0qcl3700y372jxcjmt3kjzmfehru29z6ak7ehfmzh0965kgzdanptm7jnf89zvtkglzymnlq6q"
},
{
"public_key": "tpublic1p4g3h7pgcs74d8afncr6vus3zddv0ze7gar89l9326gx5y42fd229lercktqeq2lzy3ruspvpls0rkzkclyryljzar2q46r93nuf0pl7sumwu39vv5nxtsfhm8jj4ef0xf7pftv3q4e4y94gcdaqf9cxh8s8zhyxy"
"public_key": "tpublic1p49mvzl9ray2rfhwg77ne7m457qlc5knpv897skqnkgfa3luluzq784hf7px30r68knhnhp5td5gayz8ss72dyfxgq8kk2qqm0y86tqsmzss8dvfn433z9j3g0saqhahzcw37f8wy48edrqh6qkf6h9yr4gg8093c"
},
{
"public_key": "tpublic1pjd8zewq8m7xxqxt22u9k287c6dlx5pf7kdwf2f5c6vnaj8lu9cr7ttt4rzmgnqc0j3xqrvz5mmfew9xjrfqxfa68ha0uq7znmqvs9ykmmzf3nl38yfxua0updrdnudqtv0zx67k8rlndyl39pqespg95zuz9uukc"
"public_key": "tpublic1p3yyfsjdudntxlr6k5hdt249wxe6ajfnnkg6knklzt8lmj66s8z4j2duqk7qay8n8d47u0n6w97c8qrwwkljewqqw3t3ufy662llqflcq9nn6wsg35twdc3l5vn72j4ez50s982fxxh6per6hftn3e2v7fgm4gx35"
},
{
"public_key": "tpublic1p5x2hzaskgy9rulqmgy2wdkfkkaj7p5hsgqjqtwaf67x9xkszdrrf06f3038x0xwyjpecjsffkdkw5xx9k7v89vga23afg45sclsm4l7kufung5wzc6y8lvh0em7t9v3y7mxncg3y8u4fh3zlsm0ql45lgs4navjn"
"public_key": "tpublic1pjy7z27zm6795xhj8rln65cve88dtqjkg7gca6scxzwwfxpncnmkhg35n2rw3fa9e04cqcc8c9fyqvpm7y39wj0x2e5qrl0he60ms6v79vga3le2uvgn566p7x9exjnyhh3klycqddstj7339afnm73k09v8k52uy"
}
]
}
}
20 changes: 18 additions & 2 deletions wallet/servers.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,23 @@
"testnet": [
{
"ip": "localhost:50052",
"name": "testnet-1"
"name": "localhost"
},
{
"ip": "testnet1.pactus.org:50051",
"name": "testnet1"
},
{
"ip": "testnet2.pactus.org:50051",
"name": "testnet2"
},
{
"ip": "testnet3.pactus.org:50051",
"name": "testnet3"
},
{
"ip": "testnet4.pactus.org:50051",
"name": "testnet4"
}
]
}
}

0 comments on commit 23bfa48

Please sign in to comment.