Override testnetnet to mainnet in indexer ingest topic

Override `testnetnet` to `mainnet` when constructing indexer ingestion
topic.
This commit is contained in:
Masih H. Derkani 2022-02-11 19:36:36 +00:00
parent b47cde70fa
commit 230b8554f6

View File

@ -14,7 +14,15 @@ import (
func BlocksTopic(netName dtypes.NetworkName) string { return "/fil/blocks/" + string(netName) }
func MessagesTopic(netName dtypes.NetworkName) string { return "/fil/msgs/" + string(netName) }
func IndexerIngestTopic(netName dtypes.NetworkName) string {
return "/indexer/ingest/" + string(netName)
nn := string(netName)
// The network name testnetnet is here for historical reasons.
// Going forward we aim to use the name `mainnet` where possible.
if nn == "testnetnet" {
nn = "mainnet"
}
return "/indexer/ingest/" + nn
}
func DhtProtocolName(netName dtypes.NetworkName) protocol.ID {
return protocol.ID("/fil/kad/" + string(netName))