added first block spec draft
This commit is contained in:
parent
f7ae054d09
commit
ad94c8a4ef
5 changed files with 67 additions and 4 deletions
|
@ -325,7 +325,6 @@ class API:
|
|||
if pubkey in self._core.onionrInst.communicatorInst.active_services:
|
||||
return Response('true')
|
||||
except AttributeError as e:
|
||||
print('attribute error', str(e))
|
||||
pass
|
||||
return Response('false')
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@
|
|||
class OnionrValues:
|
||||
def __init__(self):
|
||||
self.passwordLength = 20
|
||||
self.blockMetadataLengths = {'meta': 1000, 'sig': 200, 'signer': 200, 'time': 10, 'powRandomToken': 1000, 'encryptType': 4, 'expire': 14} #TODO properly refine values to minimum needed
|
||||
self.blockMetadataLengths = {'meta': 1000, 'sig': 200, 'signer': 200, 'time': 10, 'pow': 1000, 'encryptType': 4, 'expire': 14} #TODO properly refine values to minimum needed
|
||||
self.default_expire = 2592000
|
|
@ -247,7 +247,7 @@ class POW:
|
|||
startNonce = nonce
|
||||
while self.hashing:
|
||||
#token = nacl.hash.blake2b(rand + self.data).decode()
|
||||
self.metadata['powRandomToken'] = nonce
|
||||
self.metadata['pow'] = nonce
|
||||
payload = json.dumps(self.metadata).encode() + b'\n' + self.data
|
||||
token = myCore._crypto.sha3Hash(payload)
|
||||
try:
|
||||
|
|
|
@ -75,7 +75,7 @@ class SubprocessPOW:
|
|||
difficulty = self.difficulty
|
||||
mcore = core.Core()
|
||||
while True:
|
||||
metadata['powRandomToken'] = nonce
|
||||
metadata['pow'] = nonce
|
||||
payload = json.dumps(metadata).encode() + b'\n' + data
|
||||
token = mcore._crypto.sha3Hash(payload)
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue