diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e4b7fa..4e0672f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ The following emojis are used to highlight certain changes: ### Added +- Added configurable libp2p listen addresses for the Bitswap host via the `libp2p-listen-addrs` flag and `RAINBOW_LIBP2P_LISTEN_ADDRS` environment variable + ### Changed ### Removed diff --git a/main.go b/main.go index f832e80..5598ce1 100644 --- a/main.go +++ b/main.go @@ -248,8 +248,18 @@ Generate an identity seed and launch a gateway: EnvVars: []string{"RAINBOW_IPNS_MAX_CACHE_TTL"}, Usage: "Optional cap on caching duration for IPNS/DNSLink lookups. Set to 0 to respect original TTLs", }, + &cli.StringSliceFlag{ + Name: "libp2p-listen-addrs", + Value: cli.NewStringSlice("/ip4/0.0.0.0/tcp/4001", + "/ip4/0.0.0.0/udp/4001/quic-v1", + "/ip4/0.0.0.0/udp/4001/quic-v1/webtransport", + "/ip6/::/tcp/4001", + "/ip6/::/udp/4001/quic-v1", + "/ip6/::/udp/4001/quic-v1/webtransport"), + EnvVars: []string{"RAINBOW_LIBP2P_LISTEN_ADDRS"}, + Usage: "Multiaddresses for libp2p bitswap client to listen on (comma-separated)", + }, } - app.Commands = []*cli.Command{ { Name: "gen-seed", @@ -367,6 +377,7 @@ share the same seed as long as the indexes are different. SeedPeeringMaxIndex: cctx.Int("seed-peering-max-index"), GCInterval: cctx.Duration("gc-interval"), GCThreshold: cctx.Float64("gc-threshold"), + ListenAddrs: cctx.StringSlice("listen-addrs"), } goLog.Debugf("Rainbow config: %+v", cfg)