Skip to content

Instantly share code, notes, and snippets.

public class Host {
public static void main(String[] args) throws EnclaveLoadException, IOException {
// Check whether the platform supports hardware enclaves.
try {
EnclaveHost.checkPlatformSupportsEnclaves(true);
System.out.println("This platform supports enclaves in simulation, debug and release mode.");
} catch (Exception e) {
System.out.println("Platform Support Check Failed" + e.getMessage());
@InitiatingFlow
@StartableByRPC
public class TransferLandTitleFlow implements Flow<SignedTransactionDigest> {
// Constructor
@CordaInject
private PersistenceService persistenceService;
// Inject other services
@InitiatingFlow
@StartableByRPC
public class IssueLandTitleFlow implements Flow<SignedTransactionDigest>{
@JsonConstructor
public IssueLandTitleFlow(RpcStartFlowRequestParameters params) {
this.params = params;
}
@CordaInject
@InitiatingFlow
@StartableByRPC
public class IssueLandTitleFlow implements Flow<SignedTransactionDigest>{
// Inject Services Here
@Override
@Suspendable
public SignedTransactionDigest call() {
// Flow code logic here
@InitiatedBy(IssueLandTitleFlow.class)
public class IssueLandTitleFlowResponder implements Flow<SignedTransaction> {
@CordaInject
private FlowEngine flowEngine;
private FlowSession counterpartySession;
public IssueLandTitleFlowResponder(FlowSession counterpartySession) {
this.counterpartySession = counterpartySession;
@InitiatingFlow
@StartableByRPC
public class IssueLandTitleFlow implements Flow<Void>{
// FlowIdentity, IdentityService and NotaryLookupService Injected Here
@CordaInject
private TransactionBuilderFactory transactionBuilderFactory;
@CordaInject
@InitiatingFlow
@StartableByRPC
public class IssueLandTitleFlow implements Flow<Void>{
@CordaInject
private NotaryLookupService notaryLookupService;
@CordaInject
private FlowIdentity flowIdentity;
@InitiatingFlow
@StartableByRPC
public class IssueLandTitleFlow implements Flow<Void>{
@Override
@Suspendable
public Void call() {
}
}
public class LandTitleContract implements Contract {
// This is used to identify our contract when building a transaction.
public static final String ID = "net.corda.c5.sample.landregistry.LandContract";
// A transaction is valid if the verify() function of the contract of all the transaction's input and output states
// does not throw an exception.
@Override
public void verify(@NotNull LedgerTransaction tx) {
// Implement your contract validation logic here.
}
@BelongsToContract(LandTitleContract.class)
public class LandTitleState implements ContractState, JsonRepresentable {
/* This is the unique identifier of the property */
private String plotNumber;
private String dimensions;
private String area;
private Party owner;
private Party issuer;