public class OmniledgerRPC extends Object
OmniledgerRPC is the new skipchain service of the cothority that allows batching of transactions and simplified proofs. It is a permissioned blockchain with high throughput (100-1000 transactions) and a byzantine-tolerant consensus algorithm.
| Modifier and Type | Field and Description |
|---|---|
static int |
currentVersion |
| Constructor and Description |
|---|
OmniledgerRPC(byte[] buf)
Instantiates an omniledger object given the byte representation.
|
OmniledgerRPC(Roster r,
Darc d,
java.time.Duration blockInterval)
This instantiates a new omniledger object by asking the cothority to set up a new omniledger.
|
OmniledgerRPC(Roster roster,
SkipblockId skipchainId)
Constructs an OmniLedgerRPC from known configuration.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkLiveness()
Verifies if the nodes representing the cothority are alive and reply to a ping.
|
Config |
getConfig() |
SkipBlock |
getGenesis() |
Darc |
getGenesisDarc() |
SkipBlock |
getLatest() |
Proof |
getProof(InstanceId id)
Gets a proof from omniledger to show that a given instance is in the
global state.
|
Roster |
getRoster() |
void |
sendTransaction(ClientTransaction t)
Sends a transaction to omniledger, but doesn't wait for the inclusion of this transaction in a block.
|
void |
sendTransactionAndWait(ClientTransaction t,
int wait)
Sends a transaction to omniledger and waits for up to 'wait' blocks for the transaction to be
included in the global state.
|
byte[] |
toBytes() |
void |
update()
Fetches the latest configuration and genesis darc from omniledger.
|
public static final int currentVersion
public OmniledgerRPC(Roster r, Darc d, java.time.Duration blockInterval) throws CothorityException
r - is the roster to be usedd - is the genesis darcblockInterval - is the block interval between two blocksCothorityExceptionpublic OmniledgerRPC(Roster roster, SkipblockId skipchainId) throws CothorityException
roster - the roster to talk toskipchainId - the ID of the genesis skipblock, aka skipchain IDCothorityExceptionpublic OmniledgerRPC(byte[] buf)
buf - is the representation of the basic omniledger parameters, it should have a Roster and a skipchain ID.public void sendTransaction(ClientTransaction t) throws CothorityException
t - is the client transaction holding one or more instructions to be sent to omniledger.CothorityExceptionpublic void sendTransactionAndWait(ClientTransaction t, int wait) throws CothorityException
t - is the client transaction holding one or more instructions to be sent to omniledger.wait - indicates the number of blocks to wait for the transaction to be included.CothorityException - if the transaction has not been included within 'wait' blocks.public Proof getProof(InstanceId id) throws CothorityException
id - is the id of the instance to be fetchedCothorityExceptionpublic void update()
throws CothorityException
CothorityExceptionpublic boolean checkLiveness()
throws CothorityException
CothorityException - if something failed.public byte[] toBytes()
public Config getConfig()
public Darc getGenesisDarc()
public SkipBlock getLatest()
public SkipBlock getGenesis()
public Roster getRoster()
Copyright © 2018. All rights reserved.