Bitcoin Forum
December 05, 2016, 09:02:14 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: How do I setup a headless bitcoin server?  (Read 5843 times)
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 01, 2011, 08:17:36 AM
 #1

Hello,
I am trying to setup a headless bitcoin server.I only have ssh access. I am using ubunto 9.10. when I do ./bitcoind64 I just get a blank line. and a blinking curser. I cant access it though. if i do ctrl + c and then do ./bitcoind help or getinfo it says it cannot connect to server. can someone help me out here?
1480971734
Hero Member
*
Offline Offline

Posts: 1480971734

View Profile Personal Message (Offline)

Ignore
1480971734
Reply with quote  #2

1480971734
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
doublec
Legendary
*
Offline Offline

Activity: 1078


View Profile
May 01, 2011, 08:58:42 AM
 #2

Hello,
I am trying to setup a headless bitcoin server.I only have ssh access. I am using ubunto 9.10. when I do ./bitcoind64 I just get a blank line. and a blinking curser. I cant access it though. if i do ctrl + c and then do ./bitcoind help or getinfo it says it cannot connect to server. can someone help me out here?
Try: bitcoind -daemon
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 01, 2011, 10:09:57 AM
 #3

that didnt work either. Any ideas?
kseistrup
Hero Member
*****
Offline Offline

Activity: 565


Unselfish actions pay back better


View Profile WWW
May 01, 2011, 10:19:45 AM
 #4

Any ideas?
Code:
$ nohup bitcoind -server &

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 01, 2011, 10:31:42 AM
 #5

that got the server running but I cant conenct to it externally.
here is my conf file
rpcuser=xxx
rpcpassword=xxx
rpctimeout=30
rpcallowip=*.*.*.*
server=1
rpcport=8332

should it be different?
rpcallowip is like that so it takes all connection, i think.
also, as soon as i close putty ssh connection the server goes down again. I have change to fedora 14.
kseistrup
Hero Member
*****
Offline Offline

Activity: 565


Unselfish actions pay back better


View Profile WWW
May 01, 2011, 10:38:27 AM
 #6

that got the server running but I cant conenct to it externally.
here is my conf file
rpcuser=xxx
rpcpassword=xxx
rpctimeout=30
rpcallowip=*.*.*.*
server=1
rpcport=8332

should it be different?
rpcallowip is like that so it takes all connection, i think.

My ~/.bitcoin/bitcoin.conf only has

Code:
rpcuser=myUsername
rpcpassword=myPassword

This make bitcoind bind to localhost/127.0.0.1 and port 8332.  You should only choose something else than localhost if you're on a trusted localnet.

To connect from an external host (example.com), use ssh:

Code:
me@home:~$ ssh me@example.com bitcoind getinfo

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 01, 2011, 11:38:29 AM
 #7

Sounds interesting. Makes the entire json api useless doesn't it. Im gonna have to give this a try. Seems like it will be more secure also.  thanks for the help.
kseistrup
Hero Member
*****
Offline Offline

Activity: 565


Unselfish actions pay back better


View Profile WWW
May 01, 2011, 11:52:21 AM
 #8

Makes the entire json api useless doesn't it.

It might, but it depends on the context.  If you want to read account status or do transactions from within a webapp the JSON API is pretty handy and lightweight (the alternative would be to execute a bitcoind shell command and possibly parsing the output).  For the everyday usage (like transferring bitcoins, generating new addresses) the commandline interface should be sufficient.

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 01, 2011, 12:03:07 PM
 #9

Makes the entire json api useless doesn't it.

It might, but it depends on the context.  If you want to read account status or do transactions from within a webapp the JSON API is pretty handy and lightweight (the alternative would be to execute a bitcoind shell command and possibly parsing the output).  For the everyday usage (like transferring bitcoins, generating new addresses) the commandline interface should be sufficient.

Cheers,
The first example is exactly what i want to do, but it just doesnt work for me at all. I cant have server A connect to server B with the JSON api and the error messages are all the same.
kseistrup
Hero Member
*****
Offline Offline

Activity: 565


Unselfish actions pay back better


View Profile WWW
May 01, 2011, 02:08:17 PM
 #10

I cant have server A connect to server B with the JSON api and the error messages are all the same.

Right, then you have to use the rpcallowip parameter (without this parameter bitcoind listens on localhost only).

Could you show us the relevant error messages, please?  That would make it easier to help you.  Also, could you show us your setup?  You have bitcoind running on remote host B, and you want to sit on host A and be able to remote control the bitcoind running on host B.  Is that correct?

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
Gavin Andresen
Legendary
*
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
May 01, 2011, 02:14:09 PM
 #11

tail -f ~/.bitcoin/debug.log
... will show you what bitcoind is doing.

How often do you get the chance to work on a potentially world-changing project?
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 01, 2011, 09:49:28 PM
 #12

In using the php jsonapi. The error I get is could not connect.i tried the allowip and even set it to all welders and it didn't work . I even tried using a server from rackspace and still no dice. I will post the log a little later.
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 04, 2011, 09:57:20 AM
 #13

Ok, I scraped the host on VPS idea because I don't want to spend money while researching on a fix. I have this thing working now if it is from localhost. I can even put my no-ip url and it works on if i am on my pc. Once i go to another pc and try to connect it does not and there are like no error at all. just says that connection refused.

The problem is when I try to use it from another server.
In my conf file I have
rpcusername=qwe
rpcpassword=asd
rpsallowip=*.*.*.*
rpcport=15147
I am running windows 7, Firewall off, Ports are forwarded correctly.
why is it only my pc can access it, It must be that I am missing some setting but which one? thanks
kseistrup
Hero Member
*****
Offline Offline

Activity: 565


Unselfish actions pay back better


View Profile WWW
May 04, 2011, 11:40:14 AM
 #14

why is it only my pc can access it, It must be that I am missing some setting but which one?

Could you quote the relevant parts of debug.log when a remote host attempts to connect to the server?

I am windows illiterate, but on Linux you can do e.g. “netstat .anp | grep bitcoind” to see which address(es) and port(s) bitcoind is listening on, and your bitcoind should be listening on 0.0.0.0:15147 accoriding to your config.

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 04, 2011, 12:07:19 PM
 #15

I checked my debug log and there is no mention of something trying to connect. I don't understand that at all. Ports are open. Could it be the webhost I am using? I dont thik that should be an issue.
kseistrup
Hero Member
*****
Offline Offline

Activity: 565


Unselfish actions pay back better


View Profile WWW
May 04, 2011, 12:18:59 PM
 #16

just says that connection refused.

Connection refused typically happens when there is nothing listening on the expected address and port.

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 04, 2011, 12:23:56 PM
 #17

netstat reports that I am listening on 0.0.0.0:15147. this entire things is more complicated than I expected. I bet i will eventually have an aha moment and call myself an idiot!
kseistrup
Hero Member
*****
Offline Offline

Activity: 565


Unselfish actions pay back better


View Profile WWW
May 04, 2011, 12:37:12 PM
 #18

netstat reports that I am listening on 0.0.0.0:15147.

Ok, and what happens when you telnet to that port from a remote computer?

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
BitPorium
Hero Member
*****
Offline Offline

Activity: 501


View Profile
May 04, 2011, 01:27:34 PM
 #19

ok, I change to a new port, Windows 7 doesn't allow me to put a port higher than 1024 in telnet. So this is what I did, Verified port 999 was open, Telnet server on that port is reachable from remote device, I used my android phone on 3g, telnet started right up as expected. Retested the php script running on my webhost and still the error. again, log has no mention of a connection. If i try to go to http://myserv:999 on my phone It tries to download a file.

Here is a c&p of my debug log
Code:

Bitcoin version 0.3.20.1 beta
Default data directory C:\Users\Eric\AppData\Roaming\Bitcoin
Bound to port 8333
Loading addresses...
dbenv.open strLogDir=C:\Users\Eric\AppData\Roaming\Bitcoin/database strErrorFile=C:\Users\Eric\AppData\Roaming\Bitcoin/db.log
Loaded 31755 addresses
 addresses               101ms
Loading block index...
LoadBlockIndex(): hashBestChain=00000000000095aa5e8a  height=121809
 block index            1504ms
Loading wallet...
nFileVersion = 32100
fGenerateBitcoins = 1
nTransactionFee = 0
addrIncoming = 255.255.255.255:8333
fMinimizeToTray = 1
fMinimizeOnClose = 1
fUseProxy = 0
addrProxy = 127.0.0.1:9050
 wallet                   43ms
