last day (16 days later) » 

3:21 PM
0
A: Ropsten network - 405 Method Not Allowed on eth_sendTransaction

smarxI assume the branch being followed is the one that uses Infura as the provider. Infura can't unlock accounts or sign transactions because it doesn't know your private keys. The error message is to indicate that the methods you're calling are not supported.

 
So, which branch can I use other than infura that enables me to unlock my account?
 
The other branch of the if statement tries to use an injected web3 provider. MetaMask is the most commonly used web3 provider, and it will let the user of your app use any account they've set up with MetaMask.
 
Sorry about the lame question here. My html code calls web3 = new Web3(new Web3.providers.HttpProvider("ropsten.infura.io/")‌​); which basically means that I get connected to ropsten network. In fact, I'm able to 'read' data from contract but when I try to write, I have issue.
 
Is there something about my answer you didn't understand?
 
What you said about metamask and injected web3 are fine. In fact, my code connects ropsten infura. Now the question is, if infura can't unlock accounts/ sign transactions, is there an alternate (public test) environment that does it? Like, will kovan/ rinkeby be able to unlock accounts ?
 
3:21 PM
It doesn't make sense for a public node to hold your private keys. If you unlocked an account on a public node, someone else connected to that node could steal all of your ether.
 
Ok. So, if I am writing an contract and deploy it in test network, how can I execute the methods (using sendTransaction) ?
@smarx Public node won't store my private keys. But if I want to unlock it, I should be able to do so isn't?
"If you unlocked an account on a public node, someone else connected to that node could steal all of your ether. " -- That's valid point. So, if I have to call method addProvider in my contract, I should be able to unlock it, call it and then lock it isn't?
 
3:48 PM
Even if you could do that somehow, it would require giving your private key to the operator of that public node.
Just use MetaMask. This is why it exists.
 

  last day (16 days later) »