Skip to content
callistonianembrace edited this page Oct 8, 2021 · 4 revisions

Developing Deku

This page is a overview of the project for those interested in the development of the Marigold sidechain - Deku. If you're simply looking to download and run the node as an end-user, checkout the docs here

Tools

Package management

We use esy for managing both OCaml dependencies and Javascript dependencies (JS scripts for convenient mainchain interaction)

Syntax

We use Reason syntax, but snake case for naming the variables.

Build tools

We use Dune to build the OCaml/Reason dependencies, and webpack to build JS bundles.

Misc

The repo also contains a basic tmuxinator config file to manage mutiple tmux sessions, each running individual instances of the sidechain node.

Running the sidechain

The steps are identical to those explained for end-users here. Underneath,

  1. Identities are generated
  2. They are registered on the mainchain first by originating consensus.mligo
  3. A series of setup commands create all the necessary config and data in a folder
  4. Run the node command, esy x http_server /path/to/data/folder

Steps 3 and 4 are repeated for each individual nodes that create spawned to participate in the network.

Additional notes

Waiting confirmations

tezos-client wait for oo947Fbk7vo4HqKYTZLCXa5j7uG94wbnRjVYC2ukduMdZFr9Cnd to be included --confirmations 5 --branch BLd9DyeZfLKaLikLL44HhDCwWJDc1mQ1SD5LZAuQcdMEUwtru2T

Test networks

consensus.mligo can be very conveniently originated using the LIGO IDE. However, at the time of writing, it deploys only Florencenet and it could be difficult to find a public Florencenet running. One could either,

  1. Run tezos-node locally with florencenet
  2. Deploy the contracts on the latest test network (atm, Granadanet)

Running Florencenet locally

Download the snapshot from https://snapshots-tezos.giganode.io/ link - https://ipfs-tezos.giganode.io/ipfs/QmU9GgpyyD2eYrckjARhrKqZY7k3AsDKaQi38BtW8HtS12

  • Snapshot:ROLLING
  • Protocol:PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4iNode
  • version:706457dc (2021-07-02 23:42:56 +0200(9.4)
  • Blockhash:BKnbumv9paLeCpwvvChwRqc9t8XmF4vVsqsrDrLJWytMq4Q5UmN
  • Blocknum:422231
  • Blocktime:11-08-2021-0149LINK:IPFS | WEB
Run the following
tezos-node snapshot import --data-dir ~/tezos-florencenet --network florencenet --rpc-add localhost ~/Downloads/QmPx3snZcXZua12ECWunsGJyw5WfkrzxMw12k622hAqP3T
tezos-node run --data-dir ~/tezos-florencenet --network florencenet --rpc-add localhost
Example
tezos-client --endpoint http://localhost:8732 rpc get /chains/main/blocks/head/context/contracts/KT1THt7BQNmovken76RkErjFWaCGU2AUxVvA

Deploy contract on Granadanet

See this script

Project components

  1. Core protocol
  2. Network protocol
  3. Smart contract Interpretter

Core protocol

Resides in the protocol/ folder. Pure Reason/OCaml logic manipulating tickets from mainchain as native sidechain entities and commiting every block back to the mainchain. See these whimsical diagrams for a high-level overview.

Network protocol

Resides in node/ folder. Currently, uses HTTP for transport encoded as JSON. Use mesh topology and no gossip protocol supported yet.

Smart contract interpreter

See issue TBD for progress.

Raising Pull Requests

Please consider the following,

  1. Using / format for the branches
  2. Opening follow up posts on the issue tracker for non-critical issues observed during reviews of critical PRs.
  3. Specify the problem description along the with proposed solution in the PR description. Refer merged PRs to get an idea of what is considered a good PR description.
  4. Specify if a PR depends on another PR before it can be merged.

Conventions

See ./HACKING.md

Resources

  1. Whimsical Diagrams
  2. Notes