Skip to content

Commit

Permalink
fix env
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouop0 committed Feb 13, 2024
1 parent 0a6e6ff commit 6bb326e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ETHERMINT_IMAGE=ghcr.io/b2network/b2-committer:sha-f151b04
ETHERMINT_IMAGE=ghcr.io/b2network/b2-committer:sha-0a6e6ff
2 changes: 1 addition & 1 deletion internal/handler/committer.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func Committer(ctx *svc.ServiceContext) {
var proposals []schema.Proposal
lastProposalID, lastFinalBatchNum, err := ctx.NodeClient.QueryLastProposalID()
if err != nil {
log.Errorf("[Handler.Committer][QueryLastProposalID] error info:", errors.WithStack(err))
log.Errorf("[Handler.Committer][QueryLastProposalID] error info: %s", errors.WithStack(err).Error())
time.Sleep(10 * time.Second)
continue
}
Expand Down
2 changes: 1 addition & 1 deletion internal/svc/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewServiceContext(cfg *types.Config, bitcoinCfg *types.BitcoinRPCConfig, b2
log.Panicf("[svc] get eth client panic: %s\n", err)
}

privateKeHex := b2nodeConfig.PrivateKeyHex
privateKeHex := b2nodeConfig.PrivateKey
chainID := b2nodeConfig.ChainID
address := b2nodeConfig.Address
grpcConn, err := types.GetClientConnection(b2nodeConfig.GRPCHost, types.WithClientPortOption(b2nodeConfig.GRPCPort))
Expand Down
14 changes: 7 additions & 7 deletions internal/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ type Config struct {
}

type B2NODEConfig struct {
PrivateKeyHex string `evn:"B2NODE_PRIVATE_KEY_HEX" envDefault:"37927fcde10259a7114a58487cb6303d04c33291ba29bbb8e488eef150e6a59a"`
Address string `env:"B2NODE_ADDRESS" envDefault:"ethm1nexknt73vdv6cm3h6ep6u7pe9vg8kr6kqwyl0a"`
ChainID string `env:"B2NODE_CHAIN_ID" envDefault:"ethermint_9000-1"`
GRPCHost string `env:"B2NODE_GRPC_HOST" envDefault:"127.0.0.1"`
GRPCPort uint32 `env:"B2NODE_GRPC_PORT" envDefault:"9090"`
RPCUrl string `env:"B2NODE_RPC_URL" envDefault:"http://localhost:8545"`
CoinDenom string `env:"B2NODE_COIN_DENOM" envDefault:"aphoton" `
Address string `env:"B2NODE_ADDRESS" envDefault:"ethm1nexknt73vdv6cm3h6ep6u7pe9vg8kr6kqwyl0a"`
ChainID string `env:"B2NODE_CHAIN_ID" envDefault:"ethermint_9000-1"`
GRPCHost string `env:"B2NODE_GRPC_HOST" envDefault:"127.0.0.1"`
GRPCPort uint32 `env:"B2NODE_GRPC_PORT" envDefault:"9090"`
RPCUrl string `env:"B2NODE_RPC_URL" envDefault:"http://localhost:8545"`
CoinDenom string `env:"B2NODE_COIN_DENOM" envDefault:"aphoton"`
PrivateKey string `env:"B2NODE_PRIVATE_KEY" envDefault:"b2dd35d83b69d0d572616713148e83ba7d7f02fb14f442ffc4246319c61a3fa3"`
}

type BitcoinRPCConfig struct {
Expand Down
27 changes: 15 additions & 12 deletions test-docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: "3"

services:
mysql1:
container_name: mysql1
image: mysql:8.0.28
environment:
MYSQL_ROOT_PASSWORD: "root"
Expand All @@ -11,7 +12,6 @@ services:
- ./mysql.sql:/docker-entrypoint-initdb.d/init.sql
- ./mysql1/datadir:/var/lib/mysql


# mysql2:
# image: mysql:8.0.28
# environment:
Expand All @@ -28,25 +28,28 @@ services:
environment:
LOG_LEVEL: "info"
LOG_FORMAT: "console"
MYSQL_DATA_SOURCE: "root:root@tcp(127.0.0.1:3366)/b2_committer?charset=utf8mb4&parseTime=True&loc=Local&multiStatements=true"
MYSQL_MAX_IDLE_CONNS: 10
MYSQL_MAX_OPEN_CONNS: 20
MYSQL_CONN_MAX_LIFETIME: 3600
MYSQL_DATA_SOURCE: "root:root@tcp(mysql1:3306)/b2_committer?charset=utf8mb4&parseTime=True&loc=Local&multiStatements=true"
MYSQL_MAX_IDLE_CONNS: "10"
MYSQL_MAX_OPEN_CONNS: "20"
MYSQL_CONN_MAX_LIFETIME: "3600"
RPC_URL: "https://habitat-b2-nodes.bsquared.network"
BLOCKCHAIN: "b2-node"
INIT_BLOCK_NUMBER: 10
INIT_BLOCK_NUMBER: "70000"
INIT_BLOCK_HASH: "0xb2fa3c8011ce25bb1d261403107b58b6aeda8a2af3827e86ad70ee081966d99c"
POLYGON_ZKEVM_ADDRESS: "0xd9571Aaf414b0F51d40D6738813FA4eA782d18B7"
PROPOSAL_BATCHES_LIMITNUM: 10
B2NODE_PRIVATE_KEY_HEX: "0cb6df36e675f96b41f33018a66d7ef075fb047e7295ac06c4233c9fd164ae6c"
B2NODE_ADDRESS: "ethm120w06zgwpa03kwywf9a4rm760x9pnj3l7nz704"
PROPOSAL_BATCHES_LIMITNUM: "10"
INIT_PROPOSAL_ID: "1"
B2NODE_PRIVATE_KEY_HEX: "b2dd35d83b69d0d572616713148e83ba7d7f02fb14f442ffc4246319c61a3fa3"
B2NODE_ADDRESS: "ethm1nns7nx6cjkrcr9nxwmct4paxjw9md4c9ct6x75"
B2NODE_CHAIN_ID: "ethermint_9000-1"
B2NODE_GRPC_HOST: "127.0.0.1"
B2NODE_GRPC_HOST: "host.docker.internal"
B2NODE_GRPC_PORT: "9090"
B2NODE_RPC_URL: "http://localhost:8545"
B2NODE_RPC_URL: "http://host.docker.internal:8545"
B2NODE_COIN_DENOM: "aphoton"
BITCOIN_NETWORK_NAME: "testnet3"
BITCOIN_PRIVATE_KEY: "55968c09fb90a496096bafdeaac0f791f527b17324d1d0e63d3550e68a7b0cc5"
COMMITTER_DESTINATION_ADDRESS: "tb1ptlp06cp6da4quje623ne8ataf2d4jy80m3jyjqr34c6dp6s5jddqtusute"
image: ${ETHERMINT_IMAGE}
image: ghcr.io/b2network/b2-committer:sha-0a6e6ff
#
#
# node2:
Expand Down

0 comments on commit 6bb326e

Please sign in to comment.