import sqlite3, keys, base64 from Crypto.Signature import PKCS1_v1_5 from Crypto.Hash import SHA import re import time def percentage(percent, whole): return (percent * whole) / 100.0 (key, private_key_readable, public_key_readable, public_key_hashed, address) = keys.read() confirmations = 5 run = 0 bet_max = 100 checked = [] processed = [] conn = sqlite3.connect('static/ledger.db') conn.text_factory = str c = conn.cursor() while True: if run % 500 == 0: del checked[:] #prevent overflow del processed[:] #prevent overflow run = 0 #reset runs run = run + 1 # confirmations
import sqlite3, time, re, keys, options import tornado.ioloop import tornado.web (key, private_key_readable, public_key_readable, public_key_hashed, address) = keys.read() #import keys config = options.Get() config.read() debug_level = config.debug_level_conf ledger_path_conf = config.ledger_path_conf full_ledger = config.full_ledger_conf ledger_path = config.ledger_path_conf hyper_path = config.hyper_path_conf class MainHandler(tornado.web.RequestHandler): def get(self): # redraw chart while True: try: if full_ledger == 1: conn = sqlite3.connect(ledger_path) else: conn = sqlite3.connect(hyper_path) c = conn.cursor() c.execute(
import sqlite3, keys, base64 from Crypto.Signature import PKCS1_v1_5 from Crypto.Hash import SHA import re import time def percentage(percent, whole): return (percent * whole) / 100.0 (key, private_key_readable, public_key_readable, public_key_hashed, address) = keys.read() run = 0 bet_max = 1000 checked = [] processed = [] while True: if run % 500 == 0: del checked[:] #prevent overflow del processed[:] #prevent overflow run = 0 #reset runs run = run + 1 conn = sqlite3.connect('static/ledger.db') conn.text_factory = str c = conn.cursor() c.execute( "SELECT * FROM transactions WHERE openfield = ? OR openfield = ? and recipient = ? ORDER BY block_height DESC LIMIT 500",
import sqlite3 import keys _, _, _, _, address = keys.read() ledger = sqlite3.connect('static/ledger.db') ledger.text_factory = str cursor = None try: cursor = ledger.cursor() ledger.execute( 'SELECT * FROM transactions WHERE recipient = ? AND openfield LIKE ? ORDER BY block_height DESC, timestamp DESC LIMIT 100;', (address, ) + ('%' + "Archies:" + '%', )) # should work, needs testing result_payouts = ledger.fetchall() print(result_payouts) except Exception as e: print(type(e), e) finally: if cursor is not None: cursor.close() ledger.close()
from Crypto.Hash import SHA import base64 import time import sqlite3 import keys import sys import options config = options.Get() config.read() full_ledger = config.full_ledger_conf ledger_path = config.ledger_path_conf hyper_path = config.hyper_path_conf key, private_key_readable, public_key_readable, public_key_hashed, address = keys.read() print('Number of arguments: %d arguments.' % len(sys.argv)) print('Argument List: %s' % ', '.join(sys.argv)) # get balance # include mempool fees mempool = sqlite3.connect('mempool.db') mempool.text_factory = str m = mempool.cursor() m.execute("SELECT count(amount), sum(amount) FROM transactions WHERE address = ?;", (address,)) result = m.fetchall()[0] if result[1] != None: debit_mempool = float('%.8f' % (float(result[1]) + float(result[1]) * 0.001 + int(result[0]) * 0.01)) else: debit_mempool = 0
import sqlite3, time, keys, options from bottle import route, run, static_file (key, private_key_readable, public_key_readable, public_key_hashed, address) = keys.read() #import keys config = options.Get() config.read() debug_level = config.debug_level_conf ledger_path_conf = config.ledger_path_conf full_ledger = config.full_ledger_conf ledger_path = config.ledger_path_conf hyper_path = config.hyper_path_conf @route('/static/<filename>') def server_static(filename): return static_file(filename, root='static/') @route('/') def hello(): # redraw chart if full_ledger == 1: conn = sqlite3.connect(ledger_path) else: conn = sqlite3.connect(hyper_path) c = conn.cursor() html = [] for row in c.execute("SELECT * FROM transactions WHERE openfield LIKE ? ORDER BY block_height DESC LIMIT 500", ("html=" + '%',)): html.append("Block: ")