It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
import electrum
import sys
import time
import socket
# wallet '/root/.electrum/wallets/default_wallet'
CONFIG = electrum.SimpleConfig({
'wallet_path':'/root/.electrum/wallets/default_wallet',
'verbose': True
})
CONFIG.set_key('server', electrum.pick_random_server())
electrum.set_verbosity(CONFIG.get('verbose'))
def syncwallet(wallet,net):
global CONFIG
wallet.start_threads(net)
wallet.update()
max = 10
while not wallet.is_up_to_date():
max-=1
if max < 1:
print("ERROR, cannot connect to electrum servers")
sys.exit(1)
time.sleep(1)
wallet.synchronize()
def get_net():
global CONFIG
net = electrum.network.Network(CONFIG)
net.setDaemon(True)
net.start()
net.random_server()
net.wait_until_connected()
return net
def get_wallet():
global CONFIG
swallet = electrum.WalletStorage(CONFIG)
wallet = electrum.Wallet(swallet)
#print(wallet.storage.path)
return wallet
wallet = get_wallet()
net = get_net()
syncwallet(wallet,net)
cmd = electrum.commands.Commands(wallet,net)
addr = cmd.listaddresses()[0]
print(cmd.getaddressbalance(addr))
print(cmd.getaddressunspent(addr))
print(cmd.getaddresshistory(addr))
#cmd.validateaddress(addr)
#cmd.payto(address,amount,fee)
#cmd.paytomany(outputs,fee)
if wallet: wallet.stop_threads()
if net: net.stop()
root@eniac:~/btcproject# python test.py
wallet path /root/.electrum/wallets/default_wallet
blocks: 298434
connected to electrum.be 50002
connected to electrum.hachre.de 50002
sending subscriptions to electrum.hachre.de:50002:s
connected to e2.pdmc.net 50002
connected to electrum.novit.ro 50002
connected to jwu42.hopto.org 50002
connected to electrum.mindspot.org 50002
synchronizer: connected to electrum.hachre.de:50002:s
0
[]
[]
root@eniac:~/btcproject# python test.py
wallet path /root/.electrum/wallets/default_wallet
blocks: 298434
connected to electrum.novit.ro 50002
connected to bitcoin.epicinet.net 50002
connected to electrum.no-ip.org 50002
synchronizer: connected to ecdsa.org:50002:s
interface: trying to send while not connected
Traceback (most recent call last):
File "test.py", line 50, in
print(cmd.getaddressbalance(addr))
File "/usr/local/lib/python2.7/dist-packages/Electrum-1.9.8-py2.7.egg/electrum/commands.py", line 228, in getaddressbalance
out = self.network.synchronous_get([ ('blockchain.address.get_balance',[addr]) ])[0]
File "/usr/local/lib/python2.7/dist-packages/Electrum-1.9.8-py2.7.egg/electrum/network.py", line 408, in synchronous_get
return self.interface.synchronous_get(requests)
File "/usr/local/lib/python2.7/dist-packages/Electrum-1.9.8-py2.7.egg/electrum/interface.py", line 603, in synchronous_get
id2 = ids[:]
TypeError: 'NoneType' object has no attribute '__getitem__'
import electrum
config = electrum.SimpleConfig({'wallet_path':'/root/.electrum/wallets/default_wallet'})
net = electrum.network.Network()
net.start()
swallet = electrum.WalletStorage(config)
wallet = electrum.Wallet(swallet)
wallet.start_threads(net)
wallet.update()
ec = electrum.commands.Commands(wallet,net)
print(ec.getbalance())