Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Implementation of Stipula language (Master's degree, UniPD, 2023).

Notifications You must be signed in to change notification settings

federicozanardo/stipula-node

Repository files navigation

Stipula Node

What does it include at the moment?

  • Message layer (API)
    • Handle the socket
    • Handle the messages
  • Execution layer
    • Stipula Virtual Machine (SVM)
      • Smart Contract Virtual Machine
      • Script Virtual Machine
    • Handle triggers
      • Thread management
      • Develop code for virtual machine
  • Deploy a contract
    • Handle the request
    • Stipula compiler

Future improvements:

Status of the project

The node is able to:

  • Create and manage a contract instances
  • Keep the state of the contract
  • Call functions
  • Manage parties (addresses)
  • Manage assets
  • Manage storage
  • Schedule and trigger events
  • Manage payments ("pay-to-contract" and "pay-to-party")
  • Manage client connections and requests/responses
  • Add Docker support
  • Compiler contracts
  • Dynamic typing

"Pay-to-Contract" means when a user wants to pay a contract and "Pay-to-Party" means when the contract wants to pay a party.

How to run a node?

Build the image:

docker build -t stipula-node:<version> .

Example:

docker build -t stipula-node:v0.4.2 .

Run the image:

docker run -d stipula-node:<version>

Example

docker run -d stipula-node:v0.4.2

In order to execute properly the node, there is the need to launch it with docker-compose:

docker-compose -f docker-compose.yml up -d

Inside the docker-compose.yml there is the need to specify the version of the image (i.e. image: stipula-node:v0.4.2). Furthermore, due to the limitations in the current development, in order to start up the node, there is the need to seed the node with ownerships (single-use seals) and assets (create an asset an its supply). In order to do that, there is the need to specify the seeding process with yes or no:

environment:
  - SEED=no

Another way to run a node is to substitute

image: stipula-node:v0.4.2

with

image: "ghcr.io/federicozanardo/stipula-node:v0.4.2"

In this way, docker-compose downloads the image from GitHub packages section and runs a node.

Generate the grammar

Download the jar file from https://github.com/antlr/website-antlr4/blob/gh-pages/download/antlr-4.10-complete.jar.

java -jar antlr-4.10-complete.jar -visitor Stipula.g4

Example of client

An example of an application interacting with the current Stipula implementation is available at https://github.com/federicozanardo/stipula-client.

Guide

The functioning of the architecture is explained in the thesis present at the address https://github.com/federicozanardo/stipula-thesis.

About

Implementation of Stipula language (Master's degree, UniPD, 2023).

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages