I recently upgraded from Kubo v0.36.0 to v0.43.1 and am testing a private swarm using a shared swarm.key.
I noticed that some peers from different IP addresses appear as connected, even though a private swarm is configured. Additionally, cross-network connectivity between nodes on different networks is inconsistent and sometimes fails.
Questions:
- Is it expected to see peers with different IP addresses in a private swarm?
- Does a successful connection guarantee that the peer is using the same
swarm.key? - Have there been any networking changes between v0.36.0 and v0.43.1 that affect relay, hole punching, or peer discovery?
- What is the recommended configuration for reliable cross-network communication in a private IPFS network?
this was my server config
{
"Identity": {
"PeerID": "<PEER_ID>",
"PrivKey": "<PRIVATE_KEY>"
},
"Datastore": {
"StorageMax": "10GB",
"StorageGCWatermark": 90,
"GCPeriod": "1h",
"Spec": {
"mounts": [
{
"mountpoint": "/blocks",
"path": "blocks",
"prefix": "flatfs.datastore",
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
"sync": false,
"type": "flatfs"
},
{
"compression": "none",
"mountpoint": "/",
"path": "datastore",
"prefix": "leveldb.datastore",
"type": "leveldb"
}
],
"type": "mount"
},
"HashOnRead": false,
"BloomFilterSize": 0,
"BlockKeyCacheSize": null
},
"Addresses": {
"Swarm": [
"/ip4/0.0.0.0/tcp/4006",
"/ip6/::/tcp/4006"
],
"Announce": [],
"AppendAnnounce": [
"/ip4/<SERVER_IP>/tcp/4006"
],
"NoAnnounce": [],
"API": "/ip4/0.0.0.0/tcp/5001",
"Gateway": "/ip4/0.0.0.0/tcp/8080"
},
"Mounts": {
"IPFS": "/ipfs",
"IPNS": "/ipns",
"MFS": "/mfs",
"FuseAllowOther": false
},
"Discovery": {
"MDNS": {
"Enabled": true
}
},
"Routing": {
"Type": "dht",
"DelegatedRouters": [],
"AcceleratedDHTClient": false
},
"Ipns": {
"RepublishPeriod": "12h",
"RecordLifetime": "24h",
"ResolveCacheSize": 128,
"UsePubsub": true,
"DelegatedPublishers": []
},
"Bootstrap": [
"/ip4/<SERVER_IP>/tcp/4006/p2p/<PEER_ID>"
],
"Gateway": {
"HTTPHeaders": {},
"RootRedirect": "",
"NoFetch": false,
"NoDNSLink": false
},
"API": {
"HTTPHeaders": {}
},
"Swarm": {
"DisableNatPortMap": false,
"DisableBandwidthMetrics": false,
"RelayClient": {
"Enabled": true
},
"RelayService": {
"Enabled": true
},
"Transports": {
"Network": {
"QUIC": false,
"WebTransport": false,
"WebRTCDirect": false,
"Websocket": false,
"Relay": true
}
},
"ConnMgr": {
"Type": "basic",
"LowWater": 50,
"HighWater": 200,
"GracePeriod": "30s"
},
"ResourceMgr": {
"Enabled": false
},
"EnableHolePunching": true
},
"AutoNAT": {
"ServiceMode": "disabled",
"Throttle": {
"GlobalLimit": 30,
"PeerLimit": 3,
"Interval": "1m"
}
},
"AutoTLS": {
"Enabled": false
},
"AutoConf": {
"Enabled": false
},
"Pubsub": {
"Router": "gossipsub",
"DisableSigning": false
},
"Peering": {
"Peers": []
},
"DNS": {
"Resolvers": {}
},
"Provide": {
"DHT": {}
},
"Experimental": {
"FilestoreEnabled": false,
"UrlstoreEnabled": false,
"Libp2pStreamMounting": false,
"P2pHttpProxy": false,
"OptimisticProvide": false,
"OptimisticProvideJobsPoolSize": 0,
"IpnsPubsub": true
},
"Plugins": {
"Plugins": null
},
"Pinning": {
"RemoteServices": {}
}
}
and this was my client config
{
"Identity": {
"PeerID": "<PEER_ID>",
"PrivKey": "<PRIVATE_KEY>"
},
"Datastore": {
"StorageMax": "10GB",
"StorageGCWatermark": 90,
"GCPeriod": "1h",
"Spec": {
"mounts": [
{
"mountpoint": "/blocks",
"path": "blocks",
"prefix": "flatfs.datastore",
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
"sync": false,
"type": "flatfs"
},
{
"compression": "none",
"mountpoint": "/",
"path": "datastore",
"prefix": "leveldb.datastore",
"type": "leveldb"
}
],
"type": "mount"
},
"HashOnRead": false,
"BloomFilterSize": 0,
"BlockKeyCacheSize": null
},
"Addresses": {
"Swarm": [
"/ip4/0.0.0.0/tcp/4006",
"/ip6/::/tcp/4006"
],
"Announce": [],
"AppendAnnounce": [
"/ip4/<SERVER_IP>/tcp/4006"
],
"NoAnnounce": [],
"API": "/ip4/0.0.0.0/tcp/5001",
"Gateway": "/ip4/0.0.0.0/tcp/8080"
},
"Mounts": {
"IPFS": "/ipfs",
"IPNS": "/ipns",
"MFS": "/mfs",
"FuseAllowOther": false
},
"Discovery": {
"MDNS": {
"Enabled": true
}
},
"Routing": {
"Type": "dht",
"DelegatedRouters": [],
"AcceleratedDHTClient": false
},
"Ipns": {
"RepublishPeriod": "12h",
"RecordLifetime": "24h",
"ResolveCacheSize": 128,
"UsePubsub": true,
"DelegatedPublishers": []
},
"Bootstrap": [
"/ip4/<SERVER_IP>/tcp/4006/p2p/<PEER_ID>"
],
"Gateway": {
"HTTPHeaders": {},
"RootRedirect": "",
"NoFetch": false,
"NoDNSLink": false
},
"API": {
"HTTPHeaders": {}
},
"Swarm": {
"DisableNatPortMap": false,
"DisableBandwidthMetrics": false,
"RelayClient": {
"Enabled": true
},
"RelayService": {
"Enabled": true
},
"Transports": {
"Network": {
"QUIC": false,
"WebTransport": false,
"WebRTCDirect": false,
"Websocket": false,
"Relay": true
}
},
"ConnMgr": {
"Type": "basic",
"LowWater": 50,
"HighWater": 200,
"GracePeriod": "30s"
},
"ResourceMgr": {
"Enabled": false
},
"EnableHolePunching": true
},
"AutoNAT": {
"ServiceMode": "disabled",
"Throttle": {
"GlobalLimit": 30,
"PeerLimit": 3,
"Interval": "1m"
}
},
"AutoTLS": {
"Enabled": false
},
"AutoConf": {
"Enabled": false
},
"Pubsub": {
"Router": "gossipsub",
"DisableSigning": false
},
"Peering": {
"Peers": []
},
"DNS": {
"Resolvers": {}
},
"Provide": {
"DHT": {}
},
"Experimental": {
"FilestoreEnabled": false,
"UrlstoreEnabled": false,
"Libp2pStreamMounting": false,
"P2pHttpProxy": false,
"OptimisticProvide": false,
"OptimisticProvideJobsPoolSize": 0,
"IpnsPubsub": true
},
"Plugins": {
"Plugins": null
},
"Pinning": {
"RemoteServices": {}
}
}