libp2p / js-libp2p-webrtc-star

libp2p WebRTC transport that includes a discovery mechanism provided by the signalling-star
https://libp2p.io
Other
320 stars 97 forks source link

Install and Usage code for js-libp2p-webrtc-star #431

Open Annamarie2019 opened 2 years ago

Annamarie2019 commented 2 years ago

For js-libp2p-webrtc-star-signalling-server, there are 3 issues:

I'm already logged in as Admin.

Here's the end of the log, where the error shows up:

Screen Shot 2022-05-17 at 11 38 44 AM
johnnymatthews commented 2 years ago

Those instructions leave out the fact that you've got to clone the repository, cd into the correct folder, and then run those commands (without the > and $).

Here's what I did (> denotes the output from each command):

  1. Clone the repo:

    git clone https://github.com/libp2p/js-libp2p-webrtc-star.git
    
    > Cloning into 'js-libp2p-webrtc-star'...
    > remote: Enumerating objects: 2665, done.
    > remote: Counting objects: 100% (629/629), done.
    > remote: Compressing objects: 100% (257/257), done.
    
    > remote: Total 2665 (delta 420), reused 542 (delta 361), pack-reused 2036
    > Receiving objects: 100% (2665/2665), 1.66 MiB | 9.42 MiB/s, done.
    > Resolving deltas: 100% (1617/1617), done.
  2. Move into the directory:

    cd js-libp2p-webrtc-star
  3. Install the local @libp2p package:

    npm nstall -g @libp2p/webrtc-star-signalling-server
    
    > added 82 packages, and audited 83 packages in 7s
    > 
    > 2 packages are looking for funding
    >   run `npm fund` for details
    > 
    > found 0 vulnerabilities
  4. Start the webrtc server:

    webrtc-star --port=13579 --host=127.0.0.1
    
    > @libp2p/webrtc-star-signalling-server@1.0.5
    > Listening on: http://127.0.0.1:13579
Annamarie2019 commented 2 years ago

Thanks, @johnnymatthews I was able to execute 1 and 2, but I got a permissions error again on 3. (Also, please note typo in "nstall")

Error1 Logs 2022-05-17 at 9 08 18 PM

I think I need permissions to libp2p.

johnnymatthews commented 2 years ago

No, this isn't a libp2p issue. If it were, we'd be seeing errors from git. It looks like your NPM installation has some funky issues going on. I'd recommend completely uninstalling NPM, and then installing NVM, and managing your NPM installations that way.

wemeetagain commented 2 years ago

Those instructions leave out the fact that you've got to clone the repository, cd into the correct folder, and then run those commands (without the > and $).

Here's what I did (> denotes the output from each command):

1. Clone the repo:
   ```shell
   git clone https://github.com/libp2p/js-libp2p-webrtc-star.git

   > Cloning into 'js-libp2p-webrtc-star'...
   > remote: Enumerating objects: 2665, done.
   > remote: Counting objects: 100% (629/629), done.
   > remote: Compressing objects: 100% (257/257), done.

   > remote: Total 2665 (delta 420), reused 542 (delta 361), pack-reused 2036
   > Receiving objects: 100% (2665/2665), 1.66 MiB | 9.42 MiB/s, done.
   > Resolving deltas: 100% (1617/1617), done.
   ```

2. Move into the directory:
   ```shell
   cd js-libp2p-webrtc-star
   ```

3. Install the local `@libp2p` package:
   ```shell
   npm nstall -g @libp2p/webrtc-star-signalling-server

   > added 82 packages, and audited 83 packages in 7s
   > 
   > 2 packages are looking for funding
   >   run `npm fund` for details
   > 
   > found 0 vulnerabilities
   ```

4. Start the webrtc server:
   ```shell
   webrtc-star --port=13579 --host=127.0.0.1

   > @libp2p/webrtc-star-signalling-server@1.0.5
   > Listening on: http://127.0.0.1:13579
   ```

Hi @johnnymatthews , thanks for finding shortcomings in the docs would you be willing to make a PR that makes the instructions in the README better? :pray: :pray:

johnnymatthews commented 2 years ago

@wemeetagain, for sure! Here's a PR: https://github.com/libp2p/js-libp2p-webrtc-star/pull/435