marigold-dev / deku

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deku

A Sidechain Framework for Tezos

Raison d'être

Deku is a framework for developing high-performance, application specific sidechains that interop with the Tezos blockchain.

Deku blockchains use a fast, deterministic consensus algorithm based on Tendermint to acheive consensus on blocks. Deku is parametric with respect to the virtual machine being run, allowing developers to write custom virtual machine tailored to their application. SDK's for the VM exist in NodeJS and OCaml, but the VM protocol can be implemented in any language.

Deku has native support for Tezos tickets, allowing virtually any type of asset to be transferred to and from Deku networks via the bridge contract in the timespan of a single Tezos block.

Deku is used to power Deku Canonical - an L2 WebAssembly smart contract platform for Tezos operated by Marigold.

Getting Started

To develop and deploy a WASM smart contract to Deku-C, head over to the Tuna compiler docs.

To develop DApps and client-side applications for Deku networks, see the client library and the the OpenAPI schema. You can fork the Deku-C DApp template to get started developing DApps Deku-C.

To get started developing your own Deku network, you can fork the Deku template.

Development

Building from Source

We currently support building from source on Linux x86_64 and MacOS M1 systems.

Deku is packaged with Nix. See the Nix docs for instructions for your system. Additionally, ensure Nix flakes are enabled.

Once Nix is installed, the dev environment can build built with:

nix develop .

Tests and Benchmarks

Tests and benchmarks can be run with the respective commands:

nix develop -c dune build @runtest
nix run .#benchmark

Running the development network

Our sandbox network uses Flextesa to run a local Tezos network via docker compose. Additionally, our compose file includes a local instance of https://better-call.dev that can be used to inspect and interact with any contracts you deploy to the Tezos sandbox network.

First, start the Flextesa sandbox. You'll need to login it the Github container registery which you can do by following these instructions.

docker compose up -d

Deku chains are CPU-intensive, so depending on your available resources you may want to lower the default block size (default is 10000 operations/block):

export DEKU_DEFAULT_BLOCK_SIZE=100

You can start the chain with:

./start.sh

This will run nodes listening for gossip on ports 4440, 4441, 4442, and 4443 respectively. Node 0 will also run a user-facing API on port 8080. E.g.:

curl http://localhost:8080/api/v1/chain/blocks/head

About

License:MIT License


Languages

Language:OCaml 70.9%Language:TypeScript 18.7%Language:Shell 1.6%Language:Terra 1.5%Language:JavaScript 1.4%Language:Nix 1.3%Language:LigoLANG 1.2%Language:Python 1.0%Language:Batchfile 0.8%Language:Raku 0.5%Language:Standard ML 0.5%Language:Makefile 0.3%Language:CSS 0.2%Language:Dockerfile 0.0%Language:Perl 0.0%