Giter Site home page Giter Site logo

ant4g0nist / chinstrap Goto Github PK

View Code? Open in Web Editor NEW
34.0 4.0 5.0 24 MB

A development environment, testing framework, and origination pipeline focused solely on Tezos

License: MIT License

Python 99.75% Dockerfile 0.25%
tezos tezos-blockchain smartpy smart-contracts blockchain smart-contract-tools chinstrap python pytezos hackathon

chinstrap's Introduction

Chinstrap

This project is Archived in favor of Taquito and Factori

Chinstrap

License: MIT Baked by ant4g0nist docs PyPI

Chinstrap is supported by Tezos Foundation Grant

Useful links

Overview

Chinstrap is a development environment, testing framework, and asset pipeline focused solely on Tezos blockchain, aiming to become Swiss-Army-Knife for Tezos Smart Contract developers.

Chinstrap makes developers' lives easier by providing support for multiple contract compilations, tests, and origination on many public and private Tezos networks.

Features

Chinstrap offers:

  • End-to-end build cycle support for Creation, Compilation, Testing, and Origination of Smart Contracts
  • Local sandbox environment to develop and test contracts
  • Support for contracts in SmartPy, JsLIGO, CameLIGO, PascaLIGO, and ReasonLIGO.
  • Support for tests in Python(SmartPy/PyTest), JsLIGO, CameLIGO, PascaLIGO, and ReasonLIGO.
  • Scriptable deployment & originations framework
  • Originations Management for deploying to many public & private networks
  • Interactive debug console to debug and directly communicate with contracts

Why?

Here are some reasons why I built Chinstrap:

  • Development framework that solely focuses on Tezos Smart Contract development
  • Easy to use and everything in place already.
  • Designed focused solely to support writing contracts in SmartPy, JsLIGO, CameLIGO, PascaLIGO and ReasonLIGO.
  • Extendable
  • Tests can also be programmed in Ligo, Python(SmartPy/PyTest) and JsLIGO, CameLIGO, PascaLIGO and ReasonLIGO.
  • Easy maintenance

Getting started

Requirements

  • Python >= 3.7
  • Docker
  • Node.js
  • Homebrew needs to be installed.
$ brew tap cuber/homebrew-libsecp256k1
$ brew install libsodium libsecp256k1 gmp

Installation

git clone https://github.com/ant4g0nist/chinstrap
cd chinstrap
python3 setup.py install

Usage

╭─ant4g0nist@d3n ~/Desktop/Tezos/chinstrap
β•°β”€βž€  chinstrap

      _     _           _
  ___| |__ (_)_ __  ___| |_ _ __ __ _ _ __
 / __| '_ \| | '_ \/ __| __| '__/ _` | '_ \
