Bitcoin Forum
May 27, 2024, 10:34:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Add nodes from blockchain.info to bitcoind  (Read 2536 times)
emsit (OP)
Member
**
Offline Offline

Activity: 63
Merit: 11


View Profile WWW
February 09, 2015, 01:51:42 PM
Last edit: February 12, 2015, 11:43:42 AM by emsit
 #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
Newar
Legendary
*
Offline Offline

Activity: 1358
Merit: 1001


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: 1358
Merit: 1001


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: 1932
Merit: 1042

https://locktrip.com/?refId=40964


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: 256
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: 1358
Merit: 1001


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: 1680
Merit: 1000


https://web.archive.org/web/*/nogleg.com


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!