You are on page 1of 8

3171618 190110116044

PRACTICAL-8

TITLE : Study about Corda Network


THEORY:
Corda Blockchain:

• Corda is an open-source blockchain project, designed for business from the start.
It was developed by R3, an enterprise blockchain software firm, in collaboration
with over 200 technology and industry partners.
• The Corda platform was launched in September of 2017 at CordaCon, R3’s
flagship conference. Since then, it has continuously been updated. Corda 4.6 has
been released recently.
• Since its inception, R3 has escalated from a startup to a consortium that unites
more than 200 top international financial institutions and banks. Corda is
considered the second-largest enterprise-focused blockchain after the
Hyperledger Fabric project.
• Corda is not considered a full blockchain but a DLT that combines the features of
blockchain with DLTs. DLT can be referred to as a decentralized database
whereas, in blockchain, data is stored in blocks that are linked together by a
cryptographic mechanism called “Hash”. Furthermore, Corda does not have its
own cryptocurrency, and can only share data with the required participants, and
offers interoperable applications for finance and commerce (called CorDapps).
• This means that Corda is a global ledger used by businesses to keep a shared
ledger of transactions. Privacy and assured identity are the end-state principles of
Corda.
Corda Network:

• According to R3, one of Corda’s defining features is the Corda Network that
provides consensus across business networks. It is an underlying network that
provides a common layer of identity and consensus across business networks.

GCET
3171618 190110116044

• Corda Network is a publicly-available internet of Corda nodes operated by


network participants and governed by a non-profit Corda Network Foundation
based in Holland. It allows all participants to exchange data or assets via a
secure, efficient internet layer. One of the key services of Corda Network is the
Identity Manager that controls admissions of participants into the Corda
Network.
• The Identity Manager receives certificate signing requests (CSRs) from
prospective network participants and awards participation certificate if the
participant meets the requirements specified by the foundation.
Corda Setup:

Fig3.1 Git Clone Corda files

Fig3.2 Setup IDE and Gradle build

GCET
3171618 190110116044

Fig3.3 Import test successful

GCET
3171618 190110116044

Fig3.4 Testing token states


Code:

Smart contract package bootcamp; import

net.corda.core.contracts.CommandData; import

net.corda.core.contracts.CommandWithParties; import

net.corda.core.contracts.Contract; import

net.corda.core.contracts.ContractState; import

net.corda.core.transactions.LedgerTransaction; import static

net.corda.core.contracts.ContractsDSL.requireSingleCommand; import

static net.corda.core.contracts.ContractsDSL.requireThat; import java.util.List;

/* Our contract, governing how our state will evolve over time. *

See src/main/java/examples/ArtContract.java for an example. */

public class TokenContract implements Contract {

GCET
3171618 190110116044

public static String ID = "bootcamp.TokenContract"; public void

verify(LedgerTransaction tx) throws IllegalArgumentException {

List<ContractState> inputs = tx.getInputStates();

List<ContractState> outputs = tx.getOutputStates();

List<CommandWithParties<CommandData>> commands = tx.getCommands();

if(commands.size() !=1) throw new IllegalArgumentException("tx should only have one


command");

if (!(commands.get(0).getValue() instanceof TokenContract.Commands.Issue)) throw new


IllegalArgumentException("Must be an issue command");

CommandData theCommand = commands.get(0).getValue();

// shape of the transaction if(inputs.size() != 0) throw new

IllegalArgumentException("must have zero inputs"); if(outputs.size() != 1) throw new

IllegalArgumentException("must have one output"); if(!(outputs.get(0) instanceof

TokenState)) throw new IllegalArgumentException("output must be of type

TokenState");

TokenState tokenState = (TokenState) outputs.get(0);

// content of the state

if (!(tokenState.getAmount() > 0)) throw new IllegalArgumentException("Token amount


must me greater than 0");

// required signers if (!

(commands.get(0).getSigners().contains(tokenState.getIssuer().getOwningKey())))

throw new IllegalArgumentException("Issuer must be required signer");

public interface Commands extends CommandData { class Issue implements Commands {


}

GCET
3171618 190110116044

Fig3.5 Deploy nodes

Fig3.6 Deploy nodes build success

GCET
3171618 190110116044

Fig3.7 RPC calls on localhost

Fig3.8 Flow list

GCET
3171618 190110116044

Conclusion:

• From this practical, I learned about Corda blockchain and how to setup environment.

References:

• https://youtu.be/tm06GCD0XJI

GCET

You might also like