Closed bokoto000 closed 1 year ago
You have not setup your DNS correctly.
dig +short _dnsaddr.0.westend.paritytech.net txt
See details here: https://github.com/libp2p/specs/blob/master/addressing/README.md#dnsaddr-links
But I think you don't want dnsaddr, but rather dns, dns4 or dns6
I believe my DNS is set correctly. The following code returns correctly an ipv4 address:
adr = InetAddress.getByName("0.westend.paritytech.net");
System.out.println(adr.getHostAddress());
I'm trying to populate Kademlia with peers using the findClosestPeers method of the Kademlia class. I get the following error for every address that has /dns/ in the beginning.
java.lang.IllegalArgumentException: Malformed multiaddr: '/dns/boot.stake.plus/tcp/37332
at io.libp2p.core.multiformats.Multiaddr$Companion.parseString(Multiaddr.kt:195)
Populating Kademlia with peers using the bootstrapRoutingTable method of the Kademlia class also returns an error:
java.lang.IllegalArgumentException: Malformed multiaddr: '/dns/0.westend.paritytech.net/tcp/30333/ipfs/12D3KooWKer94o1REDPtAhjtYR4SdLehnSrN8PEhBnZm5NBoCrMC'
Caused by: java.lang.IllegalArgumentException: Unknown protocol name: 'dns'
Using dnsaddr or ip4 however works.
dnsaddr does not mean the domain points to an ip address. It is an ipfs specific txt record. See the link above.
I see. However, I am not sure that this helps me with the issue.
When I bootstrap Kademlia with boot node:/dns/0.westend.paritytech.net/tcp/30333/p2p/12D3KooWKer94o1REDPtAhjtYR4SdLehnSrN8PEhBnZm5NBoCrMC
I recieve this exception:
Malformed multiaddr: '/dns/0.westend.paritytech.net/tcp/30333/ipfs/12D3KooWKer94o1REDPtAhjtYR4SdLehnSrN8PEhBnZm5NBoCrMC
Can I use /dns/ addresses for boot nodes and dial them?
That's an upstream bug in jvm-libp2p. You can work around it using dns4.
We have a predefined list of nodes that we must connect to. We’re bootstrapping using Kademlia. However, we encounter an error when passing the address of the node.
The following code is able to reproduce the problem:
DnsAddr is imported from
org.peergos.protocol.dnsaddr.DnsAddr
.The peer we are trying to connect is:
/dns/0.westend.paritytech.net/tcp/30333/p2p/12D3KooWKer94o1REDPtAhjtYR4SdLehnSrN8PEhBnZm5NBoCrMC
We tried changing the format of the address but it didn’t work out:
/dnsaddr/0.westend.paritytech.net/p2p/12D3KooWKer94o1REDPtAhjtYR4SdLehnSrN8PEhBnZm5NBoCrMC