Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://gitlab.com/cordite/cordite

Cordite is an open source project creating open source DeFi features for Corda. Cordite continues to make leading-edge features available to the Corda community.
https://gitlab.com/cordite/cordite

accounting blockchain corda dao defi distributed ledger economics finance governance ico tokens

Last synced: about 1 month ago
JSON representation

Cordite is an open source project creating open source DeFi features for Corda. Cordite continues to make leading-edge features available to the Corda community.

Awesome Lists containing this project

README

        

# ![Cordite](/uploads/37fcd730405f565bca6aa09a453ec865/logo-watermark-50.png) Cordite

## What is Cordite?

Cordite is an open source project creating open source DeFi features for Corda. Cordite continues to make leading-edge features available to the Corda community.

Cordite provides decentralised economic and governance services including:

+ decentralised stores and transfers of value allowing new financial instruments to be created inside the existing regulatory framework. eg. tokens, crypto-coins, digital cash, virtual currency, distributed fees, micro-billing
+ decentralised forms of governance allowing new digital autonomous organisations to be created using existing legal entities eg. digital mutual societies or digital joint stock companies
+ decentralised consensus in order to remove the need for a central operator, owner or authority. Allowing Cordite to be more resilient, cheaper, agile and private than incumbent market infrastructure

Cordite is open source, regulatory friendly, enterprise ready and finance grade.

