Ubuntu, iptables
sudo apt install jq wget
"""Python implementation of an Ascii85 encoding | |
See https://en.wikipedia.org/wiki/Ascii85 | |
Uses classic Ascii85 Algorithm, but a custom alphabet to be used as part of a bismuth bis:// url or json string. | |
(no / \ " ') | |
Inspiration from PyZMQ, BSD Licence | |
Data length to encode must be a multiple of 4, padding with non significant char of #0 has to be added if needed. |
""" | |
Async TCP Client for Bismuth Wallet | |
Eggdrasyl | |
Bismuth Foundation | |
July 2018 | |
""" | |
# add manual refresh, objectify | |
# icons created using http://www.winterdrache.de/freeware/png2ico/ | |
# import sqlite3 | |
import PIL.Image, PIL.ImageTk, pyqrcode, os, time, socks, ast, options, tarfile, essentials, platform | |
import hashlib, base64, icons, log, glob, re | |
# import connections | |
from tokensv2 import * |
mining_hash = bin_convert(hashlib.sha224((miner_address + nonce + db_block_hash) | |
.encode("utf-8")).hexdigest()) | |
diff_drop_time = 180 | |
mining_condition = bin_convert(db_block_hash)[:diff] | |
if mining_condition in mining_hash: # simplified comparison, no backwards mining | |
app_log.info("Difficulty requirement satisfied for block {} from {}".format (block_height_new, peer_ip)) | |
diff_save = diff | |
# Tail Removal Condition Check Starts Here |
def difficulty(c): | |
execute(c, "SELECT block_height, timestamp FROM transactions WHERE reward != 0 ORDER BY block_height DESC LIMIT 2") | |
block_height, timestamp_last = c.fetchone() | |
timestamp_before_last = c.fetchone()[1] | |
execute_param(c, "SELECT timestamp FROM transactions WHERE block_height > ? AND reward != 0 ORDER BY timestamp ASC LIMIT 2", (block_height - 1441,)) | |
timestamp_1441 = c.fetchone()[0] | |
block_time_prev = (timestamp_before_last - timestamp_1441) / 1440 | |
timestamp_1440 = c.fetchone()[0] | |
block_time = (timestamp_last - timestamp_1440) / 1440 |
# never remove the str() conversion in data evaluation or database inserts or you will debug for 14 days as signed types mismatch | |
# if you raise in the server thread, the server will die and node will stop | |
# never use codecs, they are bugged and do not provide proper serialization | |
# must unify node and client now that connections parameters are function parameters | |
# if you have a block of data and want to insert it into sqlite, you must use a single "commit" for the whole batch, it's 100x faster | |
# do not isolation_level=None/WAL hdd levels, it makes saving slow | |
VERSION = "4.2.5.4R" # 4.2.5.4 + rollbacks hooks |
# never remove the str() conversion in data evaluation or database inserts or you will debug for 14 days as signed types mismatch | |
# if you raise in the server thread, the server will die and node will stop | |
# never use codecs, they are bugged and do not provide proper serialization | |
# must unify node and client now that connections parameters are function parameters | |
# if you have a block of data and want to insert it into sqlite, you must use a single "commit" for the whole batch, it's 100x faster | |
# do not isolation_level=None/WAL hdd levels, it makes saving slow | |
VERSION = "4.2.6" # .025 - more hooks |
""" | |
Bismuth Node | |
Cron sentinel by @iyomisc | |
To be run every minute. | |
""" | |
import subprocess | |
# Edit this if you are not using the standard invocation | |
PYTHON_EXECUTABLE='python3' |
EggdraSyl - Sept 2018
From earlier unpublished notes.
Instead of having a single simple mining algorithm like now, move to a dual (or more) mining algorithm system.
The current BIS mining algo is pretty simple (2 sha rounds + diff matching) and can be ported to fpgas and asics with little difficulty and a huge increase in hash/w.