From 8b5c87d3563a0dee50ea4d465ed4529406b7e9d8 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 23 Jul 2020 15:16:52 -0500 Subject: [PATCH] Removed single-process POW support, which was just needed on Windows --- CHANGELOG.md | 13 +++++++++++++ src/etc/onionrvalues.py | 2 +- src/etc/powchoice.py | 27 --------------------------- src/onionrblocks/insert/main.py | 10 ++-------- 4 files changed, 16 insertions(+), 36 deletions(-) create mode 100644 CHANGELOG.md delete mode 100755 src/etc/powchoice.py diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..435a8d9d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [5.0.0] - 2020-07-23 + +- Removed single-process POW support (was only needed on Windows) + diff --git a/src/etc/onionrvalues.py b/src/etc/onionrvalues.py index bbf2f8e5..47e55181 100755 --- a/src/etc/onionrvalues.py +++ b/src/etc/onionrvalues.py @@ -23,7 +23,7 @@ import filepaths DENIABLE_PEER_ADDRESS = "OVPCZLOXD6DC5JHX4EQ3PSOGAZ3T24F75HQLIUZSDSMYPEOXCPFA" PASSWORD_LENGTH = 25 ONIONR_TAGLINE = 'Private P2P Communication - GPLv3 - https://Onionr.net' -ONIONR_VERSION = '4.0.0' +ONIONR_VERSION = '5.0.0' ONIONR_VERSION_CODENAME = 'Genesis' ONIONR_VERSION_TUPLE = tuple(ONIONR_VERSION.split('.')) # (MAJOR, MINOR, VERSION) API_VERSION = '1' # increments of 1; only change when something fundamental about how the API works changes. This way other nodes know how to communicate without learning too much information about you. diff --git a/src/etc/powchoice.py b/src/etc/powchoice.py deleted file mode 100755 index a9bcfac7..00000000 --- a/src/etc/powchoice.py +++ /dev/null @@ -1,27 +0,0 @@ -''' - Onionr - Private P2P Communication - - This file does determinations for what proof of work module should be used -''' -''' - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' -import platform -def use_subprocess(config_inst): - use = True - if not config_inst.get('general.use_subprocess_pow_if_possible', True): - use = False - if 'Windows' == platform.system(): - use = False - return use \ No newline at end of file diff --git a/src/onionrblocks/insert/main.py b/src/onionrblocks/insert/main.py index 14f00ea6..6661603c 100644 --- a/src/onionrblocks/insert/main.py +++ b/src/onionrblocks/insert/main.py @@ -12,14 +12,13 @@ import filepaths import onionrstorage from .. import storagecounter from onionrplugins import onionrevents as events -from etc import powchoice, onionrvalues +from etc import onionrvalues import config import onionrcrypto as crypto import onionrexceptions from onionrusers import onionrusers from onionrutils import localcommand, blockmetadata, stringvalidators import coredb -import onionrproofs from onionrproofs import subprocesspow import logger from onionrtypes import UserIDSecretKey @@ -87,8 +86,6 @@ def insert_block(data: Union[str, bytes], header: str = 'txt', our_pub_key = bytesconverter.bytes_to_str( crypto.cryptoutils.get_pub_key_from_priv(our_private_key)) - use_subprocess = powchoice.use_subprocess(config) - retData = False if type(data) is None: @@ -208,10 +205,7 @@ def insert_block(data: Union[str, bytes], header: str = 'txt', metadata['expire'] = expire # send block data (and metadata) to POW module to get tokenized block data - if use_subprocess: - payload = subprocesspow.SubprocessPOW(data, metadata).start() - else: - payload = onionrproofs.POW(metadata, data).waitForResult() + payload = subprocesspow.SubprocessPOW(data, metadata).start() if payload != False: # noqa try: retData = onionrstorage.set_data(payload)