Package i5.las2peer.registry
Class ReadOnlyRegistryClient
java.lang.Object
i5.las2peer.registry.ReadOnlyRegistryClient
- Direct Known Subclasses:
ReadWriteRegistryClient
Facade providing simple read-only access to the registry smart contracts.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyRegistryClient(RegistryConfiguration registryConfiguration) Create client providing access to read-only registry functions. -
Method Summary
Modifier and TypeMethodDescriptionetherToWei(BigDecimal ether) Converts the provided Ether amount to Wei (smallest value Unit) .getAccountBalance(String ethereumAddress) org.web3j.protocol.core.methods.response.EthCoinbaseQueries the coin base = the first account in the chain By design, this is the account which the hosting node uses for mining in the background https://github.com/matthiaszimmermann/web3j_demo / Web3jUtilsgetDeployments(String serviceName) getDeployments(String serviceName, String version) Deprecated.there's no reason to reveal this implementation detail, so this may be removedRetrieve group data stored in registry for given group name.Return the nonce (tx count) for the specified address.getNoOfServiceAnnouncementSinceBlockOrderedByHostingNode(BigInteger largerThanBlockNo, String searchingForService) Query no.getProfile(String address) getServiceAuthor(String service) getTags()org.web3j.protocol.core.methods.response.EthTransactiongetTransactionByTxHash(String txHash) getTransactionInfo(String txHash) getTransactionLogByReceiver(String receiver) getTransactionLogBySender(String sender) Retrieve user data stored in registry for given name.floatgetUserRating(String ethAddress) booleangroupNameIsAvailable(String name) Return true if user name is both valid and not already taken and thus can be registered.booleangroupNameIsValid(String name) Return true if user name is both valid, as encoded in the registry smart contract code.lookupServiceAuthor(String serviceName) Look up author/owner for a given service.booleanunlockAccount(String accountAddress, String accountPassword) protected voidupdateTxManNonce(String address) Overrides nonce of transactionManager with local nonce.booleanusernameIsAvailable(String name) Return true if user name is both valid and not already taken and thus can be registered.booleanusernameIsValid(String name) Return true if user name is both valid, as encoded in the registry smart contract code.protected org.web3j.protocol.core.methods.response.TransactionReceiptwaitForReceipt(String transactionHash) Waits for the receipt for the transaction specified by the provided tx hash.protected voidwaitForTransactionReceipt(String txHash) weiToEther(BigInteger wei) Converts the provided Wei amount (smallest value Unit) to Ethers.
-
Field Details
-
logger
-
-
Constructor Details
-
ReadOnlyRegistryClient
Create client providing access to read-only registry functions.- Parameters:
registryConfiguration- addresses of registry contracts and Ethereum client HTTP JSON RPC API endpoint
-
-
Method Details
-
getGasPrice
-
getGasLimit
-
unlockAccount
-
getEthClientVersion
Deprecated.there's no reason to reveal this implementation detail, so this may be removedReturn version string of connected Ethereum client.- Throws:
EthereumException
-
usernameIsAvailable
Return true if user name is both valid and not already taken and thus can be registered.- Parameters:
name- user name consisting of 1 to 32 Unicode characters- Throws:
EthereumException
-
groupNameIsAvailable
Return true if user name is both valid and not already taken and thus can be registered.- Parameters:
name- user name consisting of 1 to 32 Unicode characters- Throws:
EthereumException
-
usernameIsValid
Return true if user name is both valid, as encoded in the registry smart contract code. (Any non-empty String of up to 32 characters should work, but let's not press our luck.)- Parameters:
name- user name consisting of 1 to 32 Unicode characters- Throws:
EthereumException
-
groupNameIsValid
Return true if user name is both valid, as encoded in the registry smart contract code. (Any non-empty String of up to 32 characters should work, but let's not press our luck.)- Parameters:
name- user name consisting of 1 to 32 Unicode characters- Throws:
EthereumException
-
getUser
Retrieve user data stored in registry for given name.- Parameters:
name- user name consisting of 1 to 32 Unicode characters- Returns:
- user data object containing ID and owner address, or
nullif user name is not taken - Throws:
EthereumExceptionNotFoundException
-
getGroup
Retrieve group data stored in registry for given group name.- Parameters:
name- group name consisting of 1 to 32 Unicode characters- Returns:
- group data object containing ID and owner address, or
nullif group name is not taken - Throws:
EthereumExceptionNotFoundException
-
getProfile
- Throws:
EthereumExceptionNotFoundException
-
getUserRating
-
lookupServiceAuthor
Look up author/owner for a given service.- Parameters:
serviceName- service package name- Returns:
- author owning the service name
- Throws:
EthereumExceptionNotFoundException
-
getTags
- Returns:
- map of tags to descriptions
-
getServiceNames
- Returns:
- set of registered service (package) names
-
getServiceAuthors
- Returns:
- map of service names to their authors
-
getServiceAuthor
-
getUserProfiles
- Returns:
- map of profile owners to their usernames
-
getUserRegistrations
- Returns:
- map of users to their registration time stamps
-
getServiceReleases
- Returns:
- map of names to service release objects
-
getDeployments
- Returns:
- set of all active service deployments
-
getDeployments
-
getDeployments
-
getAccountBalance
- Throws:
EthereumException
-
getTransactionLog
-
getNoOfServiceAnnouncementSinceBlockOrderedByHostingNode
public HashMap<String,Integer> getNoOfServiceAnnouncementSinceBlockOrderedByHostingNode(BigInteger largerThanBlockNo, String searchingForService) Query no. of service announcements which occurred since provide block- Parameters:
largerThanBlockNo- block number to start querying atsearchingForService- service which is to be found
-
getTransactionInfo
- Throws:
EthereumException
-
getTransactionByTxHash
public org.web3j.protocol.core.methods.response.EthTransaction getTransactionByTxHash(String txHash) throws EthereumException - Throws:
EthereumException
-
getTransactionLogBySender
-
getTransactionLogByReceiver
-
getNonce
Return the nonce (tx count) for the specified address. https://github.com/matthiaszimmermann/web3j_demo / Web3jUtils- Parameters:
address- target address- Returns:
- nonce
-
updateTxManNonce
Overrides nonce of transactionManager with local nonce.- Parameters:
address-
-
getCoinbase
public org.web3j.protocol.core.methods.response.EthCoinbase getCoinbase() throws InterruptedException, ExecutionExceptionQueries the coin base = the first account in the chain By design, this is the account which the hosting node uses for mining in the background https://github.com/matthiaszimmermann/web3j_demo / Web3jUtils- Returns:
- coinbase address
- Throws:
InterruptedExceptionExecutionException
-
waitForReceipt
protected org.web3j.protocol.core.methods.response.TransactionReceipt waitForReceipt(String transactionHash) throws InterruptedException, ExecutionException Waits for the receipt for the transaction specified by the provided tx hash. Makes 30 attempts (waiting 1 sec. between attempts) to get the receipt object. In the happy case the tx receipt object is returned. Otherwise, a runtime exception is thrown. https://github.com/matthiaszimmermann/web3j_demo / Web3jUtils- Parameters:
transactionHash-- Returns:
- Throws:
InterruptedExceptionExecutionException
-
waitForTransactionReceipt
- Throws:
EthereumException
-
weiToEther
Converts the provided Wei amount (smallest value Unit) to Ethers. https://github.com/matthiaszimmermann/web3j_demo / Web3jUtils- Parameters:
wei-- Returns:
-
etherToWei
Converts the provided Ether amount to Wei (smallest value Unit) . https://github.com/matthiaszimmermann/web3j_demo / Web3jUtils- Parameters:
ether-- Returns:
-