Pages:
Author

Topic: Multiple BitCoin clients on same public IP (same household) questions (Read 19094 times)

sr. member
Activity: 252
Merit: 268
Can I assume that not doing anything, allowing multiple independent clients behind a defaulted firewall/router, will work? Just not optimally?
Yeah, it's fine. Especially if you're not generating coins. I'm somewhat superstitious about what does and does not affect bitcoins being generated since it's hard to measure. Being connected to 8 peers shouldn't be detrimental, but it always feels detrimental to me. I just started using -connect= while I've temporarily got a half decent second machine and it just feels better.
member
Activity: 94
Merit: 10
Can I assume that not doing anything, allowing multiple independent clients behind a defaulted firewall/router, will work? Just not optimally?
full member
Activity: 199
Merit: 2384
Here is a similar script written for bash that I use, in case someone else finds it useful.  It will also start bitcoind for me in case it is terminated or if the computer is rebooted.

(replace /home/solar with the dir where you keep your home directory: $HOME)

Code:
#!/bin/bash

NICE=/usr/bin/nice
BITCOIN=/home/solar/bitcoin/bitcoind

ADDR=149iLTM499LvvktTSbub77dJYvZ7YVGtXo
NODE=192.75.207.66

date

${BITCOIN} getbalance 2>&1 | while read balance;
do
  if [ "${balance}" == "0.000000000000000" ];
  then
    echo "zero balance";
  elif [ "${balance}" == "error: couldn't connect to server" ];
  then
    echo "server not running, starting...";
    ${NICE} -n 19 ${BITCOIN} -daemon -addnode=${NODE}
  else
    echo "sending ${balance} BTC to ${ADDR}"
    ${BITCOIN} sendtoaddress ${ADDR} ${balance};
  fi
done

I invoke it from crontab like this
Code:
0 * * * * /home/solar/bitcoin/sendbalance.sh >> /home/solar/bitcoin/sendbalance.log 2>&1

full member
Activity: 210
Merit: 104
Here's the code. It requires JSONRPC from here: http://json-rpc.org/wiki/python-json-rpc

Code:
#!/usr/bin/python
import jsonrpc
BCAddress = "Put Your Master Computer's Bitcoin Address Here"

bitcoin = jsonrpc.ServiceProxy('http://localhost:8332')

bal = float(bitcoin.getbalance())

if bal > 0.01:
    print "We have a balance of {0:.2f}BC. Sending...".format(bal)
    bitcoin.sendtoaddress(BCAddress,bal)

else:
    print "No coins here."
newbie
Activity: 20
Merit: 0
You can easily automate that task. I made a Python script to do just that. I'll upload the updated version to my site and post back here later tonight.

That's actually exactly what I was planning to do, after I read thufir's explanation. I'd definitely like to see your script. It seemed like an easy enough task to take care of, but hey... reuse over reinvention. Smiley
full member
Activity: 210
Merit: 104
I wonder if you can point multiple clients to the same file over the network? I'm guessing it that might not work well if multiple clients are trying to modify/update the same database at the same time?
Yeah, you're right. BerkleyDB doesn't support more than one process accessing a file at once.
sr. member
Activity: 308
Merit: 258
I wonder if you can point multiple clients to the same file over the network? I'm guessing it that might not work well if multiple clients are trying to modify/update the same database at the same time?
full member
Activity: 210
Merit: 104
Chances to generate bitcoins shouldn't depend on network connectivity above a certain base level. If you can receive blocks in a timely manner (somewhat low latency and a decently low packet loss), generating should only depend upon CPU speed (and maybe some other internal specs like memory speed).

Forwarding ports helps the network since more people can connect to you, but I'm running on a university network so I can't forward any ports and it works fine for me.

-connect is a command line option. Right click on your shortcut for Bitcoin, go to properties, and add "-connect 192.168.0.100" (no quotes, and replace the IP with the right one for you) to the end of the path.
Took me a while to figure this out, the command line is wrong (had to dig into the source for this)

It's

-connect=192.168.0.100


You forgot the equal sign  Wink

Otherwise, it doesn't work for either Windows or Linux
Damn, yeah I noticed that reading back through this topic. I get burned by that so often! Thanks, I'll edit my post.

Gotcha! Thanks knightmb and thufir for the info. I was mostly curious because of the exact situation knightmb mentioned - one can only forward a port at the router level to a single NAT'd host, so I wanted to see the best way to use all of my PCs and still manage to accumulate funds under a single "account". Based on thufir's confirmation, it looks like the best way to do so will be to routinely transfer funds from my "workhorse" PCs to my central PC that will house my "primary wallet," for lack of a better description. Smiley

Thanks again!
You can easily automate that task. I made a Python script to do just that. I'll upload the updated version to my site and post back here later tonight.
sr. member
Activity: 308
Merit: 258
That is right that it acts as a bridge for the nodes that -connect to it, however, it does not get their funds. All the nodes are still independent.

