From 11f2647e7f424f299c4252e79e8dec68dcd4f523 Mon Sep 17 00:00:00 2001 From: zhouop0 <11733741+zhouop0@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:20:48 +0800 Subject: [PATCH] update deploy --- .env | 1 + .env.template | 1 + internal/types/config.go | 1 + main.go | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 3899f94..d35204a 100644 --- a/.env +++ b/.env @@ -7,3 +7,4 @@ RPC_RATE_BURST=5 FROM_BLOCK_NUMBER=6034337 FROM_BLOCK_HASH=0xafc3e42c5899591501d29649ffef0bfdec68f8d77e6d44ee00ef88cfb1a2f163 DISPUTE_GAME_PROXY_CONTRACT=0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1 +API_PORT=8080 diff --git a/.env.template b/.env.template index f804a78..9727d5a 100644 --- a/.env.template +++ b/.env.template @@ -7,3 +7,4 @@ RPC_RATE_BURST=5 FROM_BLOCK_NUMBER=6034337 FROM_BLOCK_HASH=0xafc3e42c5899591501d29649ffef0bfdec68f8d77e6d44ee00ef88cfb1a2f163 DISPUTE_GAME_PROXY_CONTRACT=0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1 +API_PORT=8080 diff --git a/internal/types/config.go b/internal/types/config.go index fa698b3..ad49655 100644 --- a/internal/types/config.go +++ b/internal/types/config.go @@ -22,6 +22,7 @@ type Config struct { FromBlockNumber int64 `env:"FROM_BLOCK_NUMBER" envDefault:"6034337"` FromBlockHash string `env:"FROM_BLOCK_HASH" envDefault:"0xafc3e42c5899591501d29649ffef0bfdec68f8d77e6d44ee00ef88cfb1a2f163"` DisputeGameProxyContract string `env:"DISPUTE_GAME_PROXY_CONTRACT" envDefault:"0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1"` + APIPort string `env:"API_PORT" envDefault:"8088"` } var config *Config diff --git a/main.go b/main.go index 727bad5..fefb491 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,7 @@ func main() { router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) - err := router.Run() + err := router.Run(":" + cfg.APIPort) if err != nil { log.Errorf("start error %s", err) return