コード例 #1
0
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),
    proposal_hashes=
    'e8a0057914a2e1964ae8a945c4723491caae2077a90a00a2aabee22b40081a87',
)

ratecheckbuffer = list()

#hash = sbobj.submit(node1)
#cmd = sbobj.get_submit_command()
コード例 #2
0
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,
                    payment_amount=payout_amount,