Skip to content

Commit

Permalink
feat(cli): support odyssey testnet (#178)
Browse files Browse the repository at this point in the history
support `--odyssey` flag for automatic generate config and key

issue: none

---------

Signed-off-by: lutty <[email protected]>
  • Loading branch information
LuttyYang authored Oct 17, 2024
1 parent 46dabe3 commit 7c04757
Show file tree
Hide file tree
Showing 7 changed files with 690 additions and 2 deletions.
2 changes: 2 additions & 0 deletions client/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ func InitFiles(ctx context.Context, initCfg InitConfig) error {
switch {
case network == netconf.Iliad:
cfg = storycfg.IliadConfig
case network == netconf.Odyssey:
cfg = storycfg.OdysseyConfig
case network == netconf.Local:
cfg = storycfg.LocalConfig
default:
Expand Down
21 changes: 21 additions & 0 deletions client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ var (
Seeds: "",
SeedMode: false,
}
OdysseyConfig = Config{
HomeDir: DefaultHomeDir(),
Network: "odyssey",
EngineEndpoint: DefaultEngineEndpoint,
EngineJWTFile: DefaultJWTFile("odyssey"),
SnapshotInterval: defaultSnapshotInterval,
SnapshotKeepRecent: defaultSnapshotKeepRecent,
BackendType: string(defaultDBBackend),
MinRetainBlocks: defaultMinRetainBlocks,
PruningOption: pruningtypes.PruningOptionDefault,
EVMBuildDelay: defaultEVMBuildDelay,
EVMBuildOptimistic: false,
APIEnable: false,
APIAddress: "127.0.0.1:1317",
EnableUnsafeCORS: false,
Tracer: tracer.DefaultConfig(),
RPCLaddr: "tcp://127.0.0.1:26657",
ExternalAddress: "",
Seeds: "",
SeedMode: false,
}
LocalConfig = Config{
HomeDir: DefaultHomeDir(),
Network: "local",
Expand Down
3 changes: 3 additions & 0 deletions lib/evmchain/evmchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const (
// Testnets.
IDIliad uint64 = 1513

// Odyssey Testnets.
IDOdyssey uint64 = 1516

storyEVMName = "story_evm"
storyEVMBlockPeriod = time.Second * 2

Expand Down
8 changes: 6 additions & 2 deletions lib/netconf/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ const (

// Used for local network testing.
Local ID = "local"

// Odyssey is the official Story Protocol public testnet.
Odyssey ID = "odyssey"
)

// supported is a map of supported networks.
//
//nolint:gochecknoglobals // Global state here is fine.
var supported = map[ID]bool{
Iliad: true,
Local: true,
Iliad: true,
Odyssey: true,
Local: true,
}

// IsAny returns true if the `ID` matches any of the provided targets.
Expand Down
Loading

0 comments on commit 7c04757

Please sign in to comment.