def setDB(self, dbName, addressCollectionName, addressKeyField, reportCollectionName, reportKeyField)-> None: # addressDB connect self.addressdb = mongoDB.MongoConnector(dbName, addressCollectionName) self.addressdb.connect() self.addressdb.setKeyField(addressKeyField) # addressDB connect self.reportdb = mongoDB.MongoConnector(dbName, reportCollectionName) self.reportdb.connect() self.reportdb.setKeyField(reportKeyField)
def setDB(self) -> None: sdbNameB = 'ws_datas' scollectionNameB = '_block_m' skeyFieldB = 'block' sdbNameT = 'ws_datas' scollectionNameT = '_transaction_m' skeyFieldT = 'txid' self.bdb = mongoDB.MongoConnector(sdbNameB, scollectionNameB) self.bdb.connect() self.bdb.setKeyField(skeyFieldB) self.tdb = mongoDB.MongoConnector(sdbNameT, scollectionNameT) self.tdb.connect() self.tdb.setKeyField(skeyFieldT)
def setDB(self): dbName = 'ws_datas' collectionName = 'etherscamdb_address' keyField = 'address' self.db = mongoDB.MongoConnector(dbName, collectionName) self.db.connect() self.db.setKeyField(keyField)
def setChainDB(self, rootUserID): """ | userID 기반 chain DB 설정 | """ collectionName = 'bitcoin_analysischain_' + rootUserID self.chaindb = mongoDB.MongoConnector(self.dbName, collectionName) self.chaindb.connect() self.chaindb.setKeyField('chainID') return self.chaindb
def setDB(self, exchangeCollectionName, walletCollectionName, transactionCollectionName)-> None: dbName = 'ws_datas' walletKeyField = 'address' transactionKeyField = 'txid' self.exchangedb = mongoDB.MongoConnector(dbName, exchangeCollectionName) self.exchangedb.connect() self.exchangedb.setKeyField('url') # walletDB connect self.walletdb = mongoDB.MongoConnector(dbName, walletCollectionName) self.walletdb.connect() self.walletdb.setKeyField(walletKeyField) # walletexplorerNumdb connect #self.walletNumdb= MongoConnector(dbName, walletNumCollectionName) #self.walletNumdb.connect() #self.walletNumdb.setKeyField(walletNumKeyField) # walletTransactionDB connect self.walletTransactiondb = mongoDB.MongoConnector(dbName, transactionCollectionName) self.walletTransactiondb.connect() self.walletTransactiondb.setKeyField(transactionKeyField)
def setUserTxDB(self, userID): """ | userID 기반 트랜잭션 데이터 DB 설정 | | **코드 특징** | **여러 userID를 하나의 분석 도구로 살펴봐야 할 수 있기 때문에 | **setDBName(), setKeyField(), setCollectionPrefix()를 통일 시켜 놓고 | **userID로 DB를 생성, 접근할 수 있도록 분리해놓았음. """ collectionName = self.collectionPrefix + userID db = mongoDB.MongoConnector(self.dbName, collectionName) db.connect() db.setKeyField(self.keyField) return db