From 223043531f657a690c032bc26db9df957ef47bb5 Mon Sep 17 00:00:00 2001 From: colindickson Date: Wed, 27 Mar 2024 12:40:51 -0400 Subject: [PATCH] pass metering config string instead of network name to tier1 config --- cmd/apps/substreams_tier1.go | 5 ++--- go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cmd/apps/substreams_tier1.go b/cmd/apps/substreams_tier1.go index 019f164..fbd807e 100644 --- a/cmd/apps/substreams_tier1.go +++ b/cmd/apps/substreams_tier1.go @@ -49,7 +49,6 @@ func RegisterSubstreamsTier1App[B firecore.Block](chain *firecore.Chain[B], root cmd.Flags().Bool("substreams-tier1-subrequests-insecure", false, "Connect to tier2 without checking certificate validity") cmd.Flags().Bool("substreams-tier1-subrequests-plaintext", true, "Connect to tier2 without client in plaintext mode") cmd.Flags().Int("substreams-tier1-max-subrequests", 4, "number of parallel subrequests that the tier1 can make to the tier2 per request") - cmd.Flags().String("substreams-tier1-network-name", "undefined", "Network name to use for the substreams tier1 server. Used for metrics and logging. Default is 'undefined'") // all substreams registerCommonSubstreamsFlags(cmd) @@ -103,11 +102,11 @@ func RegisterSubstreamsTier1App[B firecore.Block](chain *firecore.Chain[B], root return nil, fmt.Errorf("substreams extensions: %w", err) } - networkName := viper.GetString("substreams-tier1-network-name") + meteringConfig := viper.GetString("common-metering-plugin") return app.NewTier1(appLogger, &app.Tier1Config{ - NetworkName: networkName, + MeteringConfig: meteringConfig, MergedBlocksStoreURL: mergedBlocksStoreURL, OneBlocksStoreURL: oneBlocksStoreURL, diff --git a/go.mod b/go.mod index 51b99a4..fe608b0 100644 --- a/go.mod +++ b/go.mod @@ -23,14 +23,14 @@ require ( github.com/streamingfast/derr v0.0.0-20230515163924-8570aaa43fe1 github.com/streamingfast/dgrpc v0.0.0-20240222213940-b9f324ff4d5c github.com/streamingfast/dhammer v0.0.0-20230125192823-c34bbd561bd4 - github.com/streamingfast/dmetering v0.0.0-20240327142626-e233666e4ea5 + github.com/streamingfast/dmetering v0.0.0-20240327163525-9249aa9bcceb github.com/streamingfast/dmetrics v0.0.0-20230919161904-206fa8ebd545 github.com/streamingfast/dstore v0.1.1-0.20240325191553-bcce8892a9bb github.com/streamingfast/jsonpb v0.0.0-20210811021341-3670f0aa02d0 github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 github.com/streamingfast/pbgo v0.0.6-0.20240131193313-6b88bc7139db github.com/streamingfast/snapshotter v0.0.0-20230316190750-5bcadfde44d0 - github.com/streamingfast/substreams v1.4.1-0.20240326155609-e3ba0b840b6b + github.com/streamingfast/substreams v1.4.1-0.20240327163819-5ea165e41a59 github.com/stretchr/testify v1.8.4 github.com/test-go/testify v1.1.4 go.uber.org/multierr v1.10.0 diff --git a/go.sum b/go.sum index 79fd836..d0b7484 100644 --- a/go.sum +++ b/go.sum @@ -596,8 +596,8 @@ github.com/streamingfast/dgrpc v0.0.0-20240222213940-b9f324ff4d5c h1:hn5ZPKGtgsc github.com/streamingfast/dgrpc v0.0.0-20240222213940-b9f324ff4d5c/go.mod h1:EPtUX/vhRphE37Zo6sDcgD/S3sm5YqXHhxAgzS6Ebwo= github.com/streamingfast/dhammer v0.0.0-20230125192823-c34bbd561bd4 h1:HKi8AIkLBzxZWmbCRUo1RxoOLK33iXO6gZprfsE9rf4= github.com/streamingfast/dhammer v0.0.0-20230125192823-c34bbd561bd4/go.mod h1:ehPytv7E4rI65iLcrwTes4rNGGqPPiugnH+20nDQyp4= -github.com/streamingfast/dmetering v0.0.0-20240327142626-e233666e4ea5 h1:kk8N3zz3OkLQcWBVn9SWdyzow2q61kiQ4slX3irnHYk= -github.com/streamingfast/dmetering v0.0.0-20240327142626-e233666e4ea5/go.mod h1:UqWuX3REU/IInBUaymFN2eLjuvz+/0SsoUFjeQlLNyI= +github.com/streamingfast/dmetering v0.0.0-20240327163525-9249aa9bcceb h1:lSAKMPTZAlHJsO2I0frKGSXIsjMLI7fmX/1fMvrwy+o= +github.com/streamingfast/dmetering v0.0.0-20240327163525-9249aa9bcceb/go.mod h1:UqWuX3REU/IInBUaymFN2eLjuvz+/0SsoUFjeQlLNyI= github.com/streamingfast/dmetrics v0.0.0-20230919161904-206fa8ebd545 h1:SUl04bZKGAv207lp7/6CHOJIRpjUKunwItrno3K463Y= github.com/streamingfast/dmetrics v0.0.0-20230919161904-206fa8ebd545/go.mod h1:JbxEDbzWRG1dHdNIPrYfuPllEkktZMgm40AwVIBENcw= github.com/streamingfast/dstore v0.1.1-0.20240325191553-bcce8892a9bb h1:tmu8wGiSTzdqk2CnPnI7GywKwepGieqNOQDRKKSiVJg= @@ -625,8 +625,8 @@ github.com/streamingfast/shutter v1.5.0 h1:NpzDYzj0HVpSiDJVO/FFSL6QIK/YKOxY0gJAt github.com/streamingfast/shutter v1.5.0/go.mod h1:B/T6efqdeMGbGwjzPS1ToXzYZI4kDzI5/u4I+7qbjY8= github.com/streamingfast/snapshotter v0.0.0-20230316190750-5bcadfde44d0 h1:Y15G1Z4fpEdm2b+/70owI7TLuXadlqBtGM7rk4Hxrzk= github.com/streamingfast/snapshotter v0.0.0-20230316190750-5bcadfde44d0/go.mod h1:/Rnz2TJvaShjUct0scZ9kKV2Jr9/+KBAoWy4UMYxgv4= -github.com/streamingfast/substreams v1.4.1-0.20240326155609-e3ba0b840b6b h1:eQ2OQI6AuIrV9xg6b2GWseBhPT5BVemoXwDFujAilZc= -github.com/streamingfast/substreams v1.4.1-0.20240326155609-e3ba0b840b6b/go.mod h1:tS03mbQ14PcuqmQCKvj82yENHaMl2xKxUBvWHJT06QQ= +github.com/streamingfast/substreams v1.4.1-0.20240327163819-5ea165e41a59 h1:33w7sMfPKOVSZs0TULrmtZ+FWrFs4pSLJAgLNSorzGo= +github.com/streamingfast/substreams v1.4.1-0.20240327163819-5ea165e41a59/go.mod h1:jojy0cwkhpsuF1AsyYQ7NEhwxtCwlWWFY1GfzHE55ZQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=