Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(netconf): rename mainnet to story #430

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion client/config/config.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

#######################################################################
Expand Down
2 changes: 1 addition & 1 deletion client/config/testdata/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

#######################################################################
Expand Down
12 changes: 6 additions & 6 deletions contracts/script/GenerateAlloc.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/evmchain/evmchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
type Token string

const (
// Mainnets.
IDStoryMainnet uint64 = 1415
// Story Mainnet.
IDStory uint64 = 1415

// Local Testet.
IDLocal uint64 = 1511
Expand Down
2 changes: 1 addition & 1 deletion lib/netconf/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
6 changes: 3 additions & 3 deletions lib/netconf/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions lib/netconf/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
},
}
File renamed without changes.
File renamed without changes.
Loading