diff options
author | Kegsay <kegan@matrix.org> | 2020-07-03 12:59:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-03 12:59:00 +0100 |
commit | 6c4b8185d7f9b4f66cc673fd13c448dff53472c0 (patch) | |
tree | 4c544d155e8c55df7d18f45beb15e473a11f8d0a /cmd/dendrite-demo-libp2p/main.go | |
parent | 1773fd84b7634a1655e78ee5fe31e6235ed6240c (diff) |
Implement ExtraPublicRoomsProvider for p2p demos (#1180)
* Change API and rename to ExtraPublicRoomsProvider
* Make dendritejs work again
* Maybe make libp2p demo work again
* Linting
Diffstat (limited to 'cmd/dendrite-demo-libp2p/main.go')
-rw-r--r-- | cmd/dendrite-demo-libp2p/main.go | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/cmd/dendrite-demo-libp2p/main.go b/cmd/dendrite-demo-libp2p/main.go index 988f4aa7..dcda76a8 100644 --- a/cmd/dendrite-demo-libp2p/main.go +++ b/cmd/dendrite-demo-libp2p/main.go @@ -1,6 +1,4 @@ -// Copyright 2017 Vector Creations Ltd -// Copyright 2018 New Vector Ltd -// Copyright 2019-2020 The Matrix.org Foundation C.I.C. +// Copyright 2020 The Matrix.org Foundation C.I.C. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -162,13 +160,12 @@ func main() { &base.Base, federation, rsAPI, keyRing, ) rsAPI.SetFederationSenderAPI(fsAPI) - /* TODO: - publicRoomsDB, err := storage.NewPublicRoomsServerDatabaseWithPubSub(string(base.Base.Cfg.Database.PublicRoomsAPI), base.LibP2PPubsub, cfg.Matrix.ServerName) + stateAPI := currentstateserver.NewInternalAPI(base.Base.Cfg, base.Base.KafkaConsumer) + provider := newPublicRoomsProvider(base.LibP2PPubsub, rsAPI, stateAPI) + err = provider.Start() if err != nil { - logrus.WithError(err).Panicf("failed to connect to public rooms db") + panic("failed to create new public rooms provider: " + err.Error()) } - */ - stateAPI := currentstateserver.NewInternalAPI(base.Base.Cfg, base.Base.KafkaConsumer) monolith := setup.Monolith{ Config: base.Base.Cfg, @@ -180,13 +177,14 @@ func main() { KafkaConsumer: base.Base.KafkaConsumer, KafkaProducer: base.Base.KafkaProducer, - AppserviceAPI: asAPI, - EDUInternalAPI: eduInputAPI, - FederationSenderAPI: fsAPI, - RoomserverAPI: rsAPI, - ServerKeyAPI: serverKeyAPI, - StateAPI: stateAPI, - UserAPI: userAPI, + AppserviceAPI: asAPI, + EDUInternalAPI: eduInputAPI, + FederationSenderAPI: fsAPI, + RoomserverAPI: rsAPI, + ServerKeyAPI: serverKeyAPI, + StateAPI: stateAPI, + UserAPI: userAPI, + ExtPublicRoomsProvider: provider, } monolith.AddAllPublicRoutes(base.Base.PublicAPIMux) |