Skip to content

Commit 2a4aac6

Browse files
committed
chore: clean up
1 parent 2769024 commit 2a4aac6

File tree

1 file changed

+17
-26
lines changed
  • framework/components/blockchain

1 file changed

+17
-26
lines changed

framework/components/blockchain/ton.go

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ import (
1616
)
1717

1818
const (
19-
DefaultTonSimpleServerPort = 8000
20-
DefaultTonHTTPAPIPort = 8081
21-
DefaultTonIndexAPIPort = 8082
22-
DefaultTonTONExplorerPort = 8080
23-
DefaultTonFaucetPort = 88
24-
DefaultTonLiteServerPort = 40004
25-
DefaultTonDhtServerPort = 40003
26-
DefaultTonValidatorConsolePort = 40002
27-
DefaultTonValidatorPublicPort = 40001
19+
DefaultTonSimpleServerPort = "8000"
2820
// NOTE: Prefunded high-load wallet from MyLocalTon pre-funded wallet, that can send up to 254 messages per 1 external message
2921
// https://docs.ton.org/v3/documentation/smart-contracts/contracts-specs/highload-wallet#highload-wallet-v2
3022
DefaultTonHlWalletAddress = "-1:5ee77ced0b7ae6ef88ab3f4350d8872c64667ffbe76073455215d3cdfab3294b"
@@ -33,20 +25,19 @@ const (
3325

3426
var (
3527
commonDBVars = map[string]string{
36-
"POSTGRES_DIALECT": "postgresql+asyncpg",
37-
"POSTGRES_HOST": "index-postgres",
38-
"POSTGRES_PORT": "5432",
39-
"POSTGRES_USER": "postgres",
40-
"POSTGRES_DB": "ton_index",
41-
"POSTGRES_PASSWORD": "PostgreSQL1234",
42-
"POSTGRES_DBNAME": "ton_index",
43-
"TON_INDEXER_TON_HTTP_API_ENDPOINT": "http://tonhttpapi:8081/",
44-
"TON_INDEXER_IS_TESTNET": "0",
45-
"TON_INDEXER_REDIS_DSN": "redis://redis:6379",
46-
"TON_WORKER_FROM": "1",
47-
"TON_WORKER_DBROOT": "/tondb",
48-
"TON_WORKER_BINARY": "ton-index-postgres-v2",
49-
"TON_WORKER_ADDITIONAL_ARGS": "",
28+
"POSTGRES_DIALECT": "postgresql+asyncpg",
29+
"POSTGRES_HOST": "index-postgres",
30+
"POSTGRES_PORT": "5432",
31+
"POSTGRES_USER": "postgres",
32+
"POSTGRES_DB": "ton_index",
33+
"POSTGRES_PASSWORD": "PostgreSQL1234",
34+
"POSTGRES_DBNAME": "ton_index",
35+
"TON_INDEXER_IS_TESTNET": "0",
36+
"TON_INDEXER_REDIS_DSN": "redis://redis:6379",
37+
"TON_WORKER_FROM": "1",
38+
"TON_WORKER_DBROOT": "/tondb",
39+
"TON_WORKER_BINARY": "ton-index-postgres-v2",
40+
"TON_WORKER_ADDITIONAL_ARGS": "",
5041
}
5142
)
5243

@@ -140,7 +131,7 @@ func defaultTon(in *Input) {
140131
in.Image = "ghcr.io/neodix42/mylocalton-docker:latest"
141132
}
142133
if in.Port == "" {
143-
in.Port = strconv.Itoa(DefaultTonSimpleServerPort)
134+
in.Port = DefaultTonSimpleServerPort
144135
}
145136
}
146137

@@ -172,7 +163,7 @@ func newTon(in *Input) (*Output, error) {
172163
Name: fmt.Sprintf("TON-genesis-%s", instanceID),
173164
Image: "ghcr.io/neodix42/mylocalton-docker:latest",
174165
Ports: []string{
175-
fmt.Sprintf("%s:8000/tcp", hostPorts.SimpleServer),
166+
fmt.Sprintf("%s:%s/tcp", hostPorts.SimpleServer, DefaultTonSimpleServerPort),
176167
// Note: LITE_PORT port is used by the lite-client to connect to the genesis node in config
177168
fmt.Sprintf("%s:%s/tcp", hostPorts.LiteServer, hostPorts.LiteServer),
178169
fmt.Sprintf("%s:40003/udp", hostPorts.DHTServer),
@@ -369,7 +360,7 @@ func newTon(in *Input) (*Output, error) {
369360
Nodes: []*Node{{
370361
// Note: define if we need more access other than the global config(tonutils-go only uses liteclients defined in the config)
371362
ExternalHTTPUrl: fmt.Sprintf("%s:%s", "localhost", hostPorts.SimpleServer),
372-
InternalHTTPUrl: fmt.Sprintf("%s:%s", name, "8000"),
363+
InternalHTTPUrl: fmt.Sprintf("%s:%s", name, DefaultTonSimpleServerPort),
373364
}},
374365
}, nil
375366
}

0 commit comments

Comments
 (0)