File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ from tronapi .tron import Tron
2+ import logging
3+
4+
5+ logging .basicConfig (level = logging .DEBUG , format = "%(asctime)s - %(levelname)s - %(message)s" )
6+ logger = logging .getLogger ()
7+
8+ full_node = 'https://api.trongrid.io'
9+ solidity_node = 'https://api.trongrid.io'
10+ event_server = 'https://api.trongrid.io/'
11+ private_key = 'da146374a75310b9666e834ee4ad0866d6f4035967bfc76217c5a495fff9f0d0'
12+
13+ tron = Tron (full_node ,
14+ solidity_node ,
15+ event_server )
16+
17+
18+ account = tron .create_account ()
19+ is_valid = bool (tron .is_address (account .address .hex ))
20+
21+
22+ logger .debug ('Generated account: ' )
23+ logger .debug ('- Private Key: ' + account .private_key ())
24+ logger .debug ('- Public Key: ' + account .public_key ())
25+ logger .debug ('- Address: ' )
26+ logger .debug ('-- Base58: ' + account .address .base58 )
27+ logger .debug ('-- Hex: ' + account .address .hex )
28+ logger .debug ('-- isValid: ' + str (is_valid ))
29+ logger .debug ('-----------' )
You can’t perform that action at this time.
0 commit comments