skip to Main Content

I’d like to add WebSocket URL as:

http://0.0.0.0:8900

So I typed solana config get to get the location of config.yaml file. Then changed the WebSocket URL as followed above, however, after restarting the node and the server http://0.0.0.0:8900 is not listed on netstat -tulpn . Do I have to do anything else or my node is unable to recognize the comfig.yaml file? Or do I have to pass additional parameter while starting the node? Any help appreciated thanks in advance.

Result of solana config get:

Config File: /home/centos/.config/solana/cli/config.yml
RPC URL: http://api.devnet.solana.com
WebSocket URL: http://0.0.0.0:8900
Keypair Path: /home/centos/solana/validator-keypair.json
Commitment: confirmed

It changes the WebSocket URL after I modify the config.yaml file but doesn’t listed in netstat.

2

Answers


  1. solana config get only shows the client configuration, and not the node / validator configuration.

    If you’re using either solana-validator or solana-test-validator, you can set the rpc-port at the command line, and the websocket port will be right after:

    $ solana-test-validator --rpc-port 10001
    

    and somewhere else, you can see:

    $ ss -l
    <... truncated ...>
    tcp     LISTEN   0        1024         0.0.0.0:10001      0.0.0.0:*
    tcp     LISTEN   0        1024         0.0.0.0:10002      0.0.0.0:*
    

    So the websocket port is 10002.

    To have the client connect to this validator, you can do:

    solana config set -u http://localhost:10001
    
    Login or Signup to reply.
  2. This is how I started the node:

    solana-validator 
      --ledger /home/centos/solana/data/ 
      --identity /home/centos/solana/validator-keypair.json 
      --entrypoint entrypoint.mainnet-beta.solana.com:8001 
      --expected-genesis-hash 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d 
      --rpc-port 8899 
      --dynamic-port-range 8000-8020 
      --no-voting 
      --enable-rpc-transaction-history 
      --limit-ledger-size 
      --known-validator 7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2 
      --known-validator GdnSyH3YtwcxFvQrVVJMm1JhTS4QVX7MFsX56uJLUfiZ 
      --known-validator DE1bawNcRJB9rVm3buyMVfr8mBEoyyu73NBovf2oXJsJ 
      --known-validator CakcnaRDHka2gXyfbEd2d3xsvkJkqsLw2akB3zsN1D2S 
      --only-known-rpc 
      --no-port-check 
      --full-rpc-api
    

    I did pass the port as 8899, so by default WS port should be 8900 right? I also changed the config.yml file to make it 0.0.0.0 in order to connect outside of the node. It’s visible in netstat ports but I can connect to 8900 only locally.

    Config File: /home/centos/.config/solana/cli/config.yml
    RPC URL: http://0.0.0.0:8899
    WebSocket URL: ws://0.0.0.0:8900
    Keypair Path: /home/centos/validator-keypair.json
    Commitment: confirmed
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search