Beispiel #1
0
 def setUp(self):
     dao_a = CBDAO()
     self.dao = dao_a.get_DAO()
Beispiel #2
0
# KNOWN BUG: must load the mysql module before all other libraries
# so they don't load an incompatible version of openssl which causes
# random segfaults with mysql procedures
# mysql module is not used here but must be loaded first on some systems
from mysql import connector

from cryptobi.toolbox.system.CBConfig import CBConfig
import cryptobi.model.graph.CBAGNode
from cryptobi.db.dao.CBDAO import CBDAO
import sys

config = CBConfig.get_config()

dao_a = CBDAO()
dao = dao_a.get_DAO()

addr = config.get_conf("listargs")

# find all infonode texts
infonodes = dao.list_info_node_by_address(addr)

for ifn in infonodes:
    print(ifn)

# find all TX's from this address
graph = dao.list_address_graph(addr)

for ifn in graph:
    print(ifn)
Beispiel #3
0
# KNOWN BUG: must load the mysql module before all other libraries
# so they don't load an incompatible version of openssl which causes
# random segfaults with mysql procedures
# mysql module is not used here but must be loaded first on some systems
from mysql import connector

from cryptobi.toolbox.system.CBConfig import CBConfig
from cryptobi.model.blockchains.CBBlock import CBBlock
from cryptobi.model.blockchains.CBAddress import CBAddress
from cryptobi.model.blockchains.CBTx import CBTxOutAddress
from cryptobi.model.graph.CBAGNode import CBAGNode
from cryptobi.crypto.CBUtil import CBUtil
from cryptobi.db.dao.CBDAO import CBDAO

config = CBConfig.get_config()
dao = CBDAO.get_DAO()
current_block = CBBlock.genesis()
height = 0


def map_input_addresses(inputs):
    """
    Map inputs to origin TX outputs.
    """
    ret = []
    for input in inputs:
        if CBUtil.safe_hash(input.txid) == bytes.fromhex("00" * 32):
            ix = CBTxOutAddress(input.table_seq, input.n_vout,
                                CBUtil.safe_hash(input.txid),
                                CBAddress.COINBASE_ADDRESS, -1, -1)
            ret.append(ix)
Beispiel #4
0
 def setUp(self):
     self.dao = CBDAO.get_DAO()