Skip to content

Commit

Permalink
deploy mainnet contarct and add mainnet config (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhiran authored Jan 17, 2025
1 parent 3aaa301 commit f94e5a1
Show file tree
Hide file tree
Showing 6 changed files with 1,461 additions and 4 deletions.
1 change: 0 additions & 1 deletion e2e/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func apiNodeInit(chDSN, dbFile, chainEndpoint string, contractDeployments *servi
TaskAggregatorIntervalSecond: 1,
ProverServiceEndpoint: "localhost:9002",
DatabaseDSN: chDSN,
PrvKey: "",
ChainEndpoint: chainEndpoint,
BeginningBlockNumber: 0,
ProjectContractAddr: contractDeployments.WSProject,
Expand Down
18 changes: 16 additions & 2 deletions service/apinode/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type Config struct {
TaskAggregatorIntervalSecond uint64 `env:"TASK_AGGREGATOR_INTERVAL_SECOND,optional"`
ProverServiceEndpoint string `env:"PROVER_SERVICE_ENDPOINT"`
DatabaseDSN string `env:"DATABASE_DSN"`
PrvKey string `env:"PRIVATE_KEY,optional"`
ChainEndpoint string `env:"CHAIN_ENDPOINT,optional"`
BeginningBlockNumber uint64 `env:"BEGINNING_BLOCK_NUMBER,optional"`
ProjectContractAddr string `env:"PROJECT_CONTRACT_ADDRESS,optional"`
Expand All @@ -30,7 +29,6 @@ var defaultTestnetConfig = &Config{
SequencerServiceEndpoint: "localhost:9001",
TaskAggregatorIntervalSecond: 1,
ProverServiceEndpoint: "localhost:9002",
PrvKey: "dbfe03b0406549232b8dccc04be8224fcc0afa300a33d4f335dcfdfead861c85",
ChainEndpoint: "https://babel-api.testnet.iotex.io",
BeginningBlockNumber: 28685000,
TaskManagerContractAddr: "0xF0714400a4C0C72007A9F910C5E3007614958636",
Expand All @@ -39,6 +37,20 @@ var defaultTestnetConfig = &Config{
env: "TESTNET",
}

var defaultMainnetConfig = &Config{
LogLevel: slog.LevelInfo,
ServiceEndpoint: ":9000",
SequencerServiceEndpoint: "localhost:9001",
TaskAggregatorIntervalSecond: 300,
ProverServiceEndpoint: "localhost:9002",
ChainEndpoint: "https://babel-api.mainnet.iotex.io",
BeginningBlockNumber: 31780000,
TaskManagerContractAddr: "0x0A422759A8c6b22Ae8B9C4364763b614d5c0CD29",
IoIDContractAddr: "0x1FCB980eD0287777ab05ADc93012332e11300e54",
LocalDBDir: "./local_db",
env: "MAINNET",
}

func (c *Config) init() error {
if err := env.ParseEnv(c); err != nil {
return err
Expand All @@ -54,6 +66,8 @@ func Get() (*Config, error) {
switch env {
case "TESTNET":
conf = defaultTestnetConfig
case "MAINNET":
conf = defaultMainnetConfig
default:
env = "TESTNET"
conf = defaultTestnetConfig
Expand Down
15 changes: 15 additions & 0 deletions service/prover/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ var (
LocalDBDir: "./local_db",
env: "TESTNET",
}
defaultMainnetConfig = &Config{
LogLevel: slog.LevelInfo,
ServiceEndpoint: ":9002",
VMEndpoints: `{"1":"localhost:4001","2":"localhost:4002","3":"zkwasm:4001","4":"wasm:4001"}`,
ChainEndpoint: "https://babel-api.mainnet.iotex.io",
ProjectContractAddr: "0x6EF4559f2023C93F78d27E0151deF083638478d2",
RouterContractAddr: "0x580D9686A7A188746B9f4a06fb5ec9e14E937fde",
TaskManagerContractAddr: "0x0A422759A8c6b22Ae8B9C4364763b614d5c0CD29",
ProverPrvKey: "a5f4e99aa80342d5451e8f8fd0dc357ccddb70d3827428fb1fc366f70833497f",
BeginningBlockNumber: 31780000,
LocalDBDir: "./local_db",
env: "MAINNET",
}
)

func (c *Config) init() error {
Expand All @@ -53,6 +66,8 @@ func Get() (*Config, error) {
switch env {
case "TESTNET":
conf = defaultTestnetConfig
case "MAINNET":
conf = defaultMainnetConfig
default:
env = "TESTNET"
conf = defaultTestnetConfig
Expand Down
15 changes: 15 additions & 0 deletions service/sequencer/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ var (
BeginningBlockNumber: 28685000,
env: "TESTNET",
}
defaultMainnetConfig = &Config{
LogLevel: slog.LevelInfo,
ServiceEndpoint: ":9001",
TaskProcessingBandwidth: 20,
ChainEndpoint: "https://babel-api.mainnet.iotex.io",
OperatorPrvKey: "33e6ba3e033131026903f34dfa208feb88c284880530cf76280b68d38041c67b",
ProverContractAddr: "0x73aE62021517685c4b8Db4422968BCEc80F84063",
MinterContractAddr: "0x270bF4c2d0269f8Bf1c2187c20177DCc2f15C3C9",
TaskManagerContractAddr: "0x0A422759A8c6b22Ae8B9C4364763b614d5c0CD29",
LocalDBDir: "./local_db",
BeginningBlockNumber: 31780000,
env: "MAINNET",
}
)

func (c *Config) init() error {
Expand All @@ -53,6 +66,8 @@ func Get() (*Config, error) {
switch env {
case "TESTNET":
conf = defaultTestnetConfig
case "MAINNET":
conf = defaultMainnetConfig
default:
env = "TESTNET"
conf = defaultTestnetConfig
Expand Down
Loading

0 comments on commit f94e5a1

Please sign in to comment.