Thank you so much for the updated code. I'll have to try it out when I get home. Just curious, would this work in the code? I'm not sure which prog language the bash script uses. Also, would it be possible to have the bounce prog create a log of the time and date for each time there is a failed ping attempt? Yean, $((5*60)) to do maths, not just 5*60 And in .xprofile: /path/to/script >> ~/bounce-log.txt &
will make it append to the end of bounce-log.txt while it's running. You'll see all the successful pings in there too, so comment that line out if you don't want them.
|
|
|
I am not sure this a suitable to be on by default. This will cause a great amount of lost bitcoins because unsophisticated users are careless.
+1 This is fine living in a separate branch. Being able to recompile a branch is a nice barrier of entry for the tech. clueless. This SHOULD be included in the default client. Reason being, it is incredibly useful for people who know how to use it, and not all of us know how to use linux or feel like spending hours on Windows attempting to compile the source with all of the dependencies. Discluding a feature like this from anyone who doesn't know how to compile c code would be a terrible thing. I think "I am not sure this a suitable to be on by default" was referring to the "Can i also remove a key from the wallet with this patch?" request. Removing keys from wallets isn't "incredibly useful" if you already have the ability to dump wallets and import those dumped keys into other wallets.
|
|
|
For some reason it won't work right when it's set as a startup program. I think it has to do with the fact that the bounce program starts before the network manager connects to the router. It also does not work right if you start the bounce program while its not connected to the network. So I commented out the .xprofile file and manually started bounce after the network connected and my miner has been working ever since! I also adjusted the ping rate to every 5 min.
Right. I'll update it so that it waits for you to get connected before it starts pinging. Here's an updated copy. You should be able to run this from your .xprofile - it doesn't give up if the network is down when you first run it. #!/bin/bash
######################################################################## # # we need to be able to restart the network-manager to reconnect # automatically. this usually requires us to type our password, but # since we want to be able to run this unattended, we need to tell # sudo that we can restart network-manager without typing our password # to set that up, run these two commands in a terminal while logged in # as your regular user: # # echo "$(whoami) ALL=(ALL) NOPASSWD: /etc/init.d/network-manager" | sudo tee /etc/sudoers.d/network-manager # sudo chmod 0440 /etc/sudoers.d/network-manager # ########################################################################
ping_pause=10 # how long, in seconds, to wait between ping attempts restart_pause=60 # how long, in seconds, to wait after restarting networking
########################################################################
log() { echo "$(date) $@" }
restart-network() { log "restarting networking" sudo /etc/init.d/network-manager restart > /dev/null # give it a minute to reconnect before we start checking again log "waiting $restart_pause seconds" sleep $restart_pause } # find the address of our router log "finding router address" while true do router=$(route | grep ^default | awk '{print $2}')
if [[ -z $router ]] then log "can't determine router" restart-network else break fi done log "router address '$router'"
# ping it repeatedly while true do log "pinging router '$router'" if ! ping -c 1 $router > /dev/null then log "ping failed" restart-network fi sleep $ping_pause done
|
|
|
For some reason it won't work right when it's set as a startup program. I think it has to do with the fact that the bounce program starts before the network manager connects to the router. It also does not work right if you start the bounce program while its not connected to the network. So I commented out the .xprofile file and manually started bounce after the network connected and my miner has been working ever since! I also adjusted the ping rate to every 5 min.
Right. I'll update it so that it waits for you to get connected before it starts pinging.
|
|
|
Excuse my ignorance, but does "sudo" work from within a script like that?
Read the comment at the top of the script. There are two command lines embedded within the comment which you need to run once. Once you've run then, the 'sudo' line will work from within an unattended script.
|
|
|
I'd like to be able to rename my wallet.dat to some other file, and the client asks for the file on startup.
Something like this will do it for you on Linux: #!/bin/bash
cd wallet=~/.bitcoin/wallet.dat
if [[ -e "$wallet" ]] then echo "real wallet file $wallet already exists; giving up" exit 1 fi
echo -n "which file is your wallet hidden as? " read hidden
if [[ ! -e "$hidden" ]] then echo "hidden wallet file $hidden doesn't exist" exit 1 fi
echo "moving hidden wallet to $wallet" mv -i "$hidden" "$wallet"
sleep 1
echo "starting bitcoin" bitcoin "$@"
sleep 1
echo "moving $wallet back to secret location" mv -i "$wallet" "$hidden"
Save to a file, add a line to the end of .bashrc saying: alias bitcoin="/path/to/script-file"
Start a new terminal, type 'bitcoin', and it should use the script instead of the regular client.
|
|
|
That's a great script. Thanks for sharing.
You're welcome.
|
|
|
I sent him this script and it seems to be doing the job: #!/bin/bash
######################################################################## # # we need to be able to restart the network-manager to reconnect # automatically. this usually requires us to type our password, but # since we want to be able to run this unattended, we need to tell # sudo that we can restart network-manager without typing our password # to set that up, run these two commands in a terminal while logged in # as your regular user: # # echo "$(whoami) ALL=(ALL) NOPASSWD: /etc/init.d/network-manager" | sudo tee /etc/sudoers.d/network-manager # sudo chmod 0440 /etc/sudoers.d/network-manager # ########################################################################
# how long, in seconds, to wait between ping attempts pause=10
########################################################################
# find the address of our router router=$(route | grep ^default | awk '{print $2}')
if [[ -z $router ]] then echo "can't determine router - is network down already?" exit 1 fi
while true do echo "$(date) pinging router '$router'" if ! ping -c 1 $router > /dev/null then echo "$(date) ping failed; restarting network-manager" sudo /etc/init.d/network-manager restart
# give it a minute to reconnect before we start checking again sleep 60 fi sleep $pause done
The two commands mentioned in comments at the top of the script need to be run if you want to run the script as a regular user and have it be able to restart the network-manager without prompting for a password. The script needs to be saved to a file, then set as executable ("chmod +x scriptname"). It can be run automatically on login by putting /path/to/script/scriptname &
in .xprofile in your home directory, which probably doesn't exist. Just make it. In my case, that's "/home/chris/bounce &", but call it what you like and put it where you like.
|
|
|
OK. Maybe don't link to it in your signature for now then, if you know it's not working.
|
|
|
Forbidden
You don't have permission to access /bitcoin/ on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. [code] [/code]
|
|
|
How long untill you see that its actually being adressed (I dont mean cleared). Not stressing just trying to get an idea of whats normal ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) I think last time I transferred from my Nat West to the Britcoin Lloyds TSB it took 23 hours for the funds to show up in Britcoin. They were cleared and spendable after 23 hours - I didn't see any 'pending' status. (But I wasn't obsessively refreshing).
|
|
|
I entered my newly created openid login created at myopenid as suggested but when I click the Submit button I get:
Couldn't resolve host '<my login id - removed for this post>'
Any ideas?
Seems the site was down for a while. Seems OK again now.
|
|
|
There isn't anything to absorb. The rounding occurs in the exchange rate. So we simply run the exchange at that rate.
I think what Genjix might be saying is that it would be possible to round the result in the favour of both sides of the trade so they both gain a fraction of a 'satoshi', and the exchange loses a satoshi on each trade. Currently one side gains a fraction and the other side loses a fraction, but it would be possible (and very cheap) for both sides to gain. Then you could claim to be the only exchange with negative commission! ![Wink](https://bitcointalk.org/Smileys/default/wink.gif)
|
|
|
We round up for the person and absorb that cost ourselves. So the parties involved get more money than they asked for.
Your calculations end up with an amount of BTC and an amount of GBP. The BTC amount is taken from one person and given to the other, and the GBP amount is taken from the 2nd and given to the 1st. It's a zero sum game as far as you are concerned. So where's the 'absorb that cost' bit? When the division isn't exact, one person loses less than 0.01 uBTC and the other gains it. I don't see how the exchange is absorbing anything.
|
|
|
You zip file seems broken.
I tried downloading it twice, and got the same both times - a tiny text file with an error from woofiles in it: $ cat Bitcoin_Safe_Usage_v02.zip <br /> <b>Warning</b>: fclose(): supplied argument is not a valid stream resource in <b>/srv/www/lighttpd/woofiles/includes/HTTPDownload.class.php</b> on line <b>191</b><br />
|
|
|
I propose storing what you have, and the rate you want, along with the currency you have and want.
|
|
|
we ran our unit testing scripts and didn't find any problems with the rates, could you tell use what order this is so we could check it out.
I have no way of knowing - it wasn't my order, but it's clearly wrong. The timestamps in the list of trades I posted are in Pacific time. Add 8 hours to get BST; that should let you find it. Or query on the price since there shouldn't be more than that one order with that price: select * from transactions where abs(a_amount/b_amount-0.4463) < 0.0001 or abs(b_amount/a_amount-0.4463) < 0.0001;
The problem is that the want_amount field of the orderbook table is used for doing matches when I don't think it should be. Suppose you have an order on the books and someone comes along and fills most of it by offering a much better rate than you asked for. Your (have) amount field will be reduced some, and your want_amount field will be reduced a lot, leaving you the ratio of 'want' to 'have' being much lower than the ratio of initial_want_amount to initial_amount. Since want_amount is used in the matching code, you can end up with the leftover portion of your order being matched at a very unfavourable rate for you. My patch at https://gitorious.org/~dooglus/intersango/dooglus-intersango/commit/126d05d8f23a2745da8db65fb57414eca607d0d8 fixes the problem by never using the want_amount column other than for display.
|
|
|
So the timestamp of a new block has to be less than 2 hours in the future, and newer than the median of the timestamps on the previous 11 blocks, which will be about 1 hour in the past.
|
|
|
Then there's this, which rejects blocks with too early a timestamp: // Check timestamp against prev if (GetBlockTime() <= pindexPrev->GetMedianTimePast()) return error("AcceptBlock() : block's timestamp is too early");
|
|
|
|