Done loading
mapBlockIndex.size() = 121813
nBestHeight = 121809
mapKeys.size() = 132
mapPubKeys.size() = 132
mapWallet.size() = 44
mapAddressBook.size() = 18
ThreadRPCServer started
sending: version (85 bytes)
host ip 0: 192.168.1.100
addrLocalHost = 192.168.1.100:8333
ThreadIRCSeed started
ThreadMessageHandler started
ThreadOpenConnections started
ThreadSocketHandler started
IRC :giraffe.heliacal.net NOTICE AUTH :*** Looking up your hostname...
IRC :giraffe.heliacal.net NOTICE AUTH :*** Found your hostname
IRC SENDING: NICK x442121147

IRC SENDING: USER x442121147 8 * : x442121147

IRC :giraffe.heliacal.net 001 x442121147 :Welcome to the LFNet Internet Relay Chat Network x442121147
IRC :giraffe.heliacal.net 002 x442121147 :Your host is giraffe.heliacal.net[92.243.23.21/6667], running version hybrid-7.2.3
IRC :giraffe.heliacal.net 003 x442121147 :This server was created Mar 12 2011 at 16:30:05
IRC :giraffe.heliacal.net 004 x442121147 giraffe.heliacal.net hybrid-7.2.3 CDGabcdfgiklnorsuwxyz biklmnopstveI bkloveI
trying connection  lastseen=-0.1hrs lasttry=-362365.3hrs
connected
sending: version (85 bytes)
received: version (85 bytes)
Added time data, samples 2, offset +21 (+0 minutes)
sending: verack (0 bytes)
sending: getaddr (0 bytes)
sending: getblocks (933 bytes)
version message: version 31900, blocks=121809
IRC SENDING: USERHOST x442121147

IRC :giraffe.heliacal.net 302 x442121147 :x442121147=+x442121147@24.189.105.93
GetIPFromIRC() userhost is IP 24.189.105.93
GetIPFromIRC() returned 24.189.105.93
IRC SENDING: NICK u2PcjPcsGAf6CuQ

IRC SENDING: JOIN #bitcoin

IRC SENDING: WHO #bitcoin

received: verack (0 bytes)
trying connection  lastseen=-0.1hrs lasttry=-362365.3hrs
IRC got join
connected
sending: version (85 bytes)
trying connection  lastseen=-0.1hrs lasttry=-362365.3hrs
connected
sending: version (85 bytes)
IRC got who
IRC got who
IRC got who
IRC got who
IRC got who
IRC got who
AddAddress()
IRC got new address
IRC got who
AddAddress()
IRC got new address
received: version (85 bytes)
Added time data, samples 3, offset -4 (+0 minutes)
sending: verack (0 bytes)
sending: getaddr (0 bytes)
version message: version 32002, blocks=121809
IRC got who
IRC got who
IRC got who
AddAddress()
IRC got new address
IRC got who
IRC got who
IRC got who
IRC got who
AddAddress()
IRC got new address
IRC got who
IRC got who
AddAddress()
IRC got new address
IRC got who
IRC got who
IRC got who
IRC got who
AddAddress()
IRC got new address
IRC got who
IRC got who
IRC got who
IRC got who
IRC got who
IRC got who
AddAddress()
IRC got new address
IRC got who
IRC got who
IRC got who
IRC got who
IRC got who
AddAddress()
IRC got new address
IRC got who
IRC got who
IRC got who
AddAddress()
IRC got new address
IRC got who

IRC got who
received: verack (0 bytes)
sending: addr (31 bytes)
IRC got who
IRC got who
IRC got who

IRC got who
trying connection  lastseen=-0.9hrs lasttry=-362365.3hrs
IRC got who

IRC got who

received: addr (30003 bytes)
IRC got who

IRC got join
AddAddress()
IRC got new address
received: addr (30003 bytes)
received: addr (15603 bytes)
received: version (85 bytes)
Added time data, samples 4, offset +6 (+0 minutes)
sending: verack (0 bytes)
sending: getaddr (0 bytes)
version message: version 32100, blocks=121809
received: verack (0 bytes)
sending: addr (31 bytes)
received: addr (30003 bytes)
received: addr (3871 bytes)
IRC got join
IRC got join
AddAddress()
IRC got new address
received: addr (30003 bytes)
received: addr (19743 bytes)
AddAddress()
IRC got join
IRC got join
I cut out a crap load of irc Get Host.
kseistrup
Hero Member
*****
Offline Offline

Activity: 565


Unselfish actions pay back better


View Profile WWW
May 04, 2011, 01:37:59 PM
 #20

I'm afraid I don't know enough about Windows to be able to help you, I hope some of the Windows guys in the forum can.

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!