Ejemplo n.º 1
0

#CTestNetParams
nPowTargetSpacing = 2.5 * 60

#node1 should be a masternode started with "-govtest" parameter
node1 = DashDaemon(host='127.0.0.1', user='******', password='******', port='20007')
#node2 and node3 are regular masternodes
node2 = DashDaemon(host='127.0.0.1', user='******', password='******', port='20002')
node3 = DashDaemon(host='127.0.0.1', user='******', password='******', port='20003')

log1 = testtools.LogListener('/tmp/node1', 10)
log2 = testtools.LogListener('/tmp/node2', 10)
log3 = testtools.LogListener('/tmp/node3', 10)

nSuperblockCycleSeconds = node1.superblockcycle() * nPowTargetSpacing

while (not node1.is_synced() or not node2.is_synced()
       or not node3.is_synced()):
    print('not yet synced, sleep 30 sec')
    time.sleep(30)

# create properly signed trigger that should be accepted as preliminarily valid

event_block_height = node1.next_superblock_height()
payment_amounts = 1

sbobj = Superblock(
    event_block_height=event_block_height,
    payment_addresses='yYe8KwyaUu5YswSYmB3q3ryx8XTUu9y7Ui',
    payment_amounts='{0}'.format(payment_amounts),
Ejemplo n.º 2
0
log3 = testtools.LogListener('/tmp/node9', 10)

while (not node1.is_synced() or not node2.is_synced()
       or not node3.is_synced()):
    print('not yet synced, sleep 5 sec')
    time.sleep(5)

# create proposal

payout_amount = 0.2
payout_month = 50

curunixtime = now()
payout_address = node1.rpc_command("getnewaddress")
proposalfee = node1.proposalfee()
superblockcycle = node1.superblockcycle()
nextsuperblock = node1.next_superblock_height()
curblock = node1.last_superblock_height()

if nextsuperblock - curblock > 10:
    start_epoch = curunixtime
else:
    start_epoch = int(curunixtime + (superblockcycle * 2.6 * 60))

end_epoch = int(start_epoch + payout_month * (superblockcycle * 2.6 * 60) +
                ((superblockcycle / 2) * 2.6 * 60))

proposal = Proposal(name='proposal_' + str(curblock),
                    url='https://dashcentral.com/proposal_' + str(curblock) +
                    '_' + str(curunixtime),
                    payment_address=payout_address,