diff options
author | Devon Hudson <devonhudson@librem.one> | 2023-01-29 18:13:39 -0700 |
---|---|---|
committer | Devon Hudson <devonhudson@librem.one> | 2023-01-29 18:13:39 -0700 |
commit | f98003c030432074e0c411cd70e09bacae820940 (patch) | |
tree | 78b9bb380292ec246da795996a6337e846f7306c /cmd | |
parent | 0f998e3af3be06a1f0626de8cb74413c5da310f4 (diff) |
Add cmd line option to pinecone demo for enabling relaying
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dendrite-demo-pinecone/main.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cmd/dendrite-demo-pinecone/main.go b/cmd/dendrite-demo-pinecone/main.go index 83655b69..3f63ab65 100644 --- a/cmd/dendrite-demo-pinecone/main.go +++ b/cmd/dendrite-demo-pinecone/main.go @@ -64,11 +64,12 @@ import ( ) var ( - instanceName = flag.String("name", "dendrite-p2p-pinecone", "the name of this P2P demo instance") - instancePort = flag.Int("port", 8008, "the port that the client API will listen on") - instancePeer = flag.String("peer", "", "the static Pinecone peers to connect to, comma separated-list") - instanceListen = flag.String("listen", ":0", "the port Pinecone peers can connect to") - instanceDir = flag.String("dir", ".", "the directory to store the databases in (if --config not specified)") + instanceName = flag.String("name", "dendrite-p2p-pinecone", "the name of this P2P demo instance") + instancePort = flag.Int("port", 8008, "the port that the client API will listen on") + instancePeer = flag.String("peer", "", "the static Pinecone peers to connect to, comma separated-list") + instanceListen = flag.String("listen", ":0", "the port Pinecone peers can connect to") + instanceDir = flag.String("dir", ".", "the directory to store the databases in (if --config not specified)") + instanceRelayingEnabled = flag.Bool("relay", false, "whether to enable store & forward relaying for other nodes") ) const relayServerRetryInterval = time.Second * 30 @@ -244,7 +245,8 @@ func main() { Config: &base.Cfg.FederationAPI, UserAPI: userAPI, } - relayAPI := relayapi.NewRelayInternalAPI(base, federation, rsAPI, keyRing, producer, true) + relayAPI := relayapi.NewRelayInternalAPI(base, federation, rsAPI, keyRing, producer, *instanceRelayingEnabled) + logrus.Infof("Relaying enabled: %v", relayAPI.RelayingEnabled()) monolith := setup.Monolith{ Config: base.Cfg, |