public class NamingInstance extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ContractId |
| Constructor and Description |
|---|
NamingInstance(ByzCoinRPC bc,
DarcId darcID,
List<Signer> signers,
List<Long> signerCtrs)
Create a naming instance.
|
| Modifier and Type | Method and Description |
|---|---|
static NamingInstance |
fromByzcoin(ByzCoinRPC bc)
Loads the singleton naming instance from ByzCoin.
|
void |
remove(String instanceName,
InstanceId iID,
List<Signer> signers,
List<Long> signerCtrs)
This method asynchronously removes an instance name.
|
void |
removeAndWait(String instanceName,
InstanceId iID,
List<Signer> signers,
List<Long> signerCtrs,
int wait)
This method removes an instance name and then waits for confirmation.
|
InstanceId |
resolve(DarcId dID,
String name)
Resolves a previously named instance ID from a darc ID and a name.
|
void |
set(String instanceName,
InstanceId iID,
List<Signer> signers,
List<Long> signerCtrs)
Asynchronously assigns a name to an instance ID.
|
void |
setAndWait(String instanceName,
InstanceId iID,
List<Signer> signers,
List<Long> signerCtrs,
int wait)
Assigns a name to an instance ID and wait for confirmation.
|
public static String ContractId
public NamingInstance(ByzCoinRPC bc, DarcId darcID, List<Signer> signers, List<Long> signerCtrs) throws CothorityException
bc - is a running byzcoin servicedarcID - is the darc that contains the "spawn:naming" rule, usually it is the genesis darcsigners - is a list of signers that holds the keys to the "_name" rule in the Darc the guards iIDsignerCtrs - is the list of monotonically increasing counters that will go into the instruction,
they must match the signers who will eventually sign the instructionCothorityException - if the instance cannot be createdpublic static NamingInstance fromByzcoin(ByzCoinRPC bc) throws CothorityNotFoundException, CothorityCommunicationException, CothorityCryptoException
bc - is a running ByzCoin serviceCothorityNotFoundException - if the instance cannot be found on ByzCoin, perhaps an old version that
does not support naming is usedCothorityCommunicationException - if there is a communication errorCothorityCryptoException - if result that we got back form ByzCoin contains a wrong proofpublic void set(String instanceName, InstanceId iID, List<Signer> signers, List<Long> signerCtrs) throws CothorityException
instanceName - is the name given to the instance IDiID - is the to-be-named instance IDsigners - is a list of signers that holds the keys to the "_name" rule in the Darc the guards iIDsignerCtrs - is the list of monotonically increasing counters that will go into the instruction,
they must match the signers who will eventually sign the instructionCothorityException - if any error occurspublic void setAndWait(String instanceName, InstanceId iID, List<Signer> signers, List<Long> signerCtrs, int wait) throws CothorityException
instanceName - is the name given to the instance IDiID - is the to-be-named instance IDsigners - is a list of signers that holds the keys to the "_name" rule in the Darc the guards iIDsignerCtrs - is the list of monotonically increasing counters that will go into the instruction,
they must match the signers who will eventually sign the instructionwait - how many blocks to wait for inclusion of the transactionCothorityException - if any error occurspublic void remove(String instanceName, InstanceId iID, List<Signer> signers, List<Long> signerCtrs) throws CothorityException
instanceName - is the name of the instance to removeiID - is instance ID which must have been named previously to instanceNamesigners - is a list of signers that holds the keys to the "_name" rule in the Darc the guards iIDsignerCtrs - is the list of monotonically increasing counters that will go into the instruction,
they must match the signers who will eventually sign the instructionCothorityExceptionpublic void removeAndWait(String instanceName, InstanceId iID, List<Signer> signers, List<Long> signerCtrs, int wait) throws CothorityException
instanceName - is the name of the instance to removeiID - is instance ID which must have been named previously to instanceNamesigners - is a list of signers that holds the keys to the "_name" rule in the Darc the guards iIDsignerCtrs - is the list of monotonically increasing counters that will go into the instruction,
they must match the signers who will eventually sign the instructionwait - how many blocks to wait for inclusion of the transactionCothorityExceptionpublic InstanceId resolve(DarcId dID, String name) throws CothorityCommunicationException
dID - is the darc ID that guards the instance.name - is the name given to the instance when it was named.CothorityCommunicationException - if the name does not exist or other failures.Copyright © 2019. All rights reserved.