public class ChainConfigInstance extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ContractId |
| Modifier and Type | Method and Description |
|---|---|
void |
evolveChainConfig(ChainConfigData newConfig,
List<Signer> owners)
Sends the instruction to change the Chain Config and returns immediately.
|
Instruction |
evolveChainConfigInstruction(ChainConfigData newConfig,
List<Signer> owners,
int pos,
int len)
Creates an instruction to evolve the value in byzcoin.
|
void |
evolveConfigAndWait(ChainConfigData newConfig,
List<Signer> owners,
int wait)
Send the instruction to change the Chain Config and wait for it to be included.
|
static ChainConfigInstance |
fromByzcoin(ByzCoinRPC bc)
Instantiates a new ChainConfigInstance given a working byzcoin service.
|
static ChainConfigInstance |
fromByzcoin(ByzCoinRPC bc,
Proof p)
Convenience function to connect to an existing ValueInstance.
|
ChainConfigData |
getChainConfig() |
InstanceId |
getId() |
Instance |
getInstance() |
void |
update()
Updates the value by getting the latest instance and updating it.
|
public static String ContractId
public void update()
throws CothorityCommunicationException,
CothorityNotFoundException
CothorityNotFoundException - if the chainConfiguration couldn't be found in ByzCoinCothorityCommunicationException - if there was an communication errorpublic Instruction evolveChainConfigInstruction(ChainConfigData newConfig, List<Signer> owners, int pos, int len) throws CothorityCryptoException
newConfig - the new config to store in the ChainConfigowners - must have its identity in the "invoke:update" rulepos - position of the instruction in the ClientTransactionlen - total number of instructions in the ClientTransactionCothorityCryptoException - if there's a problem with the cryptographypublic void evolveChainConfig(ChainConfigData newConfig, List<Signer> owners) throws CothorityException
newConfig - the new config to storeowners - a list of owners needed to evolve the configurationCothorityException - if something goes wrongpublic void evolveConfigAndWait(ChainConfigData newConfig, List<Signer> owners, int wait) throws CothorityException
newConfig - the new config to stureowners - a list of owners needed to evolve the configurationwait - how many blocks to wait for inclusion of the instructionCothorityException - if something goes wrongpublic InstanceId getId()
public ChainConfigData getChainConfig()
public Instance getInstance()
public static ChainConfigInstance fromByzcoin(ByzCoinRPC bc) throws CothorityNotFoundException, CothorityCommunicationException
bc - is a running ByzCoin serviceCothorityNotFoundException - if the configuration is not where it is supposed to beCothorityCommunicationException - if the communication throws an errorpublic static ChainConfigInstance fromByzcoin(ByzCoinRPC bc, Proof p) throws CothorityNotFoundException, CothorityCommunicationException
bc - a running ByzCoin servicep - the proof for the valueInstanceCothorityNotFoundException - if the configuration is not where it is supposed to beCothorityCommunicationException - if the communication throws an errorCopyright © 2018. All rights reserved.