Skip to content

Commit

Permalink
introducing storage conrtacts on blockchain (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
vesellov authored Apr 16, 2024
1 parent 215cf67 commit cb45619
Show file tree
Hide file tree
Showing 43 changed files with 1,770 additions and 272 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Change Log
==========

2024-04-14 Veselin Penev [[email protected]](mailto:[email protected])

* added HMTL WEB template
* updated id_server.py
* built new service_blockchain_explorer()
* updated bitdust/customer/payment.py
* Bump cryptography from 39.0.0 to 41.0.6
* disabled and removed few un-used services
* updated api.services_list()
* updated api.suppliers_list()
* introducing storage contracts
* bug fix in bitdust/storage/accounting.py
* bug fixes in bitdust/supplier/storage_contract.py
* bug fix in supplier_connector()
* IDURL fix in contacts/contactsdb.py
* small fix in main/config.py



2023-11-12 Veselin Penev [[email protected]](mailto:[email protected])

* bug fix in bitdust/system/deploy.py related to python3.11
Expand Down
5 changes: 1 addition & 4 deletions bitdust/automats/automat.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,7 @@ def addStateChangedCallback(self, cb, oldstate=None, newstate=None, callback_id=
if key not in self._state_callbacks:
self._state_callbacks[key] = []
if cb not in self._state_callbacks[key]:
self._state_callbacks[key].append((
callback_id,
cb,
))
self._state_callbacks[key].append((callback_id, cb))
return True

def removeStateChangedCallback(self, cb=None, callback_id=None):
Expand Down
14 changes: 3 additions & 11 deletions bitdust/blockchain/bismuth_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import socks
import hashlib
import random
import traceback

#------------------------------------------------------------------------------

Expand Down Expand Up @@ -95,11 +94,8 @@ def check_start_mining():
global _OwnCoinsLastTime
global _WantMoreCoins
global _MiningIsOn
try:
cur_balance = bismuth_wallet.my_balance()
except:
traceback.print_exc()
cur_balance = 'N/A'

cur_balance = bismuth_wallet.my_balance()

lg.info('my wallet address is %s and current balance is %s' % (bismuth_wallet.my_wallet_address(), cur_balance))
if _Debug:
Expand All @@ -108,11 +104,7 @@ def check_start_mining():
if cur_balance == 'N/A':
reactor.callLater(10, check_start_mining) # @UndefinedVariable
return
try:
cur_balance = float(cur_balance)
except:
reactor.callLater(10, check_start_mining) # @UndefinedVariable
return

if _WantMoreCoins and (not _OwnCoinsLastTime or (time.time() - _OwnCoinsLastTime > 60)):
_OwnCoinsLastTime = time.time()
_WantMoreCoins = False
Expand Down
1 change: 1 addition & 0 deletions bitdust/blockchain/bismuth_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def check_db_for_bootstrap(node):


class CustomLogHandler(logging.Handler):

def emit(self, record):
try:
if _Debug:
Expand Down
15 changes: 11 additions & 4 deletions bitdust/blockchain/bismuth_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#------------------------------------------------------------------------------

from twisted.internet import reactor
from twisted.internet.defer import Deferred
from twisted.internet import reactor # @UnresolvedImport
from twisted.internet.defer import Deferred # @UnresolvedImport

#------------------------------------------------------------------------------

Expand Down Expand Up @@ -125,17 +125,24 @@ def my_wallet_address():


def my_balance():
return client().balance()
try:
_balance = float(client().balance())
except:
lg.exc()
return 'N/A'
return _balance


def latest_transactions(num, offset, for_display, mempool_included):
return client().latest_transactions(num, offset, for_display, mempool_included)


def send_transaction(recipient, amount, operation='', data=''):
def send_transaction(recipient, amount, operation='', data='', raise_errors=False):
error_reply = []
ret = client().send(recipient=recipient, amount=amount, operation=operation, data=data, error_reply=error_reply)
if not ret:
if raise_errors:
raise Exception(error_reply)
return error_reply
return ret

Expand Down
Loading

0 comments on commit cb45619

Please sign in to comment.