@CortexReaver/

BlockChain

Python

Beginnings of a generic Block Chain module.

fork
loading
Files
  • main.py
  • blockchain.py
  • wibble.json

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.5195143913724909","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IGJsb2NrY2hhaW4KZnJvbSBwcHJpbnQgaW1wb3J0IHBwcmludAppbXBvcnQgc3lzCgpwcHJpbnQoYmxvY2tjaGFpbi5fX3ZlcnNpb25fXykKCmJjID0gYmxvY2tjaGFpbi5CbG9ja0NoYWluKCd3aWJibGUuanNvbicpCgpwcmludCgnQmxvY2tjaGFpbiB3aXRoIHNlcmlhbCAie30iIGxvYWRlZC4nLmZvcm1hdChiYy5fX3NlcmlhbF9fKSkKCiNiYy5hcHBlbmQoJ2ZvbycpCiNiYy5hcHBlbmQoJ2JhcicpCiNiYy5hcHBlbmQoJ2JheicpCmRiYyA9IGJsb2NrY2hhaW4uRGVsZWdhdGVkQmxvY2tDaGFpbihiYy5kZWxlZ2F0ZSgpKQpkYmMuYXBwZW5kKCdiaXonKQpkYmMuYXBwZW5kKCdidXonKQpkYmMuYXBwZW5kKCdmaXonKQpiYy5yZV9pbnRlZ3JhdGUoZGJjLmJsb2NrX2ZyYWdfZGljdCkKYmMuY2xvc2UoKQoKcHJpbnQoYmMuYmxvY2tfanNvbikKcHJpbnQoKQpwcHJpbnQoZGJjLmJsb2NrX2ZyYWdfZGljdCkKc3lzLmV4aXQoMCk="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import blockchain
from pprint import pprint
import sys

pprint(blockchain.__version__)

bc = blockchain.BlockChain('wibble.json')

print('Blockchain with serial "{}" loaded.'.format(bc.__serial__))

#bc.append('foo')
#bc.append('bar')
#bc.append('baz')
dbc = blockchain.DelegatedBlockChain(bc.delegate())
dbc.append('biz')
dbc.append('buz')
dbc.append('fiz')
bc.re_integrate(dbc.block_frag_dict)
bc.close()

print(bc.block_json)
print()
pprint(dbc.block_frag_dict)
sys.exit(0)