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

Startup script: KeyError: 'PORT' #159

Closed bridgedragon closed 2 years ago

bridgedragon commented 2 years ago

Issue

An error is raised when startup script is initiated with certain configuration. I'm attaching the logs.

root@:/home/admin/NodeChain-staging/scripts# ./nodechain.py -t btc -n mainnet -p 30000 -sp 30001 start
---------------------------------------------------
  _  _          _        ___  _                   
 | \| | ___  __| | ___  / __|| |_   __ _ (_) _ _  
 | .` |/ _ \/ _` |/ -_)| (__ | ' \ / _` || || ' \ 
 |_|\_|\___/\__,_|\___| \___||_||_|\__,_||_||_||_|
---------------------------------------------------
===================================================
                CONNECTOR CONFIG
===================================================
Connector is already started.
Please choose the directory to save blockchain data (/srv/nodechain-node/btc_mainnet): 
Do you want to connect to a remote node?: [y/N]: y
Do you want to use the default configuration for the API  [Y/n]: n
Traceback (most recent call last):
  File "./nodechain.py", line 542, in <module>
    args = argumentHandler()
  File "./nodechain.py", line 150, in argumentHandler
    args.func(args)
  File "./nodechain.py", line 184, in start
    startApi(args, token, network)
  File "./nodechain.py", line 380, in startApi
    response = endpoints.addApi(args, token, network, os.environ["PORT"], defaultConfig)
  File "/usr/lib/python3.7/os.py", line 678, in __getitem__
    raise KeyError(key) from None
KeyError: 'PORT'
root@:/home/admin/NodeChain-staging/scripts# 
phoenix-web3 commented 2 years ago

Can you reproduce this same bug using -v flag? @bridgedragon