Bitcoin Forum
September 27, 2018, 10:44:51 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Add nodes from blockchain.info to bitcoind  (Read 2463 times)
emsit
Newbie
*
Offline Offline

Activity: 49
Merit: 0


View Profile WWW
February 09, 2015, 01:51:42 PM
 #1

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
1538088291
Hero Member
*
Offline Offline

Posts: 1538088291

View Profile Personal Message (Offline)

Ignore
1538088291
Reply with quote  #2

1538088291
Report to moderator
1538088291
Hero Member
*
Offline Offline

Posts: 1538088291

View Profile Personal Message (Offline)

Ignore
1538088291
Reply with quote  #2

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

Posts: 1538088291

View Profile Personal Message (Offline)

Ignore
1538088291
Reply with quote  #2

1538088291
Report to moderator
1538088291
Hero Member
*
Offline Offline

Posts: 1538088291

View Profile Personal Message (Offline)

Ignore
1538088291
Reply with quote  #2

1538088291
Report to moderator
Newar
Legendary
*
Offline Offline

Activity: 1344
Merit: 1000


https://gliph.me/hUF


View Profile
February 09, 2015, 02:14:35 PM
 #2


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

OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
rollingMyCar
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
February 09, 2015, 06:11:34 PM
 #3


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

LOL +1...

same here

 Huh Huh Huh Huh
coinpr0n
Hero Member
*****
Offline Offline

Activity: 910
Merit: 1000



View Profile
February 10, 2015, 12:48:12 AM
 #4

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.

Newar
Legendary
*
Offline Offline

Activity: 1344
Merit: 1000


https://gliph.me/hUF


View Profile
February 10, 2015, 03:10:48 AM
 #5

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/

OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
coinpr0n
Hero Member
*****
Offline Offline

Activity: 910
Merit: 1000



View Profile
February 10, 2015, 09:28:27 AM
 #6

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!

unsoindovo
Legendary
*
Offline Offline

Activity: 1540
Merit: 1014


View Profile
February 10, 2015, 09:36:13 AM
 #7

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

 Wink Wink Wink Wink

rikfredsy
Sr. Member
****
Offline Offline

Activity: 241
Merit: 250



View Profile
February 15, 2015, 11:34:06 PM
 #8

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

Newar
Legendary
*
Offline Offline

Activity: 1344
Merit: 1000


https://gliph.me/hUF


View Profile
February 16, 2015, 01:13:25 AM
 #9

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

OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
bloodDiamond
Full Member
***
Offline Offline

Activity: 168
Merit: 100


View Profile
February 16, 2015, 09:07:03 AM
 #10

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!!

zvs
Legendary
*
Offline Offline

Activity: 1596
Merit: 1000


House Nogleg


View Profile WWW
February 19, 2015, 02:14:55 AM
 #11

yeah, don't see the purpose either, re: addnode on blockchain.info nodes.  is the sort random?  even worse if not


Pages: [1]
  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!