Giter Site home page Giter Site logo

Comments (9)

justintim-es avatar justintim-es commented on May 21, 2024 1

Used the polkadot api locally and got the genesis hash!
Thanks a lot!

from subport.

JoshOrndorff avatar JoshOrndorff commented on May 21, 2024

Hello @noahsalvadordenjo

I understand that you are trying to run a Substrate node on google cloud and connect the Polkadot JS Apps UI to it. There are a few ways to do this. I'll describe the easiest technique first, then a more robust technique. I'll also observe that getting the UI to connect is unrelated to telemetry.

Using an Insecure Websocket (ws)

When you run your node in google cloud you need to give it the --ws-external flag which opens up your websocket endpoint to receive traffic from the public internet. So your run command might look something like this.

# Run a dev node
./target/release/substrate --dev --ws-external

# Or in general
./path/to/substrate <your preferred flags> --ws-external

Now that your web socket is open to the public, you can open your web browser. (Firefox will not work for this purpose because it will not allow an https site to connect to a ws websocket, work around this for now by using a different browser). You can navigate to https://polkadot.js.org/apps/#/settings. Enable the custom endpoint slider, and then enter your url as
ws://<your gcloud ip addr>:9944. Of course you need to make sure that port 9944 is actually open in your cloud server's firewall.

At this point you should be good to go. If you want to use firefox with the insecure websocket, you will need to host the Apps UI locally. Instructions for that are in its github repo. Firefox also works with the wss method (read on).

Using a Secure Websocket (wss)

If you are using this node for more than just playing around and learning, you'll eventually want a proper wss endpoint. To get one, you can use nginx on your server to act as a reverse proxy. You can reference the official docs and my notes for tips on setting this up and an example configuration file.

When using a secure websocket, you no longer need --ws-external and you can use any browser including firefox.

from subport.

justintim-es avatar justintim-es commented on May 21, 2024

Thanks a lot,
if i run the node

./target/release/node-template   --base-path /tmp/alice   --chain local   --alice   --po
rt 30333   --ws-port 9944   --rpc-port 9933   --telemetry-url 'ws://telemetry.polkadot.io:1024 0'  --ws-external

and connect polkadot with my external ip wss://35.223.179.7:9944 i still have the following error:
You are not connected to a node. Ensure that your node is running and that the Websocket endpoint is reachable.
I know that with ethereum I had to specify my internal ip with --rpcaddr. How do I specify my internal ip?

from subport.

JoshOrndorff avatar JoshOrndorff commented on May 21, 2024

The problem is that you specified the wrong endpoint. You wrote wss://35.223.179.7:9944. But it should be ws://35.223.179.7:9944. Unless you setup nginx like I described (or do something analogous) you are using an insecure ws endpoint.

from subport.

justintim-es avatar justintim-es commented on May 21, 2024

I've enabled my firewall port to allow al incoming traffic and i still have the following error
You are not connected to a node. Ensure that your node is running and that the Websocket endpoint is reachable.
You are connecting from a secure location to an insecure WebSocket (ws://35.223.179.7:9944). Due to browser mixed-content security policies this connection type is not allowed. Change the RPC service to a secure 'wss' endpoint.

from subport.

JoshOrndorff avatar JoshOrndorff commented on May 21, 2024

Are you using firefox?

(Firefox will not work for this purpose because it will not allow an https site to connect to a ws websocket, work around this for now by using a different browser)

from subport.

justintim-es avatar justintim-es commented on May 21, 2024

chrome

from subport.

justintim-es avatar justintim-es commented on May 21, 2024

Is it possible to change

Prometheus server started at 127.0.0.1:9615

to use my internal ip?

from subport.

JoshOrndorff avatar JoshOrndorff commented on May 21, 2024

I haven't seen that issue on chrome. It's possible that they have updated to the same policy as firefox. In that case you have two options.

  1. Setup the reverse proxy so your node has a wss endpoint.
  2. Host the UI locally ([instructions[(https://github.com/polkadot-js/apps#development))

from subport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.