I am accessing my accounts and everything using Ethereum Wallet (Mist) but I was wondering is there any possible way to access my account using some http request?
Asked
Active
Viewed 302 times
2
Prashant Prabhakar Singh
- 8,026
- 5
- 40
- 79
-
1Yes, but if you're not careful and don't do it safely and correctly, that means anyone online could also access your account with an http request. See http://ethereum.stackexchange.com/questions/3887/how-to-reduce-the-chances-of-your-ethereum-wallet-getting-hacked – eth Aug 23 '16 at 09:36
-
Even I got {"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}} when I hit local host. Prashant, Did u find any method? – nara Sep 09 '16 at 09:53
-
I have wrote a HTML script using web3, and I am able to access my accounts, contracts and everything that I could access from geth console. – Prashant Prabhakar Singh Sep 12 '16 at 10:29
1 Answers
3
Sure, but you need to launch geth with the web3 and personal modules:
geth --datadir myGethDirectory --rpc --rpcport "8000" --rpc-api "admin,db,eth,debug,miner,net,personal,web3"
Then you can either throw JSON objects at the loop back address on port 8000 or use web3 to interact with the client.
Note that anyone with access to the machine running geth will be able to use its RPC interface. So use this option only on trusted/secure networks.
For how to use web3 see this question and the documentation.
To unlock an account run:
web3.personal.unlockAccount("0x1234...", "password", timeout);
-
Thanks. but I have never worked with web3, so any help on how to use web3 to make https request to my account? – Prashant Prabhakar Singh Aug 24 '16 at 08:56
-
-
Thanks for support but the link provided contains whole
web3documentation. I specifically wanted to know How can I access my accounts using http request. Usingweb3is quite general answer .Do I need to ask separate question for this? – Prashant Prabhakar Singh Aug 24 '16 at 09:47 -
-
I am puzzled with this question. Probably I couldn't make myself clear enough in question. I have used
personal.unlockAccount(..)to unlock and access my account from geth console. What if I want to access my account from a web browser. If my rpcport isxxxx. Currently when I accesshttp://localhost:xxxx/I get{"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}}. I wish if i could get my any details regarding my account here. – Prashant Prabhakar Singh Aug 24 '16 at 12:17 -
You need to send valid JSON-RPC requests; in Javascript, the web3 library will do this for you. You can't simply load the RPC URL in your browser and expect to get a useful result. – Nick Johnson Sep 09 '16 at 09:55
-
Thanks for response. I know of course I need to send a valid JSON-RPC requests, but what will be format of that request? I asked separate question on that What will be format of data to execute a function from Web. You can post you valuable answer/comment there. – Prashant Prabhakar Singh Sep 12 '16 at 10:36