| (__| | | | | | | \__ \ |_| | | (_| | |_) |
 \___|_| |_|_|_| |_|___/\__|_|  \__,_| .__/
                                     |_|

usage: chinstrap [-h] {init,config,networks,compile,install,create,templates,test,sandbox} ...

Chinstrap - a cute framework for developing Tezos Smart Contracts

positional arguments:
  {init,config,networks,compile,install,create,templates,test,sandbox}
    init                Initialize a new Chinstrap project
    config              Verify Chinstrap configuration
    networks            List currently available test networks
    compile             Compile contract source files
    install             Helper to install compilers
    create              Helper to create new contracts, originations and tests
    templates           Download templates provided by SmartPy
    test                Run pytest/smartpy/ligo tests
    sandbox             Start a Tezos local sandbox

optional arguments:
  -h, --help            show this help message and exit

Quickstart

To compile the smart contracts:

$ chinstrap compile

For Flextesa sandbox:

╭─ant4g0nist@d3n ~/Desktop/Tezos/chinstrap
β•°β”€βž€  chinstrap sandbox -h

      _     _           _
  ___| |__ (_)_ __  ___| |_ _ __ __ _ _ __
 / __| '_ \| | '_ \/ __| __| '__/ _` | '_ \
| (__| | | | | | | \__ \ |_| | | (_| | |_) |
 \___|_| |_|_|_| |_|___/\__|_|  \__,_| .__/
                                     |_|

usage: main.py [-h]
               {init,config,networks,compile,install,create,templates,test,sandbox,develop,originate,account}
               ...

positional arguments:
  {init,config,networks,compile,install,create,templates,test,sandbox,develop,originate,account}
    init                Initialize a new Chinstrap project
    config              Verify Chinstrap configuration
    networks            List currently available test networks
    compile             Compile contract source files
    install             Helper to install compilers
    create              Helper to create new contracts, originations and tests
    templates           Download templates provided by SmartPy and *LIGO
    test                Run pytest/smartpy/ligo tests
    sandbox             Start a Tezos local sandbox
    develop             Open a console with a local Flextesa development
                        environment
    originate           Run originations and deploy contracts
    account             Tezos account

optional arguments:
  -h, --help            show this help message and exit

To download template contracts provided Smartpy or LIGO Lang:

usage: main.py templates [-h] -l
                         {JsLIGO,PascaLIGO,CameLIGO,ReasonLIGO,SmartPy}

optional arguments:
  -h, --help            show this help message and exit
  -l {JsLIGO,PascaLIGO,CameLIGO,ReasonLIGO,SmartPy}, --language {JsLIGO,PascaLIGO,CameLIGO,ReasonLIGO,SmartPy}
                        The type of the item to create

To run tests:

╭─ant4g0nist@d3n ~/Desktop/Tezos/chinstrap
β•°β”€βž€  chinstrap test

To check configuration:

β•°β”€βž€  chinstrap config

      _     _           _
  ___| |__ (_)_ __  ___| |_ _ __ __ _ _ __
 / __| '_ \| | '_ \/ __| __| '__/ _` | '_ \
| (__| | | | | | | \__ \ |_| | | (_| | |_) |
 \___|_| |_|_|_| |_|___/\__|_|  \__,_| .__/
                                     |_|

Using development network
Loaded wallet tz1cagbr5u2YdyxtWA72z3KjEL1KJ2YEs71z. Balance: 0.000000

Milestones

Milestone 1

  • Support the latest protocol updates of the Tezos protocol on Chinstrap.
  • Support and facilitate the programming of smart contracts and respective tests in Ligo.

Milestone 2

  • Improve, update, and maintain comprehensive documentation of the platform for relevant stakeholders (e.g. developers and others).
  • Improve the sandbox and REPL (Real-Eval-Print Loop) experience of the platform.
  • Release version 1.0.0 of the platform.

Milestone 3

  • Provide a Visual Studio Code plugin for origination and tests.

TODO

  • Add JsLIGO, CameLIGO, PascaLIGO, and ReasonLIGO support for contracts and tests
  • Remove dependency on migration contract
  • Update Chinstrap to latest protocols
  • Add SmartPy templates
  • Add Ligo templates
  • Update documentation to support v1.0.0
  • Create chinstrap.io landing page
  • Add repl
  • Improve Sandbox integrations in repl
  • Release version 1.0.0 of the platform.
  • Add TypeScript generation for compiled contracts
  • Add support for Jest tests
  • Visual studio code plugin
  • Add unit tests for chinstrap
  • Add a homebrew formula
  • Add fig specifications

References

Credits

chinstrap's People

Contributors

ant4g0nist avatar kalouo avatar nigro64 avatar romarq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

chinstrap's Issues

Changing the structure of the originations object

Describe the issue
Changing the structure of the originations object for better discoverability.

Examples
The current originations object is structured as follows:

{
  "chinstrap": {
    "networks": {
      "development": {
        "ce454cb23b49e96cd9190eed128ab4eb5e83bca865b3c3ef1c4ede0124ba5a0a": {
          "orignation_hash": "ooDL2ymhse9ExVpJCV9M1xD54ACPXr7s7DQ2fejXTHz2jXmb94i",
          "address": "KT1VuEMFcjJ1GnhVyg3LdfYbhKH7F7wo2u5B",
          "name": "contract_name",
          "date": "2022-08-16T11:22:48.104119"
        },
      }
    }
  }
}

For better discoverability I propose the following:

{
  "chinstrap": {
    "networks": {
      "development": {
        "<contract_name>": [
          {
            "hash": "ce454cb23b49e96cd9190eed128ab4eb5e83bca865b3c3ef1c4ede0124ba5a0a",
            "orignation_hash": "ooDL2ymhse9ExVpJCV9M1xD54ACPXr7s7DQ2fejXTHz2jXmb94i",
            "address": "KT1VuEMFcjJ1GnhVyg3LdfYbhKH7F7wo2u5B",
            "name": "contract_name",
            "date": "2022-08-16T11:22:48.104119"
          }
        ]
      }
    }
  }
}

At every run of chinstrap originate, the script would check if a contract already exists at the corresponding index of the contract_name array. For example, suppose you want to deploy two instances of nft_contract to the sandbox and have two files in the originations/folder:

  • 1_nft_contract_a.py
  • 2_nft_contract_b.py

The steps would be as follows:

  1. On the first run of chinstrap originate, two instances will be originated and two corresponding objects will be appended to the array under chinstrap.networks.development.nft_contract
  2. On the second run of chinstrap originate, the script detects that contracts already exist at index 0 and 1 of the chinstrap.networks.development.nft_contract, and simply returns the existing deployments.
  3. You add 3_nft_contract_b.py to the originations/ folder and run chinstrap originate. The first two originations are skipped as per the logic above, but the third one is executed because the script detects nothing at index 3 of the nft_contract array.

"--originate" perform tests

Hi, I use chinstrap with docker as expressed in README via the following command:
docker run -v pwd:/home --rm -it ant4g0nist/chinstrap

when I run the --originate option, chinstrap actually performs --test pytest command instead of originating contracts.
I have the same issue with other commands such as --debug or --network .

Docker image

Is there a chance to have a docker image so we can install it with a oneliner and without deps?

Ligo support

Any chances to use it to compile ligo contracts in some near feature?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.