# Tools

# Interaction tools

# Corda standalone shell

Interact with your Corda node using Corda standalone shell.

# Prerequisites

# Running the standalone shell

You can connect to your Corda node and interact with it in shell.

To be able to interact with the CorDapps through shell, you must have the CorDapp contract and workflow JAR files both locally on your machine and on the node you are connecting to.

java -jar corda-tools-shell-cli-4.5-all.jar --host=CORDA_RPC_HOSTNAME --port=CORDA_RPC_PORT --user=CORDA_RPC_USER --password=CORDA_RPC_PASSWORD --cordapp-directory=⁨/host/path/to/cordapps

where

  • CORDA_RPC_HOSTNAME — your Corda node RPC hostname.
  • CORDA_RPC_PORT — your Corda node RPC port.
  • CORDA_RPC_USER — your Corda node RPC username.
  • CORDA_RPC_PASSWORD — your Corda node RPC password.
  • ⁨/host/path/to/cordapps — path to your local directory with the contract and workflow JAR files that you uploaded to your Corda node. You only need to specify the --cordapp-directory parameter if you intend to interact with the CorDapps on the node.

See also View node access and credentials.

Example:

$ java -jar corda-tools-shell-cli-4.5-all.jar --host=nd-123-456-789.rg-123-456.p2pify.com --port=10201 --user=admin --password=pass --cordapp-directory=⁨/home/user/cordapps

   ______               __
  / ____/     _________/ /___ _
 / /     __  / ___/ __  / __ `/
/ /___  /_/ / /  / /_/ / /_/ /
\____/     /_/   \__,_/\__,_/
--- Corda Open Source 4.5 (461cf07) ---

Standalone Shell connected to nd-123-456-789.rg-123-456.p2pify.com:10201

Once connected, run help to see the list of available commands.

# Chainstack standalone shell

Interact with your Corda node using Chainstack standalone shell which is a containerized version of Corda standalone shell.

# Prerequisites

# Running the standalone shell

You can connect to your Corda node and interact with it in shell.

To be able to interact with the CorDapps through shell, you must have the CorDapp contract and workflow JAR files both locally on your machine and on the node you are connecting to.

docker run -it -v /host/path/to/cordapps:/cordapps chainstack/corda-shell --host=CORDA_RPC_HOSTNAME --port=CORDA_RPC_PORT --user=CORDA_RPC_USER --password=CORDA_RPC_PASSWORD --cordapp-directory=/cordapps

where

  • /host/path/to/cordapps — path to your local directory with the contract and workflow JAR files that you uploaded to your Corda node. You only need to specify the -v and --cordapp-directory parameters if you intend to interact with the CorDapps on the node.
  • CORDA_RPC_HOSTNAME — your Corda node RPC hostname.
  • CORDA_RPC_PORT — your Corda node RPC port.
  • CORDA_RPC_USER — your Corda node RPC username.
  • CORDA_RPC_PASSWORD — your Corda node RPC password.

See also View node access and credentials.

Example:

$ docker run -it -v /home/user/cordapps:/cordapps chainstack/corda-shell --host=nd-123-456-789.rg-123-456.p2pify.com --port=10201 --user=username --password=password --cordapp-directory=/cordapps

   ______               __
  / ____/     _________/ /___ _
 / /     __  / ___/ __  / __ `/
/ /___  /_/ / /  / /_/ / /_/ /
\____/     /_/   \__,_/\__,_/
--- Corda Open Source 4.5 (461cf07) ---

Standalone Shell connected to nd-123-456-789.rg-123-456.p2pify.com:10201

Once connected, run help to see the list of available commands.

# Using a client with the CordaRPCClient class

For your application purposes, you need to write your own client in a JVM-compatible language using the CordaRPCClient class. The CordaRPCClient class connects to your Corda node and exposes an RPC interaction interface.

For detailed instructions, see Corda documentation: Interacting with a node.

# Over HTTP

Corda does not have its own webserver, so you will need to run your own webserver that uses the CordaRPCClient class to interact with your nodes.

# Using Spring Boot webserver

Corda provides a template Spring Boot webserver implementation that you can use to interact with your nodes. See Corda Spring webserver.

To use the webserver, do the following:

  1. Clone the Corda samples repository:
git clone https://github.com/corda/samples.git
  1. Edit the spring-webserver/src/main/resources/application.properties file:
server.port=SERVER_PORT
config.rpc.username=CORDA_RPC_USER
config.rpc.password=CORDA_RPC_PASSWORD
config.rpc.host=CORDA_RPC_HOSTNAME
config.rpc.port=CORDA_RPC_PORT

where

  • SERVER_PORT — your Spring webserver port. Provide any open port that you will use to access the webserver.
  • CORDA_RPC_USER — your Corda node RPC username.
  • CORDA_RPC_PASSWORD — your Corda node RPC password.
  • CORDA_RPC_HOSTNAME — your Corda node RPC hostname.
  • CORDA_RPC_PORT — your Corda node RPC port.

See also View node access and credentials.

  1. Run the Spring webserver:
./gradlew runPartyAServer

This will engage the runPartyAServer task specified in build.gradle, start the server, and connect the server to your node.

WARNING

The task progress for the webserver start printed in the output will never reach 100% completion. You can access the webserver at around 95%.

You can access the server locally via localhost:SERVER_PORT or from a remote machine via IP_ADDRESS:SERVER_PORT.

The Corda Spring webserver implementation builds with the default RPC commands mapped to HTTP requests. See StandardController.kt.

Example:

$ curl http://localhost:10055/identities
[OU=Organization-ND-123-456-789, O=Organization, L=Singapore, C=SG]

You can also write your own REST endpoints for your CorDapps. For the examples, see Corda samples or the No ticket scalping CorDapp tutorial.

# Development tools

See Getting started developing CorDapps.

Java 8

Corda requires at least Java 8u171 and does not support Java 9 or higher.