From 1877bdc5689f1c4f5cfb1b73c1f7f868565be276 Mon Sep 17 00:00:00 2001 From: Hans Lee <38912532+0xHansLee@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:41:52 +0900 Subject: [PATCH] chore(netconf): rename mainnet to story (#430) rename mainnet to story. issue: none --- client/cmd/init.go | 4 ++-- client/config/config.go | 6 +++--- client/config/config.toml.tmpl | 2 +- client/config/testdata/default.toml | 2 +- contracts/script/GenerateAlloc.s.sol | 12 ++++++------ lib/evmchain/evmchain.go | 4 ++-- lib/netconf/flag.go | 2 +- lib/netconf/network.go | 6 +++--- lib/netconf/static.go | 16 ++++++++-------- lib/netconf/{mainnet => story}/genesis.json | 0 lib/netconf/{mainnet => story}/seeds.txt | 0 11 files changed, 27 insertions(+), 27 deletions(-) rename lib/netconf/{mainnet => story}/genesis.json (100%) rename lib/netconf/{mainnet => story}/seeds.txt (100%) diff --git a/client/cmd/init.go b/client/cmd/init.go index b7aa8407..37c2bc01 100644 --- a/client/cmd/init.go +++ b/client/cmd/init.go @@ -111,8 +111,8 @@ func InitFiles(ctx context.Context, initCfg InitConfig) error { cfg = storycfg.IliadConfig case network == netconf.Odyssey: cfg = storycfg.OdysseyConfig - case network == netconf.Mainnet: - cfg = storycfg.MainnetConfig + case network == netconf.Story: + cfg = storycfg.StoryConfig case network == netconf.Local: cfg = storycfg.LocalConfig default: diff --git a/client/config/config.go b/client/config/config.go index 01404e7d..0ad23add 100644 --- a/client/config/config.go +++ b/client/config/config.go @@ -81,11 +81,11 @@ var ( Seeds: "", SeedMode: false, } - MainnetConfig = Config{ + StoryConfig = Config{ HomeDir: DefaultHomeDir(), - Network: "mainnet", + Network: "story", EngineEndpoint: DefaultEngineEndpoint, - EngineJWTFile: DefaultJWTFile("mainnet"), + EngineJWTFile: DefaultJWTFile("story"), SnapshotInterval: defaultSnapshotInterval, SnapshotKeepRecent: defaultSnapshotKeepRecent, BackendType: string(defaultDBBackend), diff --git a/client/config/config.toml.tmpl b/client/config/config.toml.tmpl index c8d77a63..dc452864 100644 --- a/client/config/config.toml.tmpl +++ b/client/config/config.toml.tmpl @@ -5,7 +5,7 @@ # last modified the config file. Do not modify this. version = "{{ .Version }}" -# Story network to participate in: mainnet, testnet, or devnet. +# Story network to participate in: story, odyssey, or local. network = "{{ .Network }}" ####################################################################### diff --git a/client/config/testdata/default.toml b/client/config/testdata/default.toml index 7492bb0d..5445fc88 100644 --- a/client/config/testdata/default.toml +++ b/client/config/testdata/default.toml @@ -5,7 +5,7 @@ # last modified the config file. Do not modify this. version = "v0.1.5" -# Story network to participate in: mainnet, testnet, or devnet. +# Story network to participate in: story, odyssey, or local. network = "" ####################################################################### diff --git a/contracts/script/GenerateAlloc.s.sol b/contracts/script/GenerateAlloc.s.sol index 36c60472..dbdf2354 100644 --- a/contracts/script/GenerateAlloc.s.sol +++ b/contracts/script/GenerateAlloc.s.sol @@ -49,7 +49,7 @@ contract GenerateAlloc is Script { string internal dumpPath = getDumpPath(); bool public saveState = true; - uint256 public constant MAINNET_CHAIN_ID = 1415; // TBD + uint256 public constant STORY_CHAIN_ID = 1415; // Story mainnet chain ID. TBD // Optionally allocate 10k test accounts for devnets/testnets bool private constant ALLOCATE_10K_TEST_ACCOUNTS = false; // Optionally keep the timelock admin role for testnets @@ -81,8 +81,8 @@ contract GenerateAlloc is Script { return "./odyssey-testnet-alloc.json"; } else if (block.chainid == 31337) { return "./local-alloc.json"; - } else if (block.chainid == MAINNET_CHAIN_ID) { - return "./mainnet-alloc.json"; + } else if (block.chainid == STORY_CHAIN_ID) { + return "./story-alloc.json"; } else { revert("Unsupported chain id"); } @@ -153,7 +153,7 @@ contract GenerateAlloc is Script { } require(timelockGuardian != address(0), "canceller not set"); - if (block.chainid == MAINNET_CHAIN_ID) { + if (block.chainid == STORY_CHAIN_ID) { require(!KEEP_TIMELOCK_ADMIN_ROLE, "Timelock admin role not allowed on mainnet"); } else { console2.log("Will timelock admin role be assigned?", KEEP_TIMELOCK_ADMIN_ROLE); @@ -410,7 +410,7 @@ contract GenerateAlloc is Script { // Story's IPGraph precompile vm.deal(0x0000000000000000000000000000000000000101, 1); // Allocation - if (block.chainid == MAINNET_CHAIN_ID) { + if (block.chainid == STORY_CHAIN_ID) { // TBD } else if (block.chainid == 1315) { // Odyssey devnet alloc @@ -444,7 +444,7 @@ contract GenerateAlloc is Script { vm.deal(0x64a2fdc6f7CD8AA42e0bb59bf80bC47bFFbe4a73, 100000000 ether); } // Test for big allocations - if (ALLOCATE_10K_TEST_ACCOUNTS && block.chainid != MAINNET_CHAIN_ID) { + if (ALLOCATE_10K_TEST_ACCOUNTS && block.chainid != STORY_CHAIN_ID) { setTestAllocations(); } } diff --git a/lib/evmchain/evmchain.go b/lib/evmchain/evmchain.go index 4abb9db7..e90d3e18 100644 --- a/lib/evmchain/evmchain.go +++ b/lib/evmchain/evmchain.go @@ -8,8 +8,8 @@ import ( type Token string const ( - // Mainnets. - IDStoryMainnet uint64 = 1415 + // Story Mainnet. + IDStory uint64 = 1415 // Local Testet. IDLocal uint64 = 1511 diff --git a/lib/netconf/flag.go b/lib/netconf/flag.go index 514ff989..69eb68a6 100644 --- a/lib/netconf/flag.go +++ b/lib/netconf/flag.go @@ -4,5 +4,5 @@ import "github.com/spf13/pflag" // BindFlag binds the network identifier flag. func BindFlag(flags *pflag.FlagSet, network *ID) { - flags.StringVar((*string)(network), "network", string(*network), "Story network to participate in: mainnet, testnet, devnet") + flags.StringVar((*string)(network), "network", string(*network), "Story network to participate in: story, odyssey, or local") } diff --git a/lib/netconf/network.go b/lib/netconf/network.go index 8de81a05..94133a6b 100644 --- a/lib/netconf/network.go +++ b/lib/netconf/network.go @@ -36,8 +36,8 @@ const ( // Odyssey is the official Story Protocol public testnet. Odyssey ID = "odyssey" - // Mainnet is the official Story Protocol public mainnet. - Mainnet ID = "mainnet" + // Story is the official Story Protocol mainnet. + Story ID = "story" ) // supported is a map of supported networks. @@ -47,7 +47,7 @@ var supported = map[ID]bool{ Iliad: true, Odyssey: true, Local: true, - Mainnet: true, + Story: true, } // IsAny returns true if the `ID` matches any of the provided targets. diff --git a/lib/netconf/static.go b/lib/netconf/static.go index 742b9a73..bcfcc1d3 100644 --- a/lib/netconf/static.go +++ b/lib/netconf/static.go @@ -73,11 +73,11 @@ var ( //nolint:gochecknoglobals // Static addresses var ( - //go:embed mainnet/genesis.json - mainnetConsensusGenesisJSON []byte + //go:embed story/genesis.json + storyConsensusGenesisJSON []byte - //go:embed mainnet/seeds.txt - mainnetConsensusSeedsTXT []byte + //go:embed story/seeds.txt + storyConsensusSeedsTXT []byte ) //nolint:gochecknoglobals // Static mappings. @@ -100,10 +100,10 @@ var statics = map[ID]Static{ ConsensusGenesisJSON: odysseyConsensusGenesisJSON, ConsensusSeedTXT: odysseyConsensusSeedsTXT, }, - Mainnet: { + Story: { Version: "v0.0.1", - StoryExecutionChainID: evmchain.IDStoryMainnet, - ConsensusGenesisJSON: mainnetConsensusGenesisJSON, - ConsensusSeedTXT: mainnetConsensusSeedsTXT, + StoryExecutionChainID: evmchain.IDStory, + ConsensusGenesisJSON: storyConsensusGenesisJSON, + ConsensusSeedTXT: storyConsensusSeedsTXT, }, } diff --git a/lib/netconf/mainnet/genesis.json b/lib/netconf/story/genesis.json similarity index 100% rename from lib/netconf/mainnet/genesis.json rename to lib/netconf/story/genesis.json diff --git a/lib/netconf/mainnet/seeds.txt b/lib/netconf/story/seeds.txt similarity index 100% rename from lib/netconf/mainnet/seeds.txt rename to lib/netconf/story/seeds.txt