The following information explains the functions you can use from NodeChain, the command-line interface that connects to the Connector and enables you to interact with the blockchain nodes.
You need to be in the scripts folder to run nodechain.py file.
Running the connector
To start using NodeChain it is mandatory to start the connector. Just type:
$python3nodechain.pystart# or$./nodechain.pystart
An interface will open asking for the port and the SSL port on which you want to start the Connector.
$ python3 nodechain.py start
# or
$ ./nodechain.py start
$ ./nodechain.py start
---------------------------------------------------
_ _ _ ___ _
| \| | ___ __| | ___ / __|| |_ __ _ (_) _ _
| .` |/ _ \/ _` |/ -_)| (__ | ' \ / _` || || ' \
|_|\_|\___/\__,_|\___| \___||_||_|\__,_||_||_||_|
---------------------------------------------------
===================================================
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):
Do you want to connect to a remote node?: [y/N]:
Starting ethtestnetapi node... This might take a while.
ethtestnetapi node started
Do you want to use the default configuration for the API [Y/n]: Y
eth testnet has registered succesfully in the connector
$ python3 nodechain.py stop
# or
$ ./nodechain.py stop
# Bitcoin Regtest and Ethereum Regtest nodes are running
$ ./nodechain.py stop
---------------------------------------------------
_ _ _ ___ _
| \| | ___ __| | ___ / __|| |_ __ _ (_) _ _
| .` |/ _ \/ _` |/ -_)| (__ | ' \ / _` || || ' \
|_|\_|\___/\__,_|\___| \___||_||_|\__,_||_||_||_|
---------------------------------------------------
===================================================
CONNECTOR CONFIG
===================================================
Do you want to stop the connector? [y/N]: y
Stopping all APIs...
btc regtest has removed succesfully from the connector
Stopping btcregtestapi node... This might take a while.
btcregtestapi node stopped
Can't stop btc in testnet. Containers are not running
Can't stop btc in mainnet. Containers are not running
eth regtest has removed succesfully from the connector
Stopping ethregtestapi node... This might take a while.
ethregtestapi node stopped
Can't stop eth in testnet. Containers are not running
Can't stop eth in mainnet. Containers are not running
Can't stop bch in testnet. Containers are not running
Can't stop bch in mainnet. Containers are not running
Can't stop luna in testnet. Containers are not running
Can't stop luna in mainnet. Containers are not running
Stopping connector and reverse proxy... This might take a while.
Connector has been stopped
$ python3 nodechain.py stop
# or
$ ./nodechain.py stop
$ ./nodechain.py stop
---------------------------------------------------
_ _ _ ___ _
| \| | ___ __| | ___ / __|| |_ __ _ (_) _ _
| .` |/ _ \/ _` |/ -_)| (__ | ' \ / _` || || ' \
|_|\_|\___/\__,_|\___| \___||_||_|\__,_||_||_||_|
---------------------------------------------------
===================================================
CONNECTOR CONFIG
===================================================
Do you want to stop the connector? [y/N]: n
===================================================
BLOCKCHAIN SELECTION
===================================================
[OFF] 1.Bitcoin
[RUNNING] 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
[RUNNING] 2.Testnet
[OFF] 3.Mainnet
4.Exit
Please choose the network that you want to use (1-4): 2
eth testnet has removed succesfully from the connector
Stopping ethtestnetapi node... This might take a while.
ethtestnetapi node stopped
$ ./nodechain.py status
---------------------------------------------------
_ _ _ ___ _
| \| | ___ __| | ___ / __|| |_ __ _ (_) _ _
| .` |/ _ \/ _` |/ -_)| (__ | ' \ / _` || || ' \
|_|\_|\___/\__,_|\___| \___||_||_|\__,_||_||_||_|
---------------------------------------------------
===================================================
STATUS SELECTION
===================================================
[RUNNING] 1.Connector
[RUNNING] 2.Apis
3.Exit
Please choose any option to show its status (1-3): 2
===================================================
BLOCKCHAIN SELECTION
===================================================
[OFF] 1.Bitcoin
[RUNNING] 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
[RUNNING] 2.Testnet
[OFF] 3.Mainnet
4.Exit
Please choose the network that you want to use (1-4): 2
Getting information of ethtestnetapi containers...
===================================================
ETH TESTNET INFORMATION
===================================================
[RUNNING] Ethereumgo
Connector API information:
{
"coin": "eth",
"config": {
"host": "ethereumgo",
"protocol": "http",
"rpcPort": 8545,
"wsPort": 8545
},
"message": "Configuration for testnet network for currency eth retrieved successfully",
"network": "testnet",
"success": true
}