Cordite is built on [Corda](http://corda.net), a finance grade distributed ledger technology, meeting the highest standards of the banking industry, yet it is applicable to any commercial scenario. The outcome of over two years of intense research and development by over 80 of the world’s largest financial institutions.

## What has Cordite ever done for me?

* [Corda Network Map Service](https://gitlab.com/cordite/network-map-service)
* [Braid - Corda RESTful API](https://gitlab.com/cordite/braid)
* [Corda Docker image](https://hub.docker.com/r/cordite/cordite)
* [Tokens on Corda](https://gitlab.com/cordite/cordite/-/tree/master/cordapps)
* [Accounts on Corda](https://gitlab.com/cordite/cordite/-/tree/master/cordapps)
* [Metering on Corda Notary](https://gitlab.com/cordite/cordite/-/tree/master/cordapps)
* [Public Corda Network](https://nms-test.cordite.foundation)

all came from Cordite.

## Can you help me with my digital asset project?
Working on your own tokenization, digital security, CBDC, stablecoin, DeFi project?

You might be interested in LAB577's [Digital Asset Shared Ledger](https://lab577.io/dasl )

[](https://lab577.io.dasl)

DASL offers a production ready, robust, finance grade application which can be used for tokenization of any type of underlying asset.

DASL has been built on the open source projects - Cordite and Corda. Members of LAB577 contributed to the Cordite and Corda projects in 2017 to port accounts/token functionality from Ethereum to Corda, leading to the TokenSDK.

Reach out to the friendly [Miles over at LAB577](mailto:[email protected]) to see if DASL can help you.

## FAQ
1. [How do I join the Cordite Society?](#how-do-i-deploy-my-own-cordite-node)
2. [How do I deploy my own Cordite node?](#how-do-i-deploy-my-own-cordite-node)
3. [Is there a UI for Cordite?](https://gitlab.com/cordite/cordite-ui)
4. [Where are the docs?](https://cordite.readthedocs.io)
5. [How do I use Cordite in my own CorDapp?](#how-do-i-use-cordite-in-my-own-project)
6. [How do I build from source](#how-do-i-build-from-source)

## How do I get in touch?
+ News is announced on [@We_are_Cordite](https://twitter.com/we_are_cordite)
+ More information can be found on [Cordite website](https://cordite.foundation)
+ We use #cordite channel on [Corda slack](https://slack.corda.net/)
+ We informally meet at the [Corda London meetup](https://www.meetup.com/pro/corda/)

## What if something does not work?
We encourage you to raise any issues/bugs you find in Cordite. Please follow the below steps before raising issues:
1. Check on the [Issues backlog](https://gitlab.com/cordite/cordite/issues) to make sure an issue on the topic has not already been raised
2. Post your question on the #cordite channel on [Corda slack](https://slack.corda.net/)
3. If none of the above help solve the issue, [raise an issue](https://gitlab.com/cordite/cordite/issues/new?issue) following the contributions guide

## How do I contribute?
We welcome contributions both technical and non-technical with open arms! There's a lot of work to do here. The [Contributing Guide](https://gitlab.com/cordite/cordite/blob/master/contributing.md) provides more information on how to contribute.

## Who is behind Cordite?
Cordite is being developed by a group of financial services companies, software vendors and open source contributors. The project is hosted here on GitLab.

## What open source license has this been released under?
All software in this repository is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

---

## How do I deploy my own Cordite node?
**Membership of the Cordite Society Limited co-operative is open and to join members need to operate an open source Cordite node on the [Public Corda Network](https://docs.corda.net/corda-network/index.html)**

### Node Hosting
[](https://chainstack.com/marketplace/cordite/)

The quickest way to join Cordite is to let [Chainstack launch a Cordite node for you](https://chainstack.com/marketplace/cordite/). Chainstack make it simple to launch Cordite nodes with an intuitive user interface, seamless orchestration, and predictable pricing. Allowing you to deploy and manage high-performing, secure Cordite nodes in minutes

### Self-hosting
To join the Public Corda Network you need to follow [the joining process](https://corda.network/participation/index.html#).

We use [Docker](https://docs.docker.com/get-started/) to deploy Cordite nodes. For instructions on starting up a Cordite node using Docker, please visit our [Docker Hub Repo](https://hub.docker.com/r/cordite/cordite/) for more information on configuration including environment variables:
```
docker run -it -d \
--name cordite-node \
--memory=2048m \
--cpus=2 \
-e MY_LEGAL_NAME="O=Cordite-example,L=Berlin,C=DE" \
-e MY_PUBLIC_ADDRESS="cordite.example.com" \
-e MY_EMAIL_ADDRESS="[email protected]" \
-e NETWORK_MAP_URL="https://nms-test.cordite.foundation" \
-e CORDITE_NMS="true" \
-v $(pwd):/opt/corda/certificates \
-v $(pwd):/opt/corda/persistence \
-p 10200:10200 \
-p 8080:8080 \
cordite/cordite:latest
```
Once the node is running, you will be able to see the REST API for accessing Cordite at https://localhost:8080/api. This will bring up a new node on [Cordite TEST](https://nms-test.cordite.foundation), certificates will be created and stored in certificates.

Below is an example for joining Corda UAT network
```
docker run -it \
--memory=2048m \
--cpus=2 \
-e MY_LEGAL_NAME="O=Cordite-example,L=Berlin,C=DE" \
-e MY_PUBLIC_ADDRESS="cordite.example.com" \
-e MY_EMAIL_ADDRESS="[email protected]" \
-e NETWORK_MAP_URL="https://netmap.uat.corda.network/3FCF6CEB-20BD-4B4F-9C72-1EFE7689D85B" \
-v $(pwd):/opt/corda/certificates \
-v $(pwd):/opt/corda/persistence \
-p 10200:10200 \
-p 8080:8080 \
cordite/cordite:latest
```

You will need to set the evironment variables `CORDITE_AUTH_USERNAME`
and `CORDITE_AUTH_PASSWORD` to enable authentication.

If you want a UI then head over to [Cordite UI](https://gitlab.com/cordite/cordite-ui)

If you do not wish to use Docker then alternatively you can download the [Cordite node](https://gitlab.com/cordite/cordite/tags) and run without docker by running `./run-corda.sh`. You will need Oracle JRE 8 JVM - minimum supported version 8u131.

### Environment Variables
Cordite uses environment variables to configure Cordite and create amoungst other things the Corda node.conf file at runtime. We have moved to use the [Official Corda Docker Image](https://docs.corda.net/docker-image.html#joining-an-existing-compatibility-zone).

Env Name| Description | Default
------------- |:-------------:|-------------:|
**REQUIRED** | |
MY_LEGAL_NAME | The [Corda Network X500 name](https://corda.network/participation/index.html#) to use for this node | `O=Cordite-XXX, OU=Cordite, L=London, C=GB`
MY_PUBLIC_ADDRESS | The public FQDN to advertise the node on | `localhost`
MY_EMAIL_ADDRESS | The email address the network operator can reach you | `[email protected]`
**OPTIONAL** | |
NETWORK_MAP_URL | The address of the network map service. | `https://nms-test.cordite.foundation`
DOORMAN_URL | The address of the doorman service | `https://nms-test.cordite.foundation`
TRUST_STORE_NAME | The filename of the Trust Root | `network-root-truststore.jks`
NETWORK_TRUST_PASSWORD | The password to the Trust Root | `trustpass`
MY_P2P_PORT | The port to advertise the node on | `10200`
TLS_CERT_CERL_ISSUER | CRL distribution point (i.e. URL) for the TLS certificate | `NULL`
TLS_CERT_CRL_DIST_POINT | CRL issuer (given in the X500 name format) for the TLS certificate | `NULL`
CORDITE_KEY_STORE_PASSWORD | Keystore password | `cordacadevpass`
CORDITE_TRUST_STORE_PASSWORD | Truststore password | `trustpass`
CORDITE_DB_USER | Username for db | `sa`
CORDITE_DB_PASS | Password for db | `dnpass`
CORDITE_DB_DIR | Path to db directory - only used for H2 | `/opt/corda/persistence/`
CORDITE_DB_URL | database JDBC URI | ``
CORDITE_DB_DRIVER | driver class name for database access - postgres 42.2.5 driver is embedded - you can use `org.postgresql.ds.PGSimpleDataSource` to enable it | `org.h2.jdbcx.JdbcDataSource`
CORDITE_DB_MAX_POOL_SIZE | DB Max pool size | `10`
CORDITE_H2_PORT | H2 DB port | `9090`
CORDITE_BRAID_PORT | Braid port | `8080`
CORDITE_DEV_MODE | Start up node in dev mode | `true`
CORDITE_DETECT_IP | Allow node to auto detect external visible IP | `false`
CORDITE_CACHE_NODEINFO | Persist NodeInfo-* file | `false`
CORDITE_LOG_MODE | Log in normal or JSON | `normal`
CORDITE_JVM_MX | JVM -Xmx value | `1536m`
CORDITE_JVM_MS | JVM -Xms value | `512m`
CORDITE_EXPORT_JMX | exportJMXTo: value in node.conf
CORDITE_TLS_ENABLED | True iff TLS enabled | `true`
CORDITE_TLS_CERT_PATH | Path to TLS certificate | `null`
CORDITE_TLS_KEY_PATH | Path to TLS Key | `null`
CORDITE_WEBSOCKET_FRAME_SIZE | TLS max framesize | `min(networkMaxTransationSize, 10MB)`
CORDITE_WEBSOCKET_MESSAGE_SIZE | TLS max message size | `min(networkMaxTransationSize, 10MB)`
CORDITE_NOTARY | Set to true to be a validating notary, false for non-validating or do not set to be a notary | `null`
CORDITE_METERING_CONFIG | JSON to set metering notary configuration | `null`
CORDITE_FEE_DISPERSAL_CONFIG | JSON to set metering fee dispersal config | `null`
JVM_ARGS | Override JVM args | See Dockerfile
CORDA_ARGS | Override CORDA args | See Dockerfile
RPC_PASSWORD | Not used |
MY_RPC_PORT | Not used |
MY_RPC_ADMIN_PORT | Not used |
CORDAPPS_FOLDER | Override location of cordapps | `/opt/corda/cordapps`
PERSISTENCE_FOLDER | Override location of persistence | `/opt/corda/persistence`
CERTIFICATES_FOLDER | Override location of certificates | `/opt/corda/certificates`
DRIVERS_FOLDER | Override location of drivers | `/opt/corda/drivers`
CONFIG_FOLDER | Override location of config | `/etc/corda`
**DEPRECATED** | Use Official Corda variables instead |
CORDITE_COMPATIBILITY_ZONE_URL | The address of the Network Map Service. | `https://nms-test.cordite.foundation`
CORDITE_LEGAL_NAME | The name of the node | `O=Cordite-XXX, OU=Cordite, L=London, C=GB`
CORDITE_P2P_ADDRESS | The address other nodes will use to speak to your node | `localhost:10002`
backward compatible | If deprecated variables are passed they override the `MY_*` variables |
CORDITE_AUTH_USERNAME | the username for authentication | `` (auth not enabled)
CORDITE_AUTH_PASSWORD | the password for authentication | `` (auth not enabled)
### Volume Mounts
File/Folder | Description
------------- |:-------------:|
**REQUIRED** | |
`/opt/corda/certificates` | certificates must be mounted at location
`/opt/corda/persistence` | persistent volume must be mounted for H2 and nodeInfo cache
**OPTIONAL** | |
`/etc/corda/node.config` | mounted node.conf will be used rather than generated
`/opt/corda/logs` | logs can be externally mounted
`/opt/corda/cordapps` | override Cordite corDapps
**DEPRECATED** | Use Official Corda mounts instead
`/opt/cordite/node.conf` | Configuration file detailing specifics of your node - will be created using env variables if a node.conf is not mounted
`/opt/cordite/db` | Location of the database for that node - for persistence, use volume mount
`/opt/cordite/certificates` | Location of the nodes' corda certificates - will be created if no certificates are mounted to node and devmode=true
`/opt/cordite/tls-certificates` | Location of TLS certificates - will use self-signed certificates if none are mounted to node
`/opt/cordite` | There is a soft link from `/opt/cordite` to `/opt/corda` providing backward compatability

## How do I build from source?
When building from source we recommend the following setup:
* Unix OS (ie OS X)
* Docker - minimum supported version 18.03.0
* NPM - minimum supported version 5.6.0
* Oracle JDK 8 JVM - minimum supported version 8u131

For those wishing to build Cordite from source run `./build.sh`. (NOTE: this script is not to designed to be run on Windows.)

You can parameterise build.sh with the target image name and corda base image (there are two of them !).
If you want to use the corda zulu image then you can pass that as the second parameter, like this:

```
./build.sh cordite/cordite:local corda/corda-zulu-java1.8-4.4
```

If you specify no parameters it will be the equivalent of:

```
./build.sh cordite/cordite:local corda/corda-corretto-java1.8-4.4
```

Cordite node is laid out in `./node` and gradle builds in `./cordapps`.
To start node after the build run `(cd node && run-corda.sh)`.

## How do I use Cordite in my own project
The core of Cordite is a collection of CorDapps which are java libraries. These are releasd to [Maven Central](http://central.maven.org/maven2/io/cordite/) and can be used in your project

## Can I run multiple nodes on a single machine?
Yes you can. You need to be aware of the ports you are using for each node on the same host to ensure none clash. For all new ports assigned to each node, you will need to update the firewall accordingly.

## How does json logging work
You can turn JSON, or structured, logging on by setting `CORDITE_LOG_MODE=json` in the docker environment variables. If you do this, beware of a few things:

* each log line is a flat JSON object with strings mapping to strings
* the severities are mapped on to stack driver severity levels
* MDC properties tip up as entries in the JSON object
* you can put as many `[key=value]` bits in your log message and each one will be stripped out of the message and will show up in the JSON object
* Jolokia agent is serving on port 7005 unless JVM_ARGS are over-ridden

You might well be asking why on earth we want to do this. A number of reasons:

* in this way we can get [Stackdriver](https://cloud.google.com/stackdriver/) and other JSON based monitoring solution not to interpret every message as INFO level!
* we can use the MDC for tracking requests across the entire cluster that we are monitoring - perhaps using session id, or some other discrim like txnId
* we can mark up various log messages as having certain types - we can then use this to slice and dice the messages - in particular we could figure out how much time we spend in certain blocks, or how often we call a method, but across a whole cluster, or within a certain type of transaction.

## Can I use the json layout in my own project

Absolutely! You just need to pull it into your project (maven coordinates are io.cordite:cordite-logging). Make sure it is available in your runtime and then add it to log4j2.xml:

```xml









```

Note the package setting in the configuration. We find using `-Dlog4j2.debug` system property really helps to debug things when you cannot
work out why things are not working.