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

Run tests inside electron Node.js and Browser process as well #697

Closed
@harshjv

Description

@harshjv

When running js-ipfs daemon with Electron via JS API with js-ipfs daemon running in background, js-ipfs in Electron process throws this error every time it encounters a peer (other js-ipfs node).

Configuration

Electron node

"Addresses": {
  API: "/ip4/127.0.0.1/tcp/5003",
  Swarm: [
    "/ip4/0.0.0.0/tcp/4003",
    "/libp2p-webrtc-star/ip4/188.166.203.82/tcp/20000/ws/ipfs/<PEER-ID>"
  ],
  Gateway: "/ip4/0.0.0.0/tcp/8083"
}

js-ipfs node

"Addresses": {
  API: "/ip4/127.0.0.1/tcp/5002",
  Swarm: [
    "/ip4/0.0.0.0/tcp/4002",
    "/libp2p-webrtc-star/ip4/188.166.203.82/tcp/20000/ws/ipfs/<PEER-ID>"
  ],
  Gateway: "/ip4/0.0.0.0/tcp/8082"
}

Error in js-ipfs node in electron process

Uncaught Exception:
TypeError: Cannot read property 'getRandomValues' of undefined
    at Object.exports.randomBytes (/Users/Project/app/node_modules/libp2p-secio/src/support.js:80:38)
    at Object.exports.createProposal (/Users/Project/app/node_modules/libp2p-secio/src/handshake/crypto.js:21:19)
    at propose (/Users/Project/app/node_modules/libp2p-secio/src/handshake/propose.js:18:31)
    at series (/Users/Project/app/node_modules/libp2p-secio/src/handshake/index.js:13:13)
    at /Users/Project/app/node_modules/async/internal/parallel.js:27:9
    at replenish (/Users/Project/app/node_modules/async/internal/eachOfLimit.js:64:17)
    at /Users/Project/app/node_modules/async/internal/eachOfLimit.js:68:9
    at eachOfLimit (/Users/Project/app/node_modules/async/eachOfLimit.js:37:36)
    at /Users/Project/app/node_modules/async/internal/doLimit.js:9:16
    at _parallel (/Users/Project/app/node_modules/async/internal/parallel.js:26:5)
    at series (/Users/Project/app/node_modules/async/series.js:83:26)
    at handshake (/Users/Project/app/node_modules/libp2p-secio/src/handshake/index.js:12:3)
    at encrypt (/Users/Project/app/node_modules/libp2p-secio/src/index.js:36:7)
    at Object.swarm.handle [as handlerFunc] (/Users/Project/app/node_modules/libp2p-swarm/src/connection.js:87:24)
    at matcher (/Users/Project/app/node_modules/multistream-select/src/listener/select-handler.js:40:28)
    at some (/Users/Project/app/node_modules/multistream-select/src/listener/select-handler.js:71:7)

Platform

Electron v1.4.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    exp/expertHaving worked on the specific codebase is importanthelp wantedSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)status/readyReady to be worked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions