diff --git a/app/app.go b/app/app.go index 949dcaa12..7480b6b3d 100644 --- a/app/app.go +++ b/app/app.go @@ -114,7 +114,7 @@ const ( Name = "core" // DefaultChainID is the default chain id of the network. - DefaultChainID = constant.ChainIDTest + DefaultChainID = constant.ChainIDMain ) // ChosenNetwork is a hacky solution to pass network config diff --git a/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-krypton.json b/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-krypton.json new file mode 100644 index 000000000..58ff15ed2 --- /dev/null +++ b/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-krypton.json @@ -0,0 +1,94 @@ +{ + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "Krypton", + "identity": "897ADE066F096C16", + "website": "https://coreum.com", + "security_contact": "info@coreum.com", + "details": "" + }, + "commission": { + "rate": "0.200000000000000000", + "max_rate": "0.500000000000000000", + "max_change_rate": "0.050000000000000000" + }, + "min_self_delegation": "20000000000", + "delegator_address": "core1d5wqdp322zn5jyn5mszrrstg2xuq35xyrhsc9f", + "validator_address": "corevaloper1d5wqdp322zn5jyn5mszrrstg2xuq35xyefwa9h", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "nX+XUvinL39Gjte2hMvPuaYoG5ISE224G4zxpgA7DBU=" + }, + "value": { + "denom": "ucore", + "amount": "25000000000" + } + } + ], + "memo": "", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/cosmos.crypto.multisig.LegacyAminoPubKey", + "threshold": 2, + "public_keys": [ + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "ArI3bO+jfhF8jicTqWCuiFJ0z3/DyQJvQ7Mvr2ql5lKW" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "ArSRRMiyr1Rwwq247M/1nzkzwfY/gEIFwB/liDFg8FIj" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "A2MidxM8OUyemp7UycIVNDR2YxEomyfEYtndydqIuBsV" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "AqCFxDHHgy13cbDs1VtKu2W8oqB5XTwQG/ff0CstGiEp" + } + ] + }, + "mode_info": { + "multi": { + "bitarray": { + "extra_bits_stored": 4, + "elems": "UA==" + }, + "mode_infos": [ + { + "single": { + "mode": "SIGN_MODE_LEGACY_AMINO_JSON" + } + }, + { + "single": { + "mode": "SIGN_MODE_LEGACY_AMINO_JSON" + } + } + ] + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "0", + "payer": "", + "granter": "" + } + }, + "signatures": [ + "CkBfDhX8wr3CetkC3HL3HBllPGZq3RAiFZINvaFkw9KvlDFRd4WD4cZ1H4lmurt3iy8Be/OaGAteNn9iPDuuwmouCkBHR6D+NbifDq+l5Sz8S6ueoLhpe3EXruLmDCF4YD44mwKr6OPMwG1Eg4+JCEWQUxpoE+qMFGRXNbqP28Gn4HyE" + ] +} diff --git a/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-neon.json b/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-neon.json new file mode 100644 index 000000000..6a78db0c5 --- /dev/null +++ b/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-neon.json @@ -0,0 +1,94 @@ +{ + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "Neon", + "identity": "4981CEE4B68235C1", + "website": "https://coreum.com", + "security_contact": "info@coreum.com", + "details": "" + }, + "commission": { + "rate": "0.200000000000000000", + "max_rate": "0.500000000000000000", + "max_change_rate": "0.050000000000000000" + }, + "min_self_delegation": "20000000000", + "delegator_address": "core15cpygjlf7pgfnqlc8uz9eryspwd0pwk3xrup8h", + "validator_address": "corevaloper15cpygjlf7pgfnqlc8uz9eryspwd0pwk3uazy8f", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "NmlVDhY/1IlsfuKvgrZYGKjKQ7bMKhmdFtUX8Xqndoc=" + }, + "value": { + "denom": "ucore", + "amount": "25000000000" + } + } + ], + "memo": "", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/cosmos.crypto.multisig.LegacyAminoPubKey", + "threshold": 2, + "public_keys": [ + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "AnUzW05rNkd2L2nVJSLGw4aSmCognSXf3QlIgcl4Prwo" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "Ak/j9mCi12TrCBn9PvP+S98Y9LovdExUW9M0Nh+OMd1D" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "AtRT9lbzQPrz8OVWIJMFOdF/swm+S320XVryY9qtUzcj" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "At/R9OcXOK5I12Ps7gdjCZtzJ6Y5fIHYNS0X49YWVroQ" + } + ] + }, + "mode_info": { + "multi": { + "bitarray": { + "extra_bits_stored": 4, + "elems": "wA==" + }, + "mode_infos": [ + { + "single": { + "mode": "SIGN_MODE_LEGACY_AMINO_JSON" + } + }, + { + "single": { + "mode": "SIGN_MODE_LEGACY_AMINO_JSON" + } + } + ] + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "0", + "payer": "", + "granter": "" + } + }, + "signatures": [ + "CkBtRbGp6yw/jImK6vjZb/anylO5ZBOxJcStWgquZmtZgkCHisoURPTDNGhY9E4Z6NjAFNm5cllV1Lx5VuhgQfOYCkBKFrTKc5Yx2zhPHA8tVw2XFzS+aXrGlgtFBDd2zuTazwhgX8DwqnAabXHWt7MTp3VF9USqNCbeBPxfYFjRITJx" + ] +} diff --git a/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-radon.json b/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-radon.json new file mode 100644 index 000000000..b2c55fd1c --- /dev/null +++ b/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-radon.json @@ -0,0 +1,94 @@ +{ + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "Radon", + "identity": "B95D04A81F6194A1", + "website": "https://coreum.com", + "security_contact": "info@coreum.com", + "details": "" + }, + "commission": { + "rate": "0.200000000000000000", + "max_rate": "0.500000000000000000", + "max_change_rate": "0.050000000000000000" + }, + "min_self_delegation": "20000000000", + "delegator_address": "core1zmhfe2hh4qmg54gpsyw8n35gayx3a85mqlfzgk", + "validator_address": "corevaloper1zmhfe2hh4qmg54gpsyw8n35gayx3a85m6ph8gg", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "obywVL0ZEhECvvKLYbOnMPkL5+/fD4oD5xX/BhxC0o8=" + }, + "value": { + "denom": "ucore", + "amount": "25000000000" + } + } + ], + "memo": "", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/cosmos.crypto.multisig.LegacyAminoPubKey", + "threshold": 2, + "public_keys": [ + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "Aq464vu82bSrnsJ3psrxvX8ebVOvH0fRqrj3JOpC2tbI" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "A2QRVQk1slBv7OfpzWsvsmXv56L8SvniFb1mTjKiI7m9" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "A8TsqugCVpTCDawQDBUII/e6uWOiqgMklDEZuBMsjAnS" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "AtJDvkogIAsyAVs5d8OOqwLeRagyd/P1s0lCPAAgSyJn" + } + ] + }, + "mode_info": { + "multi": { + "bitarray": { + "extra_bits_stored": 4, + "elems": "MA==" + }, + "mode_infos": [ + { + "single": { + "mode": "SIGN_MODE_LEGACY_AMINO_JSON" + } + }, + { + "single": { + "mode": "SIGN_MODE_LEGACY_AMINO_JSON" + } + } + ] + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "0", + "payer": "", + "granter": "" + } + }, + "signatures": [ + "CkCnXJ/iwhkkShK/xQuEeJql4GU8ra0pJz4To8TZKb7aJlLZuStrmWvWLapF7FZ0sCRUBCSka349EnKHszAhCYbZCkD1MqUrVzDY/uIPDE1qYsBzj/X7qLUJFpzwSq2vRBzu9Q8xQffr05CTKPGKphm5x0TvUcXHkQ5gM3eMbFNn/NLl" + ] +} diff --git a/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-xenon.json b/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-xenon.json new file mode 100644 index 000000000..ee3b1df4d --- /dev/null +++ b/pkg/config/genesis/gentx/coreum-mainnet-1/signed-create-validator-xenon.json @@ -0,0 +1,94 @@ +{ + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "Xenon", + "identity": "C518FC70EC2D09B9", + "website": "https://coreum.com", + "security_contact": "info@coreum.com", + "details": "" + }, + "commission": { + "rate": "0.200000000000000000", + "max_rate": "0.500000000000000000", + "max_change_rate": "0.050000000000000000" + }, + "min_self_delegation": "20000000000", + "delegator_address": "core1hsmhywnkehyyv8muzswhdumzztae4hq4k3dj8p", + "validator_address": "corevaloper1hsmhywnkehyyv8muzswhdumzztae4hq4v0nh8l", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "aFP9hXYFsmjHr2dO6H5SQ7sUSiVBMaa9VBgPDs+BtKo=" + }, + "value": { + "denom": "ucore", + "amount": "25000000000" + } + } + ], + "memo": "", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/cosmos.crypto.multisig.LegacyAminoPubKey", + "threshold": 2, + "public_keys": [ + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "A/RAaZADO8/nkSKuSuQL2QAhIWWTPwG8SipA3j+7tHAd" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "Aoevvboi3Nhcr9CokjdEJBso1ol9wZOslnMbujF3nwUj" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "AomZgmN/EjDgEutJtI4q3BUlCRqwkvBWdVdPdo4+aY1B" + }, + { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "A9+ERAg28nOVR4JM3gnMLLFBEXiVzmyOauDrobjOh+6m" + } + ] + }, + "mode_info": { + "multi": { + "bitarray": { + "extra_bits_stored": 4, + "elems": "YA==" + }, + "mode_infos": [ + { + "single": { + "mode": "SIGN_MODE_LEGACY_AMINO_JSON" + } + }, + { + "single": { + "mode": "SIGN_MODE_LEGACY_AMINO_JSON" + } + } + ] + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "0", + "payer": "", + "granter": "" + } + }, + "signatures": [ + "CkC5M9b8tyh/1IIKkc2ToYK9utaZ6wnVzt+gsmmFcgipyHk4C0DL6GIGcOkpbsvP9ff6XU311wuH4dLnLu70D1ljCkDjVC02ryq2BAYKgyirDXufwhytI5C63ao6IXcNz7aauFp2i0qZGwEX+x181/8tV53Kxt0UXRyih+1A/Klj1iKT" + ] +} diff --git a/pkg/config/network.go b/pkg/config/network.go index f623a4165..4f89851a9 100644 --- a/pkg/config/network.go +++ b/pkg/config/network.go @@ -35,14 +35,17 @@ var ( // It is string, not bool, because -X flag supports strings only. EnableFakeUpgradeHandler string - //go:embed genesis/gentx/coreum-devnet-1 - devGenTxsFS embed.FS + //go:embed genesis/genesis.tmpl.json + genesisTemplate string + + //go:embed genesis/gentx/coreum-mainnet-1 + mainGenTxsFS embed.FS //go:embed genesis/gentx/coreum-testnet-1 testGenTxsFS embed.FS - //go:embed genesis/genesis.tmpl.json - genesisTemplate string + //go:embed genesis/gentx/coreum-devnet-1 + devGenTxsFS embed.FS networkConfigs map[constant.ChainID]NetworkConfig ) @@ -85,19 +88,18 @@ func init() { // mainnet vars // CORE allocation: - // 500M = (99_880_000 + 120_000) + 4 * 100_000_000 - // In total 6 wallets will be created in genesis: - // where 120_000 is a balance of wallet to create genesis validators. - // where 99_880_000 is a balance of foundation-0 wallet. - // where 4 * 100_000_000 is a balance of each of foundation-{1-4} wallets. - mainGenesisValidatorsCreatorBalance := sdk.NewCoins(sdk.NewCoin(constant.DenomMain, sdk.NewInt(120_000_000_000))) - - mainFoundationZeroInitialBalance := sdk.NewCoins(sdk.NewCoin(constant.DenomMain, sdk.NewInt(99_880_000_000_000))) + // 500M = (4 * 25_000 + 99_900_000) + 4 * 100_000_000 + // In total 8 wallets will be created in genesis: + // where 4 * 25_000 is a balance of each of 4 wallet used to create genesis validators. + // where 99_900_000 is a balance of foundation-0 wallet. + // where 4 * 100_000_000 is a balance of each of remaining 4 foundation wallets. + mainGenesisValidatorCreatorBalance := sdk.NewCoins(sdk.NewCoin(constant.DenomMain, sdk.NewInt(25_000_000_000))) + + mainFoundationZeroInitialBalance := sdk.NewCoins(sdk.NewCoin(constant.DenomMain, sdk.NewInt(99_900_000_000_000))) mainFoundationOtherInitialBalance := sdk.NewCoins(sdk.NewCoin(constant.DenomMain, sdk.NewInt(100_000_000_000_000))) // testnet vars - // TODO: Add test that total supply (sum of amounts funded) is always 500M. // 500M = 4 * (124_950_000 + 50_000) // where 124_950_000 is a balance of each of 4 initial foundation wallets. // where 50_000 is balances of each of 4 initial validator stakers. @@ -119,14 +121,15 @@ func init() { networkConfigs = map[constant.ChainID]NetworkConfig{ constant.ChainIDMain: { ChainID: constant.ChainIDMain, - GenesisTime: time.Date(2023, 3, 7, 12, 0, 0, 0, time.UTC), + GenesisTime: time.Date(2023, 3, 12, 0, 0, 0, 0, time.UTC), AddressPrefix: constant.AddressPrefixMain, MetadataDisplayDenom: constant.DenomMainDisplay, Denom: constant.DenomMain, Fee: feeConfig, NodeConfig: NodeConfig{ SeedPeers: []string{ - // TODO: Add seeds. + "0df493af80fbaad41b9b26d6f4520b39ceb1d210@34.171.208.193:26657", // seed-iron + "cba16f4f32707d70a2a2d10861fac897f1e9aaa1@34.72.150.107:26657", // seed-nickle }, }, GovConfig: govConfig, @@ -135,39 +138,53 @@ func init() { AssetFTConfig: assetFTConfig, AssetNFTConfig: assetNFTConfig, FundedAccounts: []FundedAccount{ - // TODO: Replace with real addresses. - // genesis-validators-creator: 120k + // coreum-krypton genesis-validators-creator: 25k + { + Address: "core1d5wqdp322zn5jyn5mszrrstg2xuq35xyrhsc9f", + Balances: mainGenesisValidatorCreatorBalance, + }, + // coreum-neon genesis-validators-creator: 25k + { + Address: "core15cpygjlf7pgfnqlc8uz9eryspwd0pwk3xrup8h", + Balances: mainGenesisValidatorCreatorBalance, + }, + // coreum-radon genesis-validators-creator: 25k + { + Address: "core1zmhfe2hh4qmg54gpsyw8n35gayx3a85mqlfzgk", + Balances: mainGenesisValidatorCreatorBalance, + }, + // coreum-xenon genesis-validators-creator: 25k { - Address: "core1jkunqvllae563tfdjles7ys9dzm98rf0qzsraa", - Balances: mainGenesisValidatorsCreatorBalance, + Address: "core1hsmhywnkehyyv8muzswhdumzztae4hq4k3dj8p", + Balances: mainGenesisValidatorCreatorBalance, }, - // foundation-0: 99_880_000 + // coreum-foundation-0: 99_900_000 { - Address: "core1jkunqvllae563tfdjles7ys9dzm98rf0qzsraa", + Address: "core13xmyzhvl02xpz0pu8v9mqalsvpyy7wvs9q5f90", Balances: mainFoundationZeroInitialBalance, }, - // foundation-1: 100M + // coreum-foundation-1: 100M { - Address: "core1jkunqvllae563tfdjles7ys9dzm98rf0qzsraa", + Address: "core14g6wpzdx8g9txvxxu3fl7fplal9y5ztx34ac5p", Balances: mainFoundationOtherInitialBalance, }, - // foundation-2: 100M + // coreum-foundation-2: 100M { - Address: "core1jkunqvllae563tfdjles7ys9dzm98rf0qzsraa", + Address: "core1zn2ns3ls68jlsv5dgkuz0rxsxt5fhk7n9cfl23", Balances: mainFoundationOtherInitialBalance, }, - // foundation-3: 100M + // coreum-foundation-3: 100M { - Address: "core1jkunqvllae563tfdjles7ys9dzm98rf0qzsraa", + Address: "core1p4gsfkmqm0uxua65phteqwnmu39fwjvtspfkcj", Balances: mainFoundationOtherInitialBalance, }, - // foundation-4: 100M + // coreum-foundation-4: 100M { - Address: "core1jkunqvllae563tfdjles7ys9dzm98rf0qzsraa", + Address: "core1rddqzjzy4f5frxkhds3sux0m03encqtla3ayu9", Balances: mainFoundationOtherInitialBalance, }, }, - GenTxs: []json.RawMessage{}, // TODO: Add real transactions. + GenTxs: readGenTxs(mainGenTxsFS), }, constant.ChainIDTest: { ChainID: constant.ChainIDTest, diff --git a/pkg/config/network_test.go b/pkg/config/network_test.go index fdc96eda4..ba4bdcacf 100644 --- a/pkg/config/network_test.go +++ b/pkg/config/network_test.go @@ -169,11 +169,6 @@ func TestValidateAllGenesis(t *testing.T) { encCfg := config.NewEncodingConfig(app.ModuleBasics) for _, n := range config.Networks() { - if n.ChainID() == constant.ChainIDMain { - // TODO: Currently mainnet genesis is invalid. - continue - } - unsealConfig() n.SetSDKConfig() genesisJSON, err := n.EncodeGenesis() @@ -225,14 +220,17 @@ func TestGenesisHash(t *testing.T) { wantHash string }{ { - name: "testnet", + chainID: constant.ChainIDMain, + wantHash: "f26ff015245b674641c7b197d40669b4f55e9da8a3a60a831c79e8c37d034a4c", + }, + { chainID: constant.ChainIDTest, wantHash: "12273f3e0bc97e848cccdc67225a3d7c54c42243d6ec7f01a7bcfc4ede63cacd", }, } for _, tt := range tests { tt := tt - t.Run(tt.name, func(t *testing.T) { + t.Run(string(tt.chainID), func(t *testing.T) { n, err := config.NetworkByChainID(tt.chainID) require.NoError(t, err)