I need to connect to Ropsten network from my Node.js backend . I need to read logs and extract data from them and listen to changes in the network for my contract. The problem is that i don't know how to input credentials of the account that's going to read it (address and private key )
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
}
This is my code from frontend . I'm using metamask and it's getting me the current provider perfectly. But when changing to Node.js , there's no provider of course (Metamask in my case ) .
So the question is : How to input Ropsten network instead of "http://localhost:8545" which refers to a private network and how can i input the account's address and secret key ? Thanks .