I have used web3 to interact with my private chain by using :
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8012"));
But How can I connect to Public Network using web3?
I am trying to make a web interface for interaction with my contract( which deployes, where you can use all the functions provided by my contract using my web interface. I have done this on private network and everything worked seamlessly.
But now I have doubt that whether I can replicate same on public network.
For example let my contract address be x
and contract ABI be y
and I have a function named transfer
to transfer coins. I have done this on private network:
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8012"));
var contract1=web3.eth.contract(y).at(x);
contract1.transfer(to, amount, {from: frm});
Also can I unlock my account using RPC ? I mean if my users want to create an address, If I can ask for password from them and use web3.personal.newAccount(password);
.
To summarise:
- Can I access my contract on Public network using web3? If yes, How?
- Is
personal
exposed over RPC? I mean if I have to generate addresses or unlock account using web3, how can I do that? - There are api that provide Ethereum addresses, how do they work?
personal
API: ethereum.stackexchange.com/questions/1413/…. Also, your clients should be managing their own keys; you shouldn't have access to them