So I am trying to perform the example given here kubo/docs/experimental-features.md at master 路 ipfs/kubo 路 GitHub (ipfs p2p commands) with netcat in a private swarm having 3 bootstrap nodes and 2 nodes behind NAT. The following is my bootstrap node config:
{
"API": {
"HTTPHeaders": {}
},
"Addresses": {
"API": "/ip4/127.0.0.1/tcp/5001",
"Announce": [],
"AppendAnnounce": [
"/ip4/54.163.37.246/tcp/4001"
],
"Gateway": "/ip4/127.0.0.1/tcp/8080",
"NoAnnounce": [],
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
"/ip6/::/tcp/4001",
"/ip4/0.0.0.0/udp/4001/quic-v1",
"/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
"/ip6/::/udp/4001/quic-v1",
"/ip6/::/udp/4001/quic-v1/webtransport"
]
},
"AutoNAT": {},
"Bootstrap": [
"/ip4/<publicip1>/tcp/4001/p2p/12D3KooWJeCNUxFXmD8pqf27HC9h9rbRxcHfAqc61GCUuTvCiUPE",
"/ip4/<publicip2>/tcp/4001/p2p/12D3KooWCc2QDzx75SGCTuuYnWYFunQTBS8Cd3JTHRvsTWJKK74R",
"/ip4/<publicip3>/tcp/4001/p2p/12D3KooWR8FQ3pAtnXwJgKKJ2tkwrYbgpzZZUpo7aQcLyVPSqoxL",
"/dns/<publicip4>/tcp/19295/p2p/12D3KooWQUJu9N1G7vqbDkzPuKEgjo8NNWkPAoTr4hd2sLVyqMfQ"
],
"DNS": {
"Resolvers": {}
},
"Datastore": {
"BloomFilterSize": 0,
"GCPeriod": "1h",
"HashOnRead": false,
"Spec": {
"mounts": [
{
"child": {
"path": "blocks",
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
"sync": true,
"type": "flatfs"
},
"mountpoint": "/blocks",
"prefix": "flatfs.datastore",
"type": "measure"
},
{
"child": {
"compression": "none",
"path": "datastore",
"type": "levelds"
},
"mountpoint": "/",
"prefix": "leveldb.datastore",
"type": "measure"
}
],
"type": "mount"
},
"StorageGCWatermark": 90,
"StorageMax": "10GB"
},
"Discovery": {
"MDNS": {
"Enabled": true
}
},
"Experimental": {
"FilestoreEnabled": false,
"Libp2pStreamMounting": true,
"OptimisticProvide": false,
"OptimisticProvideJobsPoolSize": 0,
"P2pHttpProxy": false,
"StrategicProviding": false,
"UrlstoreEnabled": false
},
"Gateway": {
"APICommands": [],
"DeserializedResponses": null,
"DisableHTMLErrors": null,
"ExposeRoutingAPI": null,
"HTTPHeaders": {},
"NoDNSLink": false,
"NoFetch": false,
"PathPrefixes": [],
"PublicGateways": null,
"RootRedirect": ""
},
"Identity": {
"PeerID": "12D3KooWR8FQ3pAtnXwJgKKJ2tkwrYbgpzZZUpo7aQcLyVPSqoxL"
},
"Internal": {},
"Ipns": {
"RecordLifetime": "",
"RepublishPeriod": "",
"ResolveCacheSize": 128
},
"Migration": {
"DownloadSources": [],
"Keep": ""
},
"Mounts": {
"FuseAllowOther": false,
"IPFS": "/ipfs",
"IPNS": "/ipns"
},
"Peering": {
"Peers": null
},
"Pinning": {
"RemoteServices": {}
},
"Plugins": {
"Plugins": null
},
"Provider": {
"Strategy": ""
},
"Pubsub": {
"DisableSigning": false,
"Router": ""
},
"Reprovider": {},
"Routing": {
"AcceleratedDHTClient": false,
"Methods": null,
"Routers": null,
"Type": "dhtserver"
},
"Swarm": {
"AddrFilters": null,
"ConnMgr": {},
"DisableBandwidthMetrics": false,
"DisableNatPortMap": false,
"EnableHolePunching": true,
"RelayClient": {},
"RelayService": {
"Enable": true
},
"ResourceMgr": {},
"Transports": {
"Multiplexers": {},
"Network": {},
"Security": {}
}
}
}
and the following is my regular node (behind a NAT) config:
{
"API": {
"HTTPHeaders": {}
},
"Addresses": {
"API": "/ip4/127.0.0.1/tcp/5001",
"Announce": [],
"AppendAnnounce": [],
"Gateway": "/ip4/127.0.0.1/tcp/8080",
"NoAnnounce": [],
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
"/ip6/::/tcp/4001",
"/ip4/0.0.0.0/udp/4001/quic-v1",
"/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
"/ip6/::/udp/4001/quic-v1",
"/ip6/::/udp/4001/quic-v1/webtransport"
]
},
"AutoNAT": {},
"Bootstrap": [
"/ip4/<publicip1>/tcp/4001/p2p/12D3KooWDNYyXGWk7mxG6w1fUmLKVgd7jcW428LgbfWnsfmcANLk",
"/ip4/3.89.36.0/tcp/4001/p2p/12D3KooWNPwwcXzf6bffg5MdZvn67MkahLzSDdcCLZASQ1AvHUgx",
"/ip4/<publicip1>/tcp/4001/p2p/12D3KooWJeCNUxFXmD8pqf27HC9h9rbRxcHfAqc61GCUuTvCiUPE",
"/ip4/<publicip2>/tcp/4001/p2p/12D3KooWR8FQ3pAtnXwJgKKJ2tkwrYbgpzZZUpo7aQcLyVPSqoxL",
"/ip4/<publicip3>/tcp/4001/p2p/12D3KooWCc2QDzx75SGCTuuYnWYFunQTBS8Cd3JTHRvsTWJKK74R",
"/dns/<publicip4>/tcp/19295/p2p/12D3KooWQUJu9N1G7vqbDkzPuKEgjo8NNWkPAoTr4hd2sLVyqMfQ"
],
"DNS": {
"Resolvers": {}
},
"Datastore": {
"BloomFilterSize": 0,
"GCPeriod": "1h",
"HashOnRead": false,
"Spec": {
"mounts": [
{
"child": {
"path": "blocks",
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
"sync": true,
"type": "flatfs"
},
"mountpoint": "/blocks",
"prefix": "flatfs.datastore",
"type": "measure"
},
{
"child": {
"compression": "none",
"path": "datastore",
"type": "levelds"
},
"mountpoint": "/",
"prefix": "leveldb.datastore",
"type": "measure"
}
],
"type": "mount"
},
"StorageGCWatermark": 90,
"StorageMax": "10GB"
},
"Discovery": {
"MDNS": {
"Enabled": true
}
},
"Experimental": {
"FilestoreEnabled": false,
"Libp2pStreamMounting": true,
"OptimisticProvide": false,
"OptimisticProvideJobsPoolSize": 0,
"P2pHttpProxy": false,
"StrategicProviding": false,
"UrlstoreEnabled": false
},
"Gateway": {
"APICommands": [],
"DeserializedResponses": null,
"DisableHTMLErrors": null,
"ExposeRoutingAPI": null,
"HTTPHeaders": {},
"NoDNSLink": false,
"NoFetch": false,
"PathPrefixes": [],
"PublicGateways": null,
"RootRedirect": ""
},
"Identity": {
"PeerID": "12D3KooWFXoGG4a3hcXXaeDc3Qwsg1rbAZoSXjGCkhHaMHE49kht"
},
"Internal": {},
"Ipns": {
"RecordLifetime": "",
"RepublishPeriod": "",
"ResolveCacheSize": 128
},
"Migration": {
"DownloadSources": [],
"Keep": ""
},
"Mounts": {
"FuseAllowOther": false,
"IPFS": "/ipfs",
"IPNS": "/ipns"
},
"Peering": {
"Peers": null
},
"Pinning": {
"RemoteServices": {}
},
"Plugins": {
"Plugins": null
},
"Provider": {
"Strategy": ""
},
"Pubsub": {
"DisableSigning": false,
"Router": ""
},
"Reprovider": {},
"Routing": {
"AcceleratedDHTClient": false,
"Methods": null,
"Routers": null,
"Type": "dht"
},
"Swarm": {
"AddrFilters": null,
"ConnMgr": {},
"DisableBandwidthMetrics": false,
"DisableNatPortMap": false,
"EnableHolePunching": true,
"RelayClient": {
"Enable": true
},
"RelayService": {},
"ResourceMgr": {},
"Transports": {
"Multiplexers": {},
"Network": {},
"Security": {}
}
}
}
I am able to discover the nodes using p2p-circuit but I am unable to connect to them using netcat as mentioned in the example. I am however able to ipfs ping them. Further, when the 2 nodes are not behind a NAT and in the same LAN it works flawlessly. Is this a limitation of v2 relay鈥檚 holepunching? If yes, should I revert back to using v1 relay using the go-libp2p-daemon? If yes, how do I enable the legacy settings in kubo for v1 relays which have been deprecated? Please do let me know.