Git Product home page Git Product logo

accounts_java_samples's Introduction

Corda

Exercises below are to demonstrate the functionality of the Corda Accounts package

Pre-Requisites

See https://docs.corda.net/getting-set-up.html.

Materials

All slide decks and Corda Design Language (CDL) diagrams can be found in the resources folder

Usage

Running the nodes

See https://docs.corda.net/tutorial-cordapp.html#running-the-example-cordapp.

Interacting with the nodes

Shell Commands for Transacting between Accounts

Accounts functionality is implemented at the Node level through an Accounts CorDapp.

####Creating accounts on a node We can create accounts by executing a flow. Goto PartyA's shell and create an account for 'Bob'

start CreateAccount name: "PartyA - Bob"

Create another account on PartyB's shell

start CreateAccount name: "PartyB - Alice"

Checking accounts on a node

We can see what accounts are on a node with the flow OurAccounts. Execute this on PartyA to see 'Bob' and on PartyB to see 'Alice'

start OurAccounts

Share an account on our node with another party

From PartyB

start ShareAccountToParty acctName: PartyB - Alice, shareTo: PartyA

Self Issue our AssetForAccountState

From PartyA

start AssetForAccountStateSelfIssueFlow acctName: PartyA - Bob, name: "diamond", value: 100

Transfer our Issued state from our Account to an Account on another Node

From PartyA

Do a vaultQuery to get the transaction hash and index of the AssetForAccountState

run vaultQuery contractStateType: AssetForAccountState

Then run the same query from PartyB - notice the vault is empty.

Go back to PartyA

Copy the transaction hash from your query and use as an argument for the transfer flow

start NodeAccountToNodeAccount senderName: PartyA - Bob, receiverName: PartyB - Alice, hash: <txhash>, index: 0

run the vaultQueries again and see that the asset has changed hands, the owner key now maps to PartyB - Alice account.

run vaultQuery contractStateType: AssetForAccountState

accounts_java_samples's People

Contributors

garryjacksonr3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.