Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: emsit on February 09, 2015, 01:51:42 PM



Title: Add nodes from blockchain.info to bitcoind
Post by: emsit on February 09, 2015, 01:51:42 PM
Hello,

I've created a simple bash script for insert nodes from blockchain.info to bitcoind.

Code:
#!/bin/bash
 
# Add nodes from blockchain.info to bitcoind
# Tested on bitcoin version 0.9.1
 
#run as Bitcoin user
#su -l Bitcoin -c "/home/addnode.sh" -s /bin/sh
 
clear
 
IFS=$'\n'
nodes=`curl -s http://blockchain.info/connected-nodes | egrep -o '([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)' | sort -u`
i=0
for node in $nodes; do
bitcoin=`bitcoind addnode $node add 2>&1`
if [ -z "$bitcoin" ]; then
((i++))
elif [ -n "`echo $bitcoin | grep -v 'error: {"code":-23,"message":"Error: Node already added"}'`" ]; then
echo "Unknown error: $bitcoin"
exit 1
fi
done
 
if [ "$i" -gt 0 ]; then
echo "Successfully added $i new nodes."
else
echo "There are no new nodes."
fi

Can be run from a cronjob (change path):
Code:
*/30 * * * * /home/addnode.sh > /dev/null

Here is source: https://gist.github.com/emsit/98f13006afa2ff69328b


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: Newar on February 09, 2015, 02:14:35 PM

I don't see how this would be useful / a good idea?


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: rollingMyCar on February 09, 2015, 06:11:34 PM

I don't see how this would be useful / a good idea?

LOL +1...

same here

 ??? ??? ??? ???


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: coinpr0n on February 10, 2015, 12:48:12 AM
Haven't tried the script, but the list of connected nodes (http://blockchain.info/connected-nodes) is something interesting and I didn't know was there.


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: Newar on February 10, 2015, 03:10:48 AM
Haven't tried the script, but the list of connected nodes (http://blockchain.info/connected-nodes) is something interesting and I didn't know was there.

Then you might find this interesting too: https://getaddr.bitnodes.io/


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: coinpr0n on February 10, 2015, 09:28:27 AM
Haven't tried the script, but the list of connected nodes (http://blockchain.info/connected-nodes) is something interesting and I didn't know was there.

Then you might find this interesting too: https://getaddr.bitnodes.io/

Oh yeah. Even better!


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: unsoindovo on February 10, 2015, 09:36:13 AM
Haven't tried the script, but the list of connected nodes (http://blockchain.info/connected-nodes) is something interesting and I didn't know was there.

many thanks!!!

i just bookmarket the list URL!

may always be useful

 ;) ;) ;) ;)


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: rikfredsy on February 15, 2015, 11:34:06 PM
Can this create a node i really want to create one for myself ,
Did the nodes owner make profit I heard that they earn from each transactions


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: Newar on February 16, 2015, 01:13:25 AM
Can this create a node i really want to create one for myself ,
Did the nodes owner make profit I heard that they earn from each transactions

This script won't create a node.

You don't make profit from running a node. There is currently a lottery going on, but it will unlikely cover your costs for running a node:
https://getaddr.bitnodes.io/nodes/incentive/

Reasons why people run full nodes even without financial reward: https://en.bitcoin.it/wiki/Full_node#Why_should_you_run_a_full_node.3F


Title: Re: Add nodes from blockchain.info to bitcoind
Post by: bloodDiamond on February 16, 2015, 09:07:03 AM
Haven't tried the script, but the list of connected nodes (http://blockchain.info/connected-nodes) is something interesting and I didn't know was there.

Then you might find this interesting too: https://getaddr.bitnodes.io/

thank you very much for the tutoril newar!!



Title: Re: Add nodes from blockchain.info to bitcoind
Post by: zvs on February 19, 2015, 02:14:55 AM
yeah, don't see the purpose either, re: addnode on blockchain.info nodes.  is the sort random?  even worse if not