corda / net.corda.node.services.transactions / RaftUniquenessProvider

RaftUniquenessProvider

@ThreadSafe class RaftUniquenessProvider : UniquenessProvider, SingletonSerializeAsToken

A uniqueness provider that records committed input states in a distributed collection replicated and persisted in a Raft cluster, using the Copycat framework (http://atomix.io/copycat/).

The uniqueness provider maintains both a Copycat cluster node (server) and a client through which it can submit requests to the cluster. In Copycat, a client request is first sent to the server it's connected to and then redirected to the cluster leader to be actioned.

Parameters

storagePath - Directory storing the Raft log and state machine snapshots

myAddress - Address of the Copycat node run by this Corda node

clusterAddresses - List of node addresses in the existing Copycat cluster. At least one active node must be provided to join the cluster. If empty, a new cluster will be bootstrapped.

db - The database to store the state machine state in

config - SSL configuration

Constructors

<init> RaftUniquenessProvider(storagePath: Path, myAddress: HostAndPort, clusterAddresses: List<HostAndPort>, db: Database, config: SSLConfiguration)

A uniqueness provider that records committed input states in a distributed collection replicated and persisted in a Raft cluster, using the Copycat framework (http://atomix.io/copycat/).

Functions

commit fun commit(states: List<StateRef>, txId: SecureHash, callerIdentity: Party): Unit

Commits all input states of the given transaction

Inherited Functions

toToken open fun toToken(context: SerializeAsTokenContext): SerializationToken