This project is in alpha and has not yet been battle-tested.
A multi-tenant off-chain payment microservice with support for transaction sharding. Crypticle lets users convert value between blockchain tokens and pegged credit which can be efficiently spent and/or transferred between accounts within the context of a centralized service/platform. The credit is entrusted to the service provider and is pegged to the value of the underlying blockchain tokens - This credit can be used to support an unlimited rate of off-chain transactions. Any unused credit can be converted back into trustless blockchain tokens at any time.
The goal of this project is to provide a fast, simple and scalable off-chain mechanism for spending and receiving blockchain tokens. By reducing the friction involved in converting back and forth between trustless blockchain tokens and entrusted pegged credit, users can choose their level of risk exposure when it comes to their spending money.
Some potential use cases:
- SaaS platform
- Game currency
- Centralized currency which is pegged to a cryptocurrency
After a Crypticle node has been attached to a specific Blockchain and has started accepting deposits from users, it becomes difficult for a Crypticle service provider to move away from that blockchain without violating the implicit agreement that they have with their users. Attaching services to a specific blockchain using Crypticle should therefore help to create sustainable demand for the underlying blockchain token.
Run from source
- Launch the RethinkDB server in a separate terminal (e.g. using the
git clone email@example.com:SocketCluster/crypticle.git
cd crypticle && npm install
cd public && npm install ; cd ..
cd blockchains && npm install ; cd ..
Deploy and scale on Kubernetes from the command line
The service is designed to be deployed and scaled on a Kubernetes cluster.
You will need the following software installed in order to deploy to a K8s cluster:
Node.js version 11 or higher. Download Node.js.
dockerCLI. Install Docker.
kubectlCLI. Install Kubectl.
If using Rancher, you will need to install the Rancher server on a remote machine of your choice; you will then be able to create your cluster from the Rancher control panel. Install Rancher.
If using GKE, you will need the
gcloudcommand from the Google Cloud SDK. Install Google Cloud SDK.
Once you have the required software, follow these steps to deploy Crypticle to a K8s cluster (this approach works best with Rancher):
- Setup your Kubernetes cluster with multiple nodes on your provider (3 is ideal for testing).
- Get the
Kubeconfigfrom your K8s control panel (or cloud provider) and paste it into the
~/.kube/configfile on your local machine (replace the whole file content).
- Open a new terminal window/tab to make sure that
kubectlhas the latest environment.
- Install the
crypticleCLI tool with
npm install -g crypticle.
- Create your project directory with
crypticle create myproject.
- Navigate to your project directory with
- Make sure that your production config file (e.g.
blockchains/rise/config.prod.jsonfor a Rise project) contains the correct values; this config is the one which will be used by default in the K8s cluster.
- Upload configs to your K8s cluster using
kubectl create configmap crypticle-config --from-file=blockchains/rise/config.prod.json --from-file=blockchains/rise/config.dev.json(replace
/rise/with your blockchain name).
- Upload secrets to your K8s cluster with
kubectl create secret generic crypticle-secret --from-literal=SECRET_SIGNUP_KEY=313e7cc1-ad75-4030-a927-6a09f39c1603 --from-literal=AUTH_KEY=15d16361-6402-41a5-8840-d2a330b8ea40 --from-literal=STORAGE_ENCRYPTION_KEY=0111394e-3b3e-4eb3-9759-21741cf055c7 --from-literal=BLOCKCHAIN_WALLET_PASSPHRASE="drastic spot aerobic web wave tourist library first scout fatal inherit arrange"(replace the values with your own).
- If your custom
adapter.jsfile has any dependencies, make sure that they are all inside the
blockchains/node_modules/directory (to allow them to build correctly).
crypticle deployto build your Docker image containing your custom adapter logic and your config files and then deploy it to your K8s cluster.
- To access the Crypticle app (after deployment has completed), use
kubectl describe ingress agc-ingressto get ingress IP addresses; you can copy and paste any of them directly into your browser's address bar.
- Before you execute any of the commands above, make sure that you have the
gcloudcommand installed (see quickstart guides). Check that
gcloudis installed using the
gcloud -vcommand (it should show you a list of version numbers).
- Create a K8s cluster from your GKE control panel.
- Once your cluster is ready, go to the
Clusterssection and click on the
Connectbutton next to your cluster; then run the provided
gcloud container clusters ...command in your terminal.
- Follow all the deployment steps from the section above with the following differences:
- Skip the step where you need to set the
~/.kube/configfile content; the
gcloudcommand above from GKE should take care of this automatically.
- Instead of
crypticle deploy, use
crypticle deploy --gke(this will cause
.yamlfiles from the
kubernetes/gke/directory to override those in the main
- To access the Crypticle app (after deployment has completed), go to the
Services & Ingresssection and click on the link from the
- Skip the step where you need to set the
Scaling on K8s
You can scale any
Deployment or the RethinkDB
StatefulSet using standard
kubectl scale ... --replicas=... commands.
Be very careful when scaling down the RethinkDB
StatefulSet as this may cause data loss if the underlying persistent volumes are removed.
Sharding transaction processing in the database
The RethinkDB admin control panel lets you shard any table at the click of a button.
After you've scaled your
rethinkdb service to multiple hosts, you will be able to increase the number of shards for the
This software is distributed under the
AGPL-3.0 license. You are free to use and distribute the code so long as the code which uses or is derived from this project is made public under the same license. If you want to make a contribution to Crypticle then you must grant the Crytpicle project owners the right to use and redistribute your contributed code, content or media under any license. In addition to the main
AGPL-3.0 license, the Crypticle project owners reserve the right to distribute Crypticle (along with contributions made by any third parties) under alternate licenses for commercial purposes.
If the terms of the
AGPL-3.0 license are not suitable for your use case, please contact a Crypticle project owner to discuss alternative options.