SlickTheNick (OP)
|
|
December 13, 2012, 05:16:05 AM Last edit: December 14, 2012, 02:52:56 PM by SlickTheNick |
|
Hey guys, so I installed the bitcoind server on my VPS (latest version of ubuntu, 64 bit). For the most part it works fine, however when I try and use the 'move' command to move balances between accounts, it just hangs there and the server freezes and doesnt accept any more commands (besides the help command). Iv tried searching around a bunch, but I cant seem to find a solution, and most of the information I have found is for windows users.. Is this a common problem? any ideas for a easy way to solve this? Am I going to have to compile a custom build of bitcoin and reinstall it? If so, could anyone tell me how I would go about doing that (total noob to compiling things), or point me to a resource that would show me how? now for part 2.. Im trying to use the jsonRPCClient for PHP to build a web app that uses bitcoin. Part of it requires moving balances between accounts.. hence the issue above. But also, whenever I try and use the sendaddress() call, all I get is a fatal error that states that the http request to the bitcoin server was refused.. Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to .... in jsonRPCClient.php I tried the command directly from the command line, and recieved an error saying that due to the small size of the transaction it required a transaction fee (i forgot to change it from 0.000 btc). Anyways, is it normal behavior for it to throw up the fatal error like that if a command returns false? Shouldnt it just return that the command failed, or return the error that bitcoin spits out, instead of just killing PHP? It doesnt seem to be very well documented.. thanks in advance *edit* see my post on page 2 about how I solved this
|
|
|
|
jbis1
Newbie
Offline
Activity: 50
Merit: 0
|
|
December 13, 2012, 05:37:07 AM |
|
I am not sure about the part one. For the second part, you should implement exception handling. You should have something like the following: try { sendaddress(); } catch(Exception $e) { echo "There was an issue sending the bitcoins. Please try again or notify the site's administrator if you continue to receive this message."; } That will allow php to continue to execute the rest of the code. You should use a try...catch block whenever there is the possibility of an exception being raised.
|
|
|
|
SlickTheNick (OP)
|
|
December 13, 2012, 06:00:23 AM |
|
The accounts are you trying to move do they have a lot of addresses? That is probably the issue.
Error means it can't connect so check your JSONRPC username and password, make sure you are server mode. Also I have seen a lot of people just set rpcssl to 1 without creating the correct key pairs so check that.
no, they are fairly new accounts. I have only like a dozen addresses or so. Also pretty sure its not the user/pass, because I can use getbalance, getinfo, listaccounts, listtransactions, getnewaddress etc. just fine with PHP also good point for the exception handling. Figuring all that stuff out now. But still, not being able to use the move command has kind of put me at a stand still
|
|
|
|
SlickTheNick (OP)
|
|
December 13, 2012, 02:46:02 PM |
|
Is your wallet encrypted cause then you need to unlock it then lock it again.
No, its not currently encrypted at all. Iv managed to use sendtoaddress straight from the command line and its worked fine, but when using the move command it just freezes up completely, forcing me to find the process and terminate it manually
|
|
|
|
paraipan
In memoriam
Legendary
Offline
Activity: 924
Merit: 1004
Firstbits: 1pirata
|
|
December 13, 2012, 02:52:31 PM |
|
Is your wallet encrypted cause then you need to unlock it then lock it again.
No, its not currently encrypted at all. Iv managed to use sendtoaddress straight from the command line and its worked fine, but when using the move command it just freezes up completely, forcing me to find the process and terminate it manually Just trying to wrap my head around your issue here. You say that issuing the following command freezes the daemon? bitcoind move account2 account2 0.01 Can you give an example of account names you have? Note "" is default account and the ones that include a space like "bitcoin account" need to be quoted.
|
BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
|
|
|
SlickTheNick (OP)
|
|
December 13, 2012, 03:15:51 PM |
|
Is your wallet encrypted cause then you need to unlock it then lock it again.
No, its not currently encrypted at all. Iv managed to use sendtoaddress straight from the command line and its worked fine, but when using the move command it just freezes up completely, forcing me to find the process and terminate it manually Just trying to wrap my head around your issue here. You say that issuing the following command freezes the daemon? bitcoind move account2 account2 0.01 Can you give an example of account names you have? Note "" is default account and the ones that include a space like "bitcoin account" need to be quoted. heres the exact command that I ran from the terminal: bitcoind move "derp - 0.4" "Main Account" 0.0016 on further searching, iv found that someone has had a issue with the move command locking up the server, and has made a build/patch of the bitcoind server... see here: https://github.com/sipa/bitcoin/tree/4291e8feab308cb9c7840d74fc7aacf137a7c21fnot sure if that will solve my problem, looks like I would have to build it from source... not really sure how to do that lol. the install file says to use these commands to build it: cd src/ make -f makefile.unix but when I try that it gives me all kinds of errors, like the following: alert.cpp:198: error: âcs_mapAlertsâ was not declared in this scope alert.cpp:198: error: initializer expression list treated as compound expression alert.cpp:206: error: âclass CClientUIInterfaceâ has no member named âNotifyAlertChangedâ alert.cpp:212: error: âclass CClientUIInterfaceâ has no member named âNotifyAlertChangedâ alert.cpp:220: error: expected primary-expression before â&â token
|
|
|
|
paraipan
In memoriam
Legendary
Offline
Activity: 924
Merit: 1004
Firstbits: 1pirata
|
|
December 13, 2012, 03:35:29 PM |
|
... heres the exact command that I ran from the terminal: bitcoind move "derp - 0.4" "Main Account" 0.0016 ... Ok I understand, it should be like: bitcoind move derp "Main Account" 0.0016 Accounts need to exist before moving amounts between them. Is "derp - 0.4" the exact name of the account? Issue a "bitcoind listaccounts" command and find out. I don't think your issue is that serious so you have to build from source.
|
BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
|
|
|
SlickTheNick (OP)
|
|
December 13, 2012, 03:41:05 PM |
|
yep, "derp - 0.4" is the exact name of the account and it has exactly 0.0016 BTC in it. Its a weird name for an account, I know. Dont ask :p
|
|
|
|
paraipan
In memoriam
Legendary
Offline
Activity: 924
Merit: 1004
Firstbits: 1pirata
|
|
December 13, 2012, 03:58:05 PM |
|
yep, "derp - 0.4" is the exact name of the account and it has exactly 0.0016 BTC in it. Its a weird name for an account, I know. Dont ask :p
Got it. I don't know exactly what is the issue you have, never experienced such a thing. I could say is the strange combination of characters in the account name but I could be wrong. Can you try creating test1 and test2 accounts and move coins between them without the ""? Don't worry if they go negative atm.
|
BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
|
|
|
pc
|
|
December 13, 2012, 04:04:04 PM |
|
Might it be the problem that's to-be-fixed in version 0.7.2? Try out the release candidate and see if it works any better for you.
|
|
|
|
paraipan
In memoriam
Legendary
Offline
Activity: 924
Merit: 1004
Firstbits: 1pirata
|
|
December 13, 2012, 04:11:09 PM |
|
Might it be the problem that's to-be-fixed in version 0.7.2? Try out the release candidate and see if it works any better for you. I just saw the fix, nice find Bug fixes ---------
* Prevent RPC 'move' from deadlocking. This was caused by trying to lock the database twice.
|
BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
|
|
|
SlickTheNick (OP)
|
|
December 13, 2012, 11:09:58 PM |
|
Might it be the problem that's to-be-fixed in version 0.7.2? Try out the release candidate and see if it works any better for you. I just saw the fix, nice find Bug fixes ---------
* Prevent RPC 'move' from deadlocking. This was caused by trying to lock the database twice. Awesome, thanks guys. Pretty sure this will work.. maybe I just have no idea what im doing, but I cant seem to get the server to work. According to the release candidate post, all I have to do is copy over the 'bitcoind' file. So i went to /usr/bin/bitcoin, copied the file over, gave the new file executable permissions (sudo chmod +x bitcoind) now, when, heres what I get: # sudo bitcoind exec: 14: /usr/lib/bitcoin/bitcoind: not found
the file is there though, not sure what im missing here?
|
|
|
|
SlickTheNick (OP)
|
|
December 13, 2012, 11:37:53 PM |
|
you have do ./usr/bin/bitcoin/bitcoind
It is cause you didn't alias it with bitcoind, and never run it in sudo either, security risk. that seems to give me the same error. # ./usr/bin/bitcoin/bitcoind -bash: ./usr/bin/bitcoin/bitcoind: No such file or directory
but when I cd into the directory, the file is there.. # cd /usr/lib/bitcoin # ls bitcoind
|
|
|
|
paraipan
In memoriam
Legendary
Offline
Activity: 924
Merit: 1004
Firstbits: 1pirata
|
|
December 13, 2012, 11:58:56 PM |
|
... that seems to give me the same error. # ./usr/bin/bitcoin/bitcoind -bash: ./usr/bin/bitcoin/bitcoind: No such file or directory
but when I cd into the directory, the file is there.. # cd /usr/lib/bitcoin # ls bitcoind
Run... if you have it in that folder
|
BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
|
|
|
SlickTheNick (OP)
|
|
December 14, 2012, 12:06:55 AM |
|
Run... if you have it in that folder hmm... this is confusing. I see the file in there. its named exactly the same. its set to be executable.. but still it keeps saying not found: # ./usr/lib/bitcoin/bitcoind & [1] 3016 -bash: ./usr/lib/bitcoin/bitcoind: No such file or directory
|
|
|
|
SlickTheNick (OP)
|
|
December 14, 2012, 02:24:36 PM |
|
So does anyone have any idea why when I run the 'bitcoind' command it keeps saying the file isnt found, even though I can CLEARLY see it exactly where it should be when I type in 'ls' or when I look at the server through a FTP program...?? doesnt make any sense at all
|
|
|
|
pc
|
|
December 14, 2012, 02:39:18 PM |
|
I'm no expert, but my guess is that it can't find a library it's expecting or something. That is, something trying to load the program is getting a "file not found", and somehow that's bubbling up to a confusing error message.
|
|
|
|
SlickTheNick (OP)
|
|
December 14, 2012, 02:52:01 PM |
|
So I finally figured it out! I backed up my wallet file, completely uninstalled bitcoind and figured out how to successfully compile bitcoin from source, using the 0.7.2rc2 build mentioned previously in the thread. Moved the file that it created into /usr/bin/bitcoind, and the server starts up again! Also tried using the move command, and it works flawlessly
Going to ahead and mark this as solved. Thanks for the help everyone!
|
|
|
|
paraipan
In memoriam
Legendary
Offline
Activity: 924
Merit: 1004
Firstbits: 1pirata
|
|
December 14, 2012, 08:28:50 PM |
|
So I finally figured it out! I backed up my wallet file, completely uninstalled bitcoind and figured out how to successfully compile bitcoin from source, using the 0.7.2rc2 build mentioned previously in the thread. Moved the file that it created into /usr/bin/bitcoind, and the server starts up again! Also tried using the move command, and it works flawlessly
Going to ahead and mark this as solved. Thanks for the help everyone!
Nice to hear that
|
BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
|
|
|
|