Skip to content

Commit 3ccd5d1

Browse files
committed
cleaning garbage with address books
1 parent ffb1727 commit 3ccd5d1

15 files changed

+162
-293
lines changed

api/openapi.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -4446,8 +4446,7 @@
44464446
"items": {
44474447
"enum": [
44484448
"getgems",
4449-
"tonkeeper",
4450-
"ton.diamonds"
4449+
"tonkeeper"
44514450
],
44524451
"example": "getgems",
44534452
"type": "string"

api/openapi.yml

-1
Original file line numberDiff line numberDiff line change
@@ -5497,7 +5497,6 @@ components:
54975497
enum:
54985498
- getgems
54995499
- tonkeeper
5500-
- ton.diamonds
55015500
TrustType:
55025501
type: string
55035502
example: whitelist

cmd/api/main.go

+6-10
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,24 @@ import (
66
"net/http"
77

88
"github.com/prometheus/client_golang/prometheus/promhttp"
9-
"github.com/tonkeeper/opentonapi/pkg/blockchain/indexer"
10-
"github.com/tonkeeper/opentonapi/pkg/spam"
11-
"github.com/tonkeeper/tongo"
12-
"github.com/tonkeeper/tongo/liteapi"
13-
"go.uber.org/zap"
14-
"golang.org/x/exp/maps"
15-
169
"github.com/tonkeeper/opentonapi/pkg/addressbook"
1710
"github.com/tonkeeper/opentonapi/pkg/api"
1811
"github.com/tonkeeper/opentonapi/pkg/app"
1912
"github.com/tonkeeper/opentonapi/pkg/blockchain"
13+
"github.com/tonkeeper/opentonapi/pkg/blockchain/indexer"
2014
"github.com/tonkeeper/opentonapi/pkg/config"
2115
"github.com/tonkeeper/opentonapi/pkg/litestorage"
2216
"github.com/tonkeeper/opentonapi/pkg/pusher/sources"
17+
"github.com/tonkeeper/opentonapi/pkg/spam"
18+
"github.com/tonkeeper/tongo"
19+
"github.com/tonkeeper/tongo/liteapi"
20+
"go.uber.org/zap"
2321
)
2422

2523
func main() {
2624

2725
cfg := config.Load()
2826
log := app.Logger(cfg.App.LogLevel)
29-
book := addressbook.NewAddressBook(log, config.AddressPath, config.JettonPath, config.CollectionPath)
3027

3128
storageBlockCh := make(chan indexer.IDandBlock)
3229

@@ -46,10 +43,9 @@ func main() {
4643
log,
4744
client,
4845
litestorage.WithPreloadAccounts(cfg.App.Accounts),
49-
litestorage.WithTFPools(book.TFPools()),
50-
litestorage.WithKnownJettons(maps.Keys(book.GetKnownJettons())),
5146
litestorage.WithBlockChannel(storageBlockCh),
5247
)
48+
book := addressbook.NewAddressBook(log, config.AddressPath, config.JettonPath, config.CollectionPath, storage)
5349
// The executor is used to resolve DNS records.
5450
tongo.SetDefaultExecutor(storage)
5551

0 commit comments

Comments
 (0)