Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

node.bootstrap.rm oddity? #1707

Closed
lifeBCE opened this issue Nov 10, 2018 · 1 comment
Closed

node.bootstrap.rm oddity? #1707

lifeBCE opened this issue Nov 10, 2018 · 1 comment
Assignees
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia P3 Low: Not priority right now status/ready Ready to be worked

Comments

@lifeBCE
Copy link

lifeBCE commented Nov 10, 2018

  • Version:
    0.33.1

  • Platform:
    Mac OS X 10.12.6
    Chrome: Version 70.0.3538.77 (Official Build) (64-bit)

  • Subsystem:
    ?

Type:

Possible Bug

Severity:

Low

Description:

Am I crazy or should this work?

      const self = this;
      const success = await Promise.all([
        '/dns4/node0.preload.ipfs.io/tcp/443/wss/ipfs/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic',
        '/dns4/node1.preload.ipfs.io/tcp/443/wss/ipfs/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6',
      ].map((boot) => {
        return new Promise((resolve, reject) => {
          self.node.bootstrap.rm(boot, (err, res) =>{
            err ? reject(err) : resolve();
          });
        });
      }));

The second entry in the array is the one that gets removed but the first always remains. When I shift the order, the opposite one gets deleted but the other stays.

Oddly enough, this does work:

      const self = this;
      await new Promise((resolve, reject) => {
        const bad = '/dns4/node0.preload.ipfs.io/tcp/443/wss/ipfs/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic';
        self.node.bootstrap.rm(bad, (err, res) => {
          err ? reject(err) : resolve();
        });
      });

      await new Promise((resolve, reject) => {
        const bad = '/dns4/node1.preload.ipfs.io/tcp/443/wss/ipfs/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6';
        self.node.bootstrap.rm(bad, (err, res) => {
          err ? reject(err) : resolve();
        });
      });

Steps to reproduce the error:

Execute the example code within a browser context and inspect the bootstrap nodes after.

@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up status/ready Ready to be worked P3 Low: Not priority right now labels Nov 14, 2018
@achingbrain
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can #4336 and read the migration guide.

The Bootstrap API has been removed, you can configure the @libp2p/bootstrap module directly instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia P3 Low: Not priority right now status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants