All Projects → marigold-dev → deku

marigold-dev / deku

Licence: MIT license
No description, website, or topics provided.

Programming Languages

ocaml
1615 projects
LigoLANG
4 projects
shell
77523 projects
Nix
1067 projects
javascript
184084 projects - #8 most used programming language
Starlark
911 projects

Marigold Sidechain

A sidechain to Tezos by Marigold focused on higher throughput.

Getting started

Pre-requisites

You'll need a one of the two package managers Deku is developed with:

Esy

Esy can be installed with NPM or Yarn.

npm i -g esy # on Ubuntu you might need --unsafe-perms to work around EACCES issues
# or
yarn global add esy

Nix

Install Nix by following the official guide. Additionally, you must enable the flakes feature:

echo 'experimental-features = nix-command flakes' >> /etc/nix/nix.conf

Nix automatically installs all the dependencies and devtools needed for development, including Esy, Docker, etc.

You can load the Nix development with the command:

cd deku
nix develop -c $SHELL

We recommend installing direnv to automatically load the Nix environment for you whenever you enter the directory. Once installed, you can enable direnv for Deku with:

cd deku
direnv allow

Building

# with esy
esy
esy dune build 

# with nix
dune build

Testing

We use Rely to write tests. These can be run with,

# with esy
esy test

# with nix
dune build @runtest

esy test will only run tests that the dependencies have changed since the last time you've ran it, so in order to run all the testsuite you must run esy test -f instead.

Running a sidechain

For convenient local development, we have included two components:

  • A docker-compose.yml file that setups a local Tezos network using Flextesa running in Docker. Additionally, the network sets up a Better Call Dev instance for introspection of the deployed contract and its operations. The BCD interace is available in your browser at http://localhost:8000.
  • A script ./sandbox.sh that sets up a identities for a local Deku cluster. This script is the easiest way to get started with Deku; however, it uses unsafe configuration options to lower the required Tezos confirmations to 1. This setting greatly speeds up local development, but is not at all safe for production!

Requirements

The sandbox requires Bash and Docker installed. in addition to the usual Deku pre-requisites (alternatively, you can use nix to provide these).

Setup

Run docker compose up -d to start a Tezos network and the BCD interface.

Run ./sandbox.sh setup to start a local Tezos sandbox network, setup three Deku validator node identities, and deploy a Deku consensus contract configured for these validators to the local sandbox.

Run ./sandbox.sh tear-down to kill the Tezos sandbox network and wipe the Deku state.

Run docker compose down -v to stop the Tezos network and destroy the BCD database.

Start

Simply run:

./sandbox.sh start

This starts 3 nodes as background processes.

You may have to stop the session with killall deku-node to fully shutdown the cluster.

In either case, if all goes well, you should see the block height displayed in the terminal and increasing every second or so.

Experimental: Tilt

Our experimental workflow uses Tilt which is an advanced orchestrator. If you're using nix everything is already provided. If not, you will have to install the things in requirements + tilt and docker-compose.

When the requirements are in place you should just have to run tilt up and everything will be running.

Contributing

Please refer the developer wiki here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].