Package com.oceanprotocol.squid.external
Class KeeperService
- java.lang.Object
-
- com.oceanprotocol.squid.external.KeeperService
-
public class KeeperService extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private String
address
private org.web3j.crypto.Credentials
credentials
private String
credentialsFile
private static BigInteger
DEFAULT_GAS_LIMIT
private static BigInteger
DEFAULT_GAS_PRICE
private BigInteger
gasLimit
private BigInteger
gasPrice
private org.web3j.tx.gas.ContractGasProvider
gasProvider
protected static org.apache.logging.log4j.Logger
log
private String
password
private org.web3j.tx.TransactionManager
txManager
private org.web3j.protocol.admin.Admin
web3
-
Constructor Summary
Constructors Modifier Constructor Description private
KeeperService(String url, String address, String password, String credentialsFile, int txAttempts, long txSleepDuration)
private
KeeperService(org.web3j.protocol.Web3jService web3jService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAddress()
org.web3j.tx.gas.ContractGasProvider
getContractGasProvider()
static org.web3j.tx.gas.ContractGasProvider
getContractGasProviderInstance(BigInteger gasPrice, BigInteger gasLimit)
org.web3j.crypto.Credentials
getCredentials()
BigInteger
getGasLimit()
BigInteger
getGasPrice()
static KeeperService
getInstance(String url, String address, String password, String credentialsFile, int txAttempts, long txSleepDuration)
Initializes the KeeperService object given a Keeper url, user and passwordstatic KeeperService
getInstance(org.web3j.protocol.Web3jService web3jService)
org.web3j.tx.TransactionManager
getTxManager()
org.web3j.protocol.admin.Admin
getWeb3()
Get the Web3j instanceKeeperService
setCredentials(org.web3j.crypto.Credentials credentials)
KeeperService
setGasLimit(BigInteger gasLimit)
KeeperService
setGasPrice(BigInteger gasPrice)
boolean
tokenApprove(com.oceanprotocol.keeper.contracts.OceanToken tokenContract, String spenderAddress, String price)
boolean
unlockAccount(Account account)
-
-
-
Field Detail
-
log
protected static final org.apache.logging.log4j.Logger log
-
web3
private org.web3j.protocol.admin.Admin web3
-
address
private String address
-
password
private String password
-
credentials
private org.web3j.crypto.Credentials credentials
-
credentialsFile
private String credentialsFile
-
txManager
private org.web3j.tx.TransactionManager txManager
-
gasProvider
private org.web3j.tx.gas.ContractGasProvider gasProvider
-
gasPrice
private BigInteger gasPrice
-
gasLimit
private BigInteger gasLimit
-
DEFAULT_GAS_PRICE
private static final BigInteger DEFAULT_GAS_PRICE
-
DEFAULT_GAS_LIMIT
private static final BigInteger DEFAULT_GAS_LIMIT
-
-
Constructor Detail
-
KeeperService
private KeeperService(org.web3j.protocol.Web3jService web3jService)
-
KeeperService
private KeeperService(String url, String address, String password, String credentialsFile, int txAttempts, long txSleepDuration) throws IOException, org.web3j.crypto.CipherException
- Throws:
IOException
org.web3j.crypto.CipherException
-
-
Method Detail
-
getInstance
public static KeeperService getInstance(String url, String address, String password, String credentialsFile, int txAttempts, long txSleepDuration) throws IOException, org.web3j.crypto.CipherException
Initializes the KeeperService object given a Keeper url, user and password- Parameters:
url
- Parity Keeper url (ie. http://localhost:8545)address
- User ethereum addresspassword
- User passwordcredentialsFile
- Path to the file with the local credentials- Returns:
- KeeperService
- Throws:
IOException
- IOExceptionorg.web3j.crypto.CipherException
- CipherException
-
getInstance
public static KeeperService getInstance(org.web3j.protocol.Web3jService web3jService)
-
getWeb3
public org.web3j.protocol.admin.Admin getWeb3()
Get the Web3j instance- Returns:
- web3j
-
setCredentials
public KeeperService setCredentials(org.web3j.crypto.Credentials credentials)
-
getCredentials
public org.web3j.crypto.Credentials getCredentials() throws IOException, org.web3j.crypto.CipherException
- Throws:
IOException
org.web3j.crypto.CipherException
-
getContractGasProviderInstance
public static org.web3j.tx.gas.ContractGasProvider getContractGasProviderInstance(BigInteger gasPrice, BigInteger gasLimit)
-
getTxManager
public org.web3j.tx.TransactionManager getTxManager()
-
getContractGasProvider
public org.web3j.tx.gas.ContractGasProvider getContractGasProvider()
-
getGasPrice
public BigInteger getGasPrice()
-
getGasLimit
public BigInteger getGasLimit()
-
setGasPrice
public KeeperService setGasPrice(BigInteger gasPrice)
-
setGasLimit
public KeeperService setGasLimit(BigInteger gasLimit)
-
getAddress
public String getAddress()
-
tokenApprove
public boolean tokenApprove(com.oceanprotocol.keeper.contracts.OceanToken tokenContract, String spenderAddress, String price) throws TokenApproveException
- Throws:
TokenApproveException
-
-