Gokulnath
Gokulnath

Reputation: 44

Corda self ISSUE flow without notarization

We came to know about the Issue flow of doing transaction in a single node even without notarization. The doc link referring above fact is given below. flows-used-in-the-measurements

Help me to know the implementation of the Issue flow in Corda 4.1 version.

Upvotes: 0

Views: 190

Answers (1)

Ashutosh Meher
Ashutosh Meher

Reputation: 1821

Just use an empty list of flow session in the Finality Flow.

Note that you do not need notarization for issuance since there is nothing to double spend. However, the notary should still be passed in the transaction to identify the correct notary for all future transaction on the state.

Here is how your call method should look like:

public SignedTransaction call() throws FlowException {
    Party notary = ..// fetch the notary from serviceHub

    // Create an instance of your output state
    OutputState os = ...

    // Create Transaction Builder and call verify
    TransactionBuilder transactionBuilder = ...
    transactionBuilder.verify(getServiceHub());

    //Sign the trnx.
    final SignedTransaction selfSignedTx = getServiceHub().signInitialTransaction(transactionBuilder);

    //Just pass an empty list of flow session in the finality flow.
    return subFlow(new FinalityFlow(selfSignedTx, new HashSet<FlowSession>(0)));

}

Upvotes: 2

Related Questions