Coder Social home page Coder Social logo

arufa-research / junokit Goto Github PK

View Code? Open in Web Editor NEW
13.0 0.0 2.0 3.73 MB

Junokit is a development framework for building juno contracts. The aim of the project is to make juno contracts development process simple, efficient and scalable.

Home Page: https://junokit.arufaresearch.com/

License: MIT License

JavaScript 2.38% Shell 0.02% Rust 10.31% TypeScript 86.39% HTML 0.31% CSS 0.59%
juno blockchain cosmwasm rust tooling smart-contracts

junokit's Introduction

Junokit

Junokit is a development framework for building juno contracts. The aim of the project is to make juno contracts development process simple, efficient and scalable. User can focus on logic of juno contract and not much about further steps in development. It facilitates features such as initiating project repo from contract templates, easy compilation of contracts, deployment, Interacting with contracts using schema and contract testing framework.

Requirements

The minimum packages/requirements are as follows:

  • Node 14+
  • Yarn v1.22+ or NPM `v6.0+**
  • Connection to an Juno node.

Install junokit

Installation from released version

To install junokit globally in your system you can use:

  • Using Yarn: yarn global add junokit
  • Using NPM: npm install -g junokit

Installation from master.

The master branch corresponds to the latest version.

To use junokit on your system, follow the steps below:

$ git clone https://github.com/arufa-research/junokit.git
$ cd junokit
$ yarn install
$ yarn build
$ cd packages/junokit
$ yarn link
$ chmod +x $HOME/.yarn/bin/junokit

Install dependencies

Setup Rust compiler

$ cd infrastructure
$ make setup-rust

Follow our infrastructure README for instructions how to setup a private network.

Usage

Initialize a project

$ junokit init <project-name>

This will create a directory inside current directory with boiler-plate code. The contracts/ directory has all the rust files for the contract logic. scripts/ directory contains .js scripts that user can write according to the use case, a sample script has been added to give some understanding of how a user script should look like. test/ directory contains .js scripts to run tests for the deployed contracts.

Listing Tasks

To see the possible tasks (commands) that are available, go to project's folder.

$ junokit

This is the list of built-in tasks. This is your starting point to find out what tasks are available to run.

Compile the project

To compile the contracts, Go to project directory:

$ cd <project-name>
$ junokit compile

This command will generate compiled .wasm files in artifacts/contracts/ dir and schema .json files in artifacts/schema/ dir.

Cleanup Artifacts

To clear artifacts data, use

$ junokit clean

This will remove the artifacts directory completely. To clean artifacts for only one contract, use

$ junokit clean <contract-name>

This will remove specific files related to that contract.

Running user scripts

User scripts are a way to define the flow of interacting with contracts on some network in form of a script. These scripts can be used to deploy a contract, query/transact with the contract.A sample script scripts/sample-script.js is available in the boilerplate.

Run tests

$ yarn run test

License

This project is forked from hardhat, and just base on the hardhat-core part then modify it under MIT license.

Thanks

hardhat - Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. Get Solidity stack traces & console.log.

junokit's People

Contributors

99adarsh avatar amityadav0 avatar arpitraj29 avatar arufaresearch avatar coco-sha avatar dependabot[bot] avatar hunny98 avatar udit-gulati avatar uditgulati avatar

Stargazers

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

junokit's Issues

Junokit Run scripts error

When running the command:
junokit run scripts/sample-script.ts --network testnet

The code returns the following errors:

Could not find a declaration file for module 'junokit'. <Path of junokit index.js> Could not find a declaration file for module 'junokit'

Try npm i --save-dev @types/junokit if it exists or add a new declaration (.d.ts) file containing declare module 'junokit';`

sample-project/artifacts/typescript_schema/Counter.ts (41,17): Property 'queryMsg' does not exist on type 'CounterQueryContract'.

sample-project/artifacts/typescript_schema/Counter.ts (91,23): Property 'executeMsg' does not exist on type 'CounterContract'.

sample-project/artifacts/typescript_schema/Counter.ts (110,23): Property 'executeMsg' does not exist on type 'CounterContract'.

cargo.toml file takes local path

When creating a junokit project the cargo.toml created in contracts use local paths from cw-controller,cw-storage-plus,cw20. Junokit compile hence does not work, removing the local paths from the cargo.toml file lets the contracts compile. Here's how the code looks:

cw-controllers = { version = "0.13.2" }
cw-storage-plus = { version = "0.13.2" }
cw20 = { version = "0.13.2" }

Improve the migration flow

  1. Current flow is, clear the checkpoint, deploy new codeId, add manually the contract address to checkpoint, run the migrate step.
  2. The manual steps should be automated.
  3. The scripts need not be commented out through the process.
  4. The contracts version and migration history should be stored in the checkpoints.
  5. Migration script should have cleaner structure.

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.