swapper-org / NodeChain

Nodechain is a service that allows you to create nodes on a blockchain and connect to them natively through APIs. The goal is to allow the user to build their own nodes natively without having to rely on external services.
MIT License
7 stars 5 forks source link

Prevent to add port to url if port is 80 or 443 #125

Closed phoenix-web3 closed 2 years ago

phoenix-web3 commented 2 years ago

Description

~If you specify RPC port as 80 or 443, this port won't be added to the URL.~

~This change applies to every currency excepts XMR. This is because the formation of the URL in XMR is different~

Fixes #124 (issue)

Dependencies (if any)

Type of change

How Has This Been Tested?

Old tests before changing the whole configuration architecture

Old tests

Test Infura connection

$ ./nodechain.py start
---------------------------------------------------
  _  _          _        ___  _                   
 | \| | ___  __| | ___  / __|| |_   __ _ (_) _ _  
 | .` |/ _ \/ _` |/ -_)| (__ | ' \ / _` || || ' \ 
 |_|\_|\___/\__,_|\___| \___||_||_|\__,_||_||_||_|
---------------------------------------------------
===================================================
                CONNECTOR CONFIG
===================================================
Port to start: 60000
Port to start (SSL): 443
Starting network nodechain-network.
nodechain-network is already started
Starting connector and reverse proxy... This might take a while.
Connector has been started
===================================================
                BLOCKCHAIN SELECTION
===================================================
[OFF]          1.Bitcoin
[OFF]          2.Ethereum
[OFF]          3.Bitcoin-cash
[OFF]          4.Terra
               5.Exit
Please choose the blockchain that you want to use to build up/stop the node(1-5): 2
===================================================
                NETWORK SELECTION
===================================================
[OFF]          1.Regtest
[OFF]          2.Testnet
[OFF]          3.Mainnet
               4.Exit
Please choose the network that you want to use (1-4): 2
Please choose the directory to save blockchain data (/srv/nodechain-node/eth_testnet): 
Starting ethtestnetapi node... This might take a while.
ethtestnetapi node started
Do you want to configure your API  [y/N]: y
Please, introduce a value for rpcEndpoint: https://ropsten.infura.io/v3/xxxxxxxxxxxxxxxxxxx1592
Please, introduce a value for wsEndpoint: wss://ropsten.infura.io/ws/v3/xxxxxxxxxxxxxxxxxxx1592
eth testnet has registered succesfully in the connector

imagen

Related PR or Docs PR

Docs PR related # Other PR related #

Good practices to consider