Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug: Bootstrap connected to 0 nodes close to us. #93

Closed
seras42 opened this issue May 7, 2024 · 5 comments
Closed

Possible bug: Bootstrap connected to 0 nodes close to us. #93

seras42 opened this issue May 7, 2024 · 5 comments

Comments

@seras42
Copy link

seras42 commented May 7, 2024

Good day, sorry for disturbing this repo again.

It seems to me i have discovered another possible bug. I would like to confirm it with this repo. For some reason, if i fork nabu, it works well and connects to nodes, but if i try to use grade implementation i cannot connect to any sort of peers or nodes. Even tough i use the same code:

Log output:

Gradle implementation:
implementation 'com.github.Peergos:nabu:latest.release'
INFO: Bootstrap connected to 0 nodes close to us.
Fork: v0.7.7
INFO: Bootstrap connected to 14 nodes close to us.

Same code:

     public void init(){
        RecordStore recordStore = new RamRecordStore();
        Blockstore blockStore = new RamBlockstore();


        int portNumber = 10000 + new Random().nextInt(50000);
        List<MultiAddress> swarmAddresses = List.of(new MultiAddress("/ip6/::/tcp/" + portNumber));
        List<MultiAddress> bootstrapNodes = new ArrayList<>(Config.defaultBootstrapNodes);

        HostBuilder builder = new HostBuilder().generateIdentity();
        PrivKey privKey = builder.getPrivateKey();
        PeerId peerId = builder.getPeerId();
        System.out.println("My PeerId:" + peerId.toBase58());
        IdentitySection identitySection = new IdentitySection(privKey.bytes(), peerId);
        BlockRequestAuthoriser authoriser = (c, p, a) -> CompletableFuture.completedFuture(true);

        EmbeddedIpfs embeddedIpfs = EmbeddedIpfs.build(recordStore, blockStore, false,
                swarmAddresses,
                bootstrapNodes,
                identitySection,
                authoriser, Optional.of(SeekerIFS.proxyHandler()));
        embeddedIpfs.start();
    }


@ianopolous
Copy link
Member

Do subsequent lines also say "INFO: Bootstrap connected to 0 nodes close to us" or are they greater than 0?

@seras42
Copy link
Author

seras42 commented May 8, 2024

Yes, its always 0. Even if i use different code, just the Kademelia part. I can't seem to figure out why the gradle implementation doesn't work, but fork does.

May 08, 2024 12:21:22 PM org.peergos.EmbeddedIpfs start
INFO: Node started and listening on [/ip6/::/tcp/45320/p2p/=====================================]
May 08, 2024 12:21:22 PM org.peergos.EmbeddedIpfs start
INFO: Bootstrapping IPFS routing table
May 08, 2024 12:21:23 PM org.peergos.EmbeddedIpfs start
INFO: Bootstrapping IPFS kademlia
May 08, 2024 12:21:23 PM org.peergos.protocol.dht.Kademlia bootstrap
INFO: Bootstrap connected to 0 nodes close to us.
May 08, 2024 12:21:23 PM org.peergos.protocol.dht.Kademlia bootstrap
INFO: Bootstrap connected to 0 nodes close to us.```

@ianopolous
Copy link
Member

I can reproduce this in nabu-chat. Not sure what's going on yet.

A work around in the meantime is likely to vendor a locally built nabu jar. That is what we do in Peergos.

@ianopolous
Copy link
Member

Ok this should be fixed with v0.7.9. Can you try that?

@seras42
Copy link
Author

seras42 commented May 10, 2024

Confirmed it works. However i had to add this to the gradle or i would get an error, this was not asked before.

maven {url "https://artifacts.consensys.net/public/maven/maven/"}
implementation 'tech.pegasys:noise-java:22.1.0'

If not would get this error:

   > Could not find tech.pegasys:noise-java:22.1.0.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/tech/pegasys/noise-java/22.1.0/noise-java-22.1.0.pom
       - https://dl.google.com/dl/android/maven2/tech/pegasys/noise-java/22.1.0/noise-java-22.1.0.pom
       - https://jitpack.io/tech/pegasys/noise-java/22.1.0/noise-java-22.1.0.pom
       - https://jcenter.bintray.com/tech/pegasys/noise-java/22.1.0/noise-java-22.1.0.pom
     Required by:
         project :

@seras42 seras42 closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants