aboutsummaryrefslogtreecommitdiff
path: root/cmd/dendritejs/main.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-05-29 15:34:15 +0100
committerGitHub <noreply@github.com>2020-05-29 15:34:15 +0100
commit97c64bdb6d1ce6ee4684f209dfa96db3545e240b (patch)
tree83d19e62f65e2c999c3e4eaf9270d9fbd785a503 /cmd/dendritejs/main.go
parentfe5cf6f880cdb906006a6ca215872949c3388272 (diff)
p2p: de-dupe and shuffle public rooms; implement keydb (#1074)
- We don't want a serverKeyAPI as fetching keys doesn't need a DB. - De-dupe rooms so we don't see them multiple times, but shuffle the alias we join via so we don't all flood a single server.
Diffstat (limited to 'cmd/dendritejs/main.go')
-rw-r--r--cmd/dendritejs/main.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/cmd/dendritejs/main.go b/cmd/dendritejs/main.go
index b8517bf9..45f23d9a 100644
--- a/cmd/dendritejs/main.go
+++ b/cmd/dendritejs/main.go
@@ -37,7 +37,6 @@ import (
"github.com/matrix-org/dendrite/publicroomsapi"
"github.com/matrix-org/dendrite/publicroomsapi/storage"
"github.com/matrix-org/dendrite/roomserver"
- "github.com/matrix-org/dendrite/serverkeyapi"
"github.com/matrix-org/dendrite/syncapi"
go_http_js_libp2p "github.com/matrix-org/go-http-js-libp2p"
"github.com/matrix-org/gomatrixserverlib"
@@ -197,14 +196,12 @@ func main() {
deviceDB := base.CreateDeviceDB()
federation := createFederationClient(cfg, node)
- serverKeyAPI := serverkeyapi.SetupServerKeyAPIComponent(
- base, federation,
- )
+ fetcher := &libp2pKeyFetcher{}
keyRing := gomatrixserverlib.KeyRing{
KeyFetchers: []gomatrixserverlib.KeyFetcher{
- &libp2pKeyFetcher{},
+ fetcher,
},
- KeyDatabase: serverKeyAPI,
+ KeyDatabase: fetcher,
}
p2pPublicRoomProvider := NewLibP2PPublicRoomsProvider(node)