-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
105 lines (77 loc) · 2.83 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
from pprint import pprint
from time import sleep
import timeit
# import dogecoinrpc
from datetime import datetime
import sys
from pgameapp.models import Actor
import django
# from django.conf import settings
# settings.configure()
django.setup()
while True:
a = Actor.objects.get(pk=2)
print a.price, a.output
sleep(1)
sys.exit()
# rpc_user and rpc_password are set in the bitcoin.conf file
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import logging
logging.basicConfig()
logging.getLogger("BitcoinRPC").setLevel(logging.DEBUG)
rpc_connection = AuthServiceProxy("http://%s:%[email protected]:44555" % ('dogecoinrpc', 'CRP3FXKN847tXbVNiQ3nAh2A6tjRSJMFzqLUic3EnnGs'))
print rpc_connection.listreceivedbyaccount()
for t in rpc_connection.listtransactions():
pprint(t)
# print [t['category'] for t in ts]
sys.exit()
a = [
'D7NS6tGNifYLprFay4BZzwgAVbdKZ9VY38',
'DGRE7ojuB1VcmF1iVJKy2UkVUk3efd2Dge',
'DUJRzaSofMtnUFcExZW5ZYCDfaFbcsrT4r',
'D9DWEdAN4rZhrQ1n6b7eyX1C92EGbsNuiY',
'DFoESHDGULq6nyuT3i7zzGKNF3uAECw1vB',
'D9ckkRQGvRgNbmmDaR3dE4xArhF4Wj6R3o',
'DJQydF58ZMrvrQGjLbpNh4VNJBNrN58KaC',
'DK6QeNmT87qXXdqkP5AG4ZXwsiCw1PJzDt',
'DTrs5KX2SG5NDGuhJDXus5DC3mV6yzRu6w',
'D74vyQxi5wZZ71yKeooAbBTYASEDjjcick',
]
conn = dogecoinrpc.connect_to_local('d:\\doge\\rpc.conf')
# print "Your balance is %f" % (conn.getbalance(),)
# print conn.validateaddress('DTZJ9v9rCpWaDUtzpfREMLRcLfJHxZQnvT')
# print conn.getconnectioncount()
# start = datetime.now()
# for i in xrange(11524, 12000):
# name = 'account_{:05d}'.format(i)
# pay_to = conn.getnewaddress(account=name)
# print name, pay_to
# print (datetime.now() - start).total_seconds()
# conn.sendtoaddress('D74vyQxi5wZZ71yKeooAbBTYASEDjjcick', 15, 'comment', 'comment_to')
# print 'received', conn.getreceivedbyaddress('D74vyQxi5wZZ71yKeooAbBTYASEDjjcick')
# print conn.getreceivedbyaccount('default')
# #print 'received', conn.getreceivedbyaccount('rrr')
#
# conn.move('rrr', 'default', 25, comment='test move')
# print conn.getreceivedbyaccount('rrr')
# print conn.getaccountaddress('default')
# print conn.getaccountaddress('rrr')
# print conn.getaccount('D74vyQxi5wZZ71yKeooAbBTYASEDjjcick')
# pprint( conn.listreceivedbyaddress(includeempty=True))
from django.utils.crypto import get_random_string
print timeit.repeat(
stmt='get_random_string()',
setup='from django.utils.crypto import get_random_string',
number=10000,
repeat=3
)
sys.exit()
pprint(conn.listaccounts(as_dict=True))
print conn.getbalance()
pprint(conn.validateaddress('DRiKDaC7wxmBqAqRjS3ebkDpWyj8CjBYRN'))
# start = datetime.now()
# for i in xrange(1, 12000):
# account = 'account_{:05d}'.format(i)
# balance = conn.getbalance(account=account)
# print account, conn.getaccountaddress(account), balance
# print (datetime.now() - start).total_seconds()