I have a blockchain deployed in a cluster. I have a geth instance running in a cluster-node and another one in another cluster-node, making a blockchain. I want to run an script which needs to access to the providers in both cluster-nodes. For example:
node1 - ws:127.0.0.1:3001 node2 - ws:127.0.0.2:3002
In the script I add the providers as:
var web3Provider_1 = new Web3(new Web3.providers.WebsocketProvider('ws://127.0.0.1:3001')); var web3Provider_2 = new Web3(new Web3.providers.WebsocketProvider('ws://127.0.0.2:3002'));
Locally it works, but in the cluster the script cannot find the providers:
Error: Please provide an valid Web3 provider
What is the way to access to the providers to the different nodes in the blockchain from an script running in cluster-node?