public class DarcInstance extends Object
| Constructor and Description |
|---|
DarcInstance(OmniledgerRPC ol,
Darc d) |
DarcInstance(OmniledgerRPC ol,
InstanceId id)
Instantiates a new DarcInstance given a working omniledger instance and
an instanceId.
|
| Modifier and Type | Method and Description |
|---|---|
TransactionId |
evolveDarc(Darc newDarc,
Signer owner) |
void |
evolveDarcAndWait(Darc newDarc,
Signer owner)
Asks omniledger to evolve the darc and waits until the new darc has
been stored in the global state.
|
Instruction |
evolveDarcInstruction(Darc newDarc,
Signer owner,
int pos,
int len)
Creates an instruction to evolve the darc in omniledger.
|
Darc |
getDarc() |
DarcId |
getId() |
Instance |
getInstance() |
TransactionId |
spawnContract(String contractID,
Signer s,
List<Argument> args)
Like spawnContractInstruction, but creates a ClientTransaction with only this instruction and sends it
to the omniledger.
|
Proof |
spawnContractAndWait(String contractID,
Signer s,
List<Argument> args,
int wait)
Like spawnContract but waits for the instance to be stored in omniledger.
|
Instruction |
spawnContractInstruction(String contractID,
Signer s,
List<Argument> args,
int pos,
int len)
Creates an instruction for spawning a contract.
|
void |
update() |
public DarcInstance(OmniledgerRPC ol, InstanceId id) throws CothorityException
ol - is a link to an omniledger instance that is runningid - of the darc-instance to connect toCothorityExceptionpublic DarcInstance(OmniledgerRPC ol, Darc d) throws CothorityException
CothorityExceptionpublic void update()
throws CothorityException
CothorityExceptionpublic Instruction evolveDarcInstruction(Darc newDarc, Signer owner, int pos, int len) throws CothorityCryptoException
TODO: allow for evolution if the expression has more than one identity.
newDarc - the darc to replace the old darc.owner - must have its identity in the "Invoke_Evolve" rulepos - position of the instruction in the ClientTransactionlen - total number of instructions in the ClientTransactionCothorityCryptoExceptionpublic TransactionId evolveDarc(Darc newDarc, Signer owner) throws CothorityException
CothorityExceptionpublic void evolveDarcAndWait(Darc newDarc, Signer owner) throws CothorityException
newDarc - is the new darc to replace the old oneowner - is the owner that can sign to evolve the darcCothorityExceptionpublic Instruction spawnContractInstruction(String contractID, Signer s, List<Argument> args, int pos, int len) throws CothorityCryptoException
TODO: allow for multi-signatures
contractID - the id of the contract to creates - the signer that is authorized to spawn this contractargs - arguments to give to the contractpos - position in the ClientTransactionlen - total length of the ClientTransactionCothorityCryptoExceptionpublic TransactionId spawnContract(String contractID, Signer s, List<Argument> args) throws CothorityException
contractID - the id of the contract to creates - the signer that is authorized to spawn this contractargs - arguments to give to the contractCothorityExceptionpublic Proof spawnContractAndWait(String contractID, Signer s, List<Argument> args, int wait) throws CothorityException
contractID - the id of the contract to creates - the signer that is authorized to spawn this contractargs - arguments to give to the contractCothorityExceptionpublic DarcId getId() throws CothorityCryptoException
CothorityCryptoExceptionpublic Darc getDarc() throws CothorityCryptoException
CothorityCryptoExceptionpublic Instance getInstance()
Copyright © 2018. All rights reserved.