Package org.exoplatform.wallet.service
Interface BlockchainTransactionService
-
public interface BlockchainTransactionService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckPendingTransactions()checks transactions marked as pending in DB and verify their status on blockchain.voidcheckPendingTransactionValidity(TransactionDetail transactionDetail)Checks that a transaction marked as pending in internal database is valid and available on blockchain.voidcheckTransactionStatusOnBlockchain(String transactionHash, boolean pendingTransactionFromDatabase)Checks transaction identified by its hash on blockchain to see if it's mined.longrefreshBlockchainGasPrice()Refreshes gas price from blockchain and cache itTransactionDetailrefreshTransactionFromBlockchain(String hash)This will refresh transaction from blockchain if the transaction is marked as pending or marked as errorvoidscanNewerBlocks()Scans newly mined blocks in Blockchain to verify if there are transactions on configured token or wallet.voidsendRawTransactions()Sends raw transactions to blockchain
-
-
-
Method Detail
-
scanNewerBlocks
void scanNewerBlocks() throws IOExceptionScans newly mined blocks in Blockchain to verify if there are transactions on configured token or wallet. If found, save it in DB.- Throws:
IOException
-
sendRawTransactions
void sendRawTransactions()
Sends raw transactions to blockchain
-
checkTransactionStatusOnBlockchain
void checkTransactionStatusOnBlockchain(String transactionHash, boolean pendingTransactionFromDatabase)
Checks transaction identified by its hash on blockchain to see if it's mined. If mined, the information will be retrieved from mined transaction and saved on database (by replacing existing while the transaction was pendinginformation for more data integrity)- Parameters:
transactionHash-pendingTransactionFromDatabase-
-
refreshTransactionFromBlockchain
TransactionDetail refreshTransactionFromBlockchain(String hash)
This will refresh transaction from blockchain if the transaction is marked as pending or marked as error- Parameters:
hash- hash of transaction to update- Returns:
- refreshed
TransactionDetailfrom blockchain
-
checkPendingTransactionValidity
void checkPendingTransactionValidity(TransactionDetail transactionDetail)
Checks that a transaction marked as pending in internal database is valid and available on blockchain. If not and if it has exceedeWalletTransactionService.getPendingTransactionMaxDays(), then mark it as 'failed'. I will be remade as 'Success' if ContractTransactionVerifierJob detects a Contract Log- Parameters:
transactionDetail-
-
refreshBlockchainGasPrice
long refreshBlockchainGasPrice() throws IOExceptionRefreshes gas price from blockchain and cache it- Returns:
- last gas price retrieved from blockchain
- Throws:
IOException- when an error occurs while requesting gas price from blockchain
-
checkPendingTransactions
void checkPendingTransactions()
checks transactions marked as pending in DB and verify their status on blockchain. If mined, the status gets updated on DB, else wait for next trigger time.
-
-