Ejemplo n.º 1
0
 def receive_tx_list_event(txList, gatewayId, tokenTime, eventTime):
     eventType = "receive_tx_list"
     if eventTime <= p.simTime:
         block = AB()
         block.transactions = txList.copy()
         block.timestamp = tokenTime
         event = Event(eventType, gatewayId, eventTime, block)
         Queue.add_event(event)
Ejemplo n.º 2
0
 def create_block_event_AB(node, eventTime, receiverGatewayId):
     eventType = "create_block"
     if eventTime <= p.simTime:
         # Populate event attributes
         block = AB()
         block.id = random.randrange(100000000000)
         block.timestamp = eventTime
         block.nodeId = node.id
         block.gatewayIds = node.gatewayIds
         block.receiverGatewayId = receiverGatewayId
         event = Event(eventType, node.id, eventTime, block)
         Queue.add_event(event)  # add the event to the queue
Ejemplo n.º 3
0
 def generate_gensis_block():
     from InputsConfig import InputsConfig as p
     for node in p.NODES[0:p.Gn]:
         node.blockchain.append(Block())