All that -connect does is this: instructs the bitcoin client to connect to that peer as the one and only peer it connects to. Otherwise, it operates as normal, just as if that had been the only other peer in the world other than you and you didn't use -connect.
Thanks for clearing that up, I wasn't sure. Actually kind of glad too, keeps it from having the "all the eggs in one basket" so to speak.  Cheesy
newbie
Activity: 20
Merit: 0
Gotcha! Thanks knightmb and thufir for the info. I was mostly curious because of the exact situation knightmb mentioned - one can only forward a port at the router level to a single NAT'd host, so I wanted to see the best way to use all of my PCs and still manage to accumulate funds under a single "account". Based on thufir's confirmation, it looks like the best way to do so will be to routinely transfer funds from my "workhorse" PCs to my central PC that will house my "primary wallet," for lack of a better description. Smiley

Thanks again!
newbie
Activity: 14
Merit: 0
That is right that it acts as a bridge for the nodes that -connect to it, however, it does not get their funds. All the nodes are still independent.

All that -connect does is this: instructs the bitcoin client to connect to that peer as the one and only peer it connects to. Otherwise, it operates as normal, just as if that had been the only other peer in the world other than you and you didn't use -connect.
sr. member
Activity: 308
Merit: 258
I have a quick question about the connect=x.x.x.x option - what exactly does it do? I understand that it "points" a certain bitcoin client to another PC on the LAN, but what does this mean for the bitcoin application itself? Does all coin generation funnel to the wallet that is held on the target PC? Or does a client that is pointed to another local PC just funnel its connections through port 8333 on that PC, and still manage its own wallet?

Just curious.  Smiley
It acts as a bridge for the other computers.  When you only have one IP address, you can technically only forward your connection to a single computer (on port 8333) so the other computers on your network that are running BitCoin won't be able to accept inbound connections from others.

From what I've seen, you have one computer that kind of acts like a server. The other computers on your network connect to it and thus can download all the blocks more quickly to begin processing. The difference is, instead of one computer acting alone to generate coins or process blocks, you now have *other* computers doing part of the work for it and report the results back to it.

I haven't run this long enough to see what effect is has, I'll report back here when I do. My guess is that all the coin generation is funneled back to the "main" computer that all the clients connect to. So, while each client may not get a piece of coin generation, there is no reason why you can't transfer coin around to the clients after they are generated at the main computer (since you have control/access to all of them anyway).

It may take a while, but when I do see some results, I'll post it here because I'm curious myself.  Wink
newbie
Activity: 20
Merit: 0
I have a quick question about the connect=x.x.x.x option - what exactly does it do? I understand that it "points" a certain bitcoin client to another PC on the LAN, but what does this mean for the bitcoin application itself? Does all coin generation funnel to the wallet that is held on the target PC? Or does a client that is pointed to another local PC just funnel its connections through port 8333 on that PC, and still manage its own wallet?

Just curious.  Smiley
sr. member
Activity: 308
Merit: 258
Chances to generate bitcoins shouldn't depend on network connectivity above a certain base level. If you can receive blocks in a timely manner (somewhat low latency and a decently low packet loss), generating should only depend upon CPU speed (and maybe some other internal specs like memory speed).

Forwarding ports helps the network since more people can connect to you, but I'm running on a university network so I can't forward any ports and it works fine for me.

-connect is a command line option. Right click on your shortcut for Bitcoin, go to properties, and add "-connect 192.168.0.100" (no quotes, and replace the IP with the right one for you) to the end of the path.
Took me a while to figure this out, the command line is wrong (had to dig into the source for this)

It's

-connect=192.168.0.100


You forgot the equal sign  Wink

Otherwise, it doesn't work for either Windows or Linux
full member
Activity: 210
Merit: 104
full member
Activity: 210
Merit: 104
Chances to generate bitcoins shouldn't depend on network connectivity above a certain base level. If you can receive blocks in a timely manner (somewhat low latency and a decently low packet loss), generating should only depend upon CPU speed (and maybe some other internal specs like memory speed).

Forwarding ports helps the network since more people can connect to you, but I'm running on a university network so I can't forward any ports and it works fine for me.

-connect is a command line option. Right click on your shortcut for Bitcoin, go to properties, and add "-connect=192.168.0.100" (no quotes, and replace the IP with the right one for you) to the end of the path.

July 12th: Edited to fix my command line.
newbie
Activity: 39
Merit: 0

To make the best use of network resources (yours and other peers'), one computer should be connected to the Internet and have port 8333 forwarded to it. All other computers on that IP address should be started with "-connect x.x.x.x" to connect only to that one computer.

when you say all the other computers should be started with that command, where do I put that connect command exactly?
second question - For Joe SixPack who doesn't know how to set up port-forwarding in his router, will not having port 8333 completely disable his ability to generate bitcoins... ? Or does it just mean he'll have less chances?
administrator
Activity: 5222
Merit: 13032
Each hash your CPU computes gives you a very small chance of solving a block, which wins you 50 BitCoins. Better CPUs can compute more hashes per second. Doubling the number of CPUs you have generating will halve the average time it takes for you to win 50 coins if they all generate at the same speed. How these CPUs are connected to the network doesn't matter at all as long as they are connected.

To make the best use of network resources (yours and other peers'), one computer should be connected to the Internet and have port 8333 forwarded to it. All other computers on that IP address should be started with "-connect x.x.x.x" to connect only to that one computer.
full member
Activity: 199
Merit: 2384
Having more computers will increase your chances of generating blocks regardless of your internet address.  As long as they're all able to connect to at least one node and stay connected you're all good - it doesn't matter if they all share the same internet address through a proxy/router.
Pages:
Jump to: