Skip to content

Commit

Permalink
更新配置文件,修改数据库连接地址,调整 Docker 端口映射,升级 Go 依赖版本
Browse files Browse the repository at this point in the history
移除 Docker Compose 中的 mysql 依赖

更新 Dockerfile 和 docker-compose.yaml,简化基础镜像和移除版本声明

更新配置文件,修改 bsc_rpc 地址和 bsc_wrap_ca 合约地址
  • Loading branch information
du5 committed Dec 16, 2024
1 parent 6a8164c commit 8a6b8c1
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 200 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-alpine3.19
FROM golang:alpine

WORKDIR /48club
COPY . .
Expand Down
6 changes: 3 additions & 3 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ bnb48_index:
name: bnb48_index
port: 8888
route_prefix: /bnb48_index
bsc_rpc: /opt/.ethereum/geth.ipc
bsc_wrap_ca: 0xec6dCA59A5d82061B5092A78B61f0259Ce7dc5C0
bsc_rpc: ws://192.168.1.101:8545
bsc_wrap_ca: 0x83b16A2C9Bf52Ea03036E8617c9Dd13AE975f218
receive_fans_addr: 0x9567443394a3a611A6335Bab0e64f7F5E0cD83fd
bulk_cannot_contain:
- deploy
Expand All @@ -19,7 +19,7 @@ log:
compress: false

mysql:
url: root:mysqlpasswd@tcp(mysql:3306)/bnb48_inscription?charset=utf8mb4&parseTime=True&loc=Local
url: root:mysqlpasswd@tcp(192.168.0.103:3306)/bnb48_inscription?charset=utf8mb4&parseTime=True&loc=Local
prefix: ""
max_idle_conns: 10
max_open_conns: 50
Expand Down
33 changes: 1 addition & 32 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,20 @@
version: "3"

services:
48club-ins:
build:
context: .
dockerfile: ./Dockerfile
restart: always
ports:
- 0.0.0.0:8547:8888/tcp
- 0.0.0.0:8888:8888/tcp
volumes:
- ./config:/48club/config
- /opt/data/bnb48_index/logs:/48club/logs
- /root/.ethereum/:/opt/.ethereum/
depends_on:
- mysql
environment:
- TZ=${TZ}
- MYSQL_PASSWORD=${MYSQL_ROOT_PASSWORD}
logging:
&logging
driver: "json-file"
options:
max-file: "3"
max-size: 10m

mysql:
image: "mysql:8.0.29"
environment:
- TZ=${TZ}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
restart: always
volumes:
- /opt/data/bnb48_index/mysql/conf:/etc/mysql/conf.d
- /opt/data/bnb48_index/mysql/data:/var/lib/mysql
- /opt/data/bnb48_index/mysql/logs:/var/log/mysql
- ./scripts/sql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
logging:
<<: *logging

phpmyadmin:
image: phpmyadmin:latest
restart: always
depends_on:
- mysql
ports:
- 8548:80/tcp
environment:
- PMA_HOST=mysql
logging:
<<: *logging
95 changes: 49 additions & 46 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,92 +1,95 @@
module bnb-48-ins-indexer

go 1.20
go 1.22.0

toolchain go1.22.8

require (
github.com/DATA-DOG/go-sqlmock v1.5.1
github.com/chenyahui/gin-cache v1.9.0
github.com/deckarep/golang-set/v2 v2.6.0
github.com/ethereum/go-ethereum v1.13.12
github.com/gin-gonic/gin v1.9.1
github.com/deckarep/golang-set/v2 v2.7.0
github.com/ethereum/go-ethereum v1.14.12
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.6.0
github.com/sony/sonyflake v1.2.0
github.com/spf13/viper v1.18.2
github.com/spf13/viper v1.19.0
github.com/status-im/keycard-go v0.2.0
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.26.0
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/mysql v1.5.4
gorm.io/gorm v1.25.7
gorm.io/driver/mysql v1.5.7
gorm.io/gorm v1.25.12
)

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/bytedance/sonic v1.11.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/bits-and-blooms/bitset v1.19.1 // indirect
github.com/bytedance/sonic v1.12.6 // indirect
github.com/bytedance/sonic/loader v0.2.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/consensys/bavard v0.1.24 // indirect
github.com/consensys/gnark-crypto v0.14.0 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/ethereum/c-kzg-4844 v0.4.2 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/ethereum/c-kzg-4844 v1.0.3 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.18.0 // indirect
github.com/go-playground/validator/v10 v10.23.0 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/goccy/go-json v0.10.4 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/holiman/uint256 v1.3.2 // indirect
github.com/jellydator/ttlcache/v2 v2.11.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/magiconair/properties v1.8.9 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/tklauser/go-sysconf v0.3.13 // indirect
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/supranational/blst v0.3.13 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.9.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
golang.org/x/arch v0.12.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Loading

0 comments on commit 8a6b8c1

Please sign in to comment.