mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-18 06:34:19 +01:00
Minot simulator updates
This commit is contained in:
@@ -15,14 +15,12 @@ app = Flask(__name__)
|
|||||||
HOST = 'localhost'
|
HOST = 'localhost'
|
||||||
PORT = '18443'
|
PORT = '18443'
|
||||||
|
|
||||||
mining_simulator = ZMQPublisher(topic=b'hashblock', feed_protocol=FEED_PROTOCOL, feed_addr=FEED_ADDR,
|
TIME_BETWEEN_BLOCKS = 10
|
||||||
feed_port=FEED_PORT)
|
|
||||||
|
|
||||||
mempool = []
|
mempool = []
|
||||||
mined_transactions = {}
|
mined_transactions = {}
|
||||||
blocks = {}
|
blocks = {}
|
||||||
blockchain = []
|
blockchain = []
|
||||||
TIME_BETWEEN_BLOCKS = 10
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/', methods=['POST'])
|
@app.route('/', methods=['POST'])
|
||||||
@@ -185,6 +183,9 @@ def simulate_mining():
|
|||||||
global mempool, mined_transactions, blocks, blockchain
|
global mempool, mined_transactions, blocks, blockchain
|
||||||
prev_block_hash = None
|
prev_block_hash = None
|
||||||
|
|
||||||
|
mining_simulator = ZMQPublisher(topic=b'hashblock', feed_protocol=FEED_PROTOCOL, feed_addr=FEED_ADDR,
|
||||||
|
feed_port=FEED_PORT)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
block_hash = os.urandom(32).hex()
|
block_hash = os.urandom(32).hex()
|
||||||
coinbase_tx_hash = os.urandom(32).hex()
|
coinbase_tx_hash = os.urandom(32).hex()
|
||||||
|
|||||||
Reference in New Issue
Block a user