aboutsummaryrefslogtreecommitdiff
path: root/cmd/dendritejs/main.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-06-16 14:29:11 +0100
committerGitHub <noreply@github.com>2020-06-16 14:29:11 +0100
commitfc0e74ae0f02b7bb9d71d739660deef824ddbd33 (patch)
treefd718a25749cc56e08412d565f5f1bf472156eb4 /cmd/dendritejs/main.go
parent9c77022513f400db59409f5b55fc6223d38d6bb8 (diff)
Fix media API for demos and possibly Synapse (#1134)
* Fix media API for demos and possibly Synapse * User API * goimports
Diffstat (limited to 'cmd/dendritejs/main.go')
-rw-r--r--cmd/dendritejs/main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/dendritejs/main.go b/cmd/dendritejs/main.go
index 7930c28d..aa919212 100644
--- a/cmd/dendritejs/main.go
+++ b/cmd/dendritejs/main.go
@@ -145,6 +145,11 @@ func createFederationClient(cfg *config.Dendrite, node *go_http_js_libp2p.P2pLoc
return fed
}
+func createClient(node *go_http_js_libp2p.P2pLocalNode) *gomatrixserverlib.Client {
+ tr := go_http_js_libp2p.NewP2pTransport(node)
+ return gomatrixserverlib.NewClientWithTransport(tr)
+}
+
func createP2PNode(privKey ed25519.PrivateKey) (serverName string, node *go_http_js_libp2p.P2pLocalNode) {
hosted := "/dns4/rendezvous.matrix.org/tcp/8443/wss/p2p-websocket-star/"
node = go_http_js_libp2p.NewP2pLocalNode("org.matrix.p2p.experiment", privKey.Seed(), []string{hosted}, "p2p")
@@ -218,6 +223,7 @@ func main() {
Config: base.Cfg,
AccountDB: accountDB,
DeviceDB: deviceDB,
+ Client: createClient(node),
FedClient: federation,
KeyRing: &keyRing,
KafkaConsumer: base.KafkaConsumer,