epam / mintgate

1 stars 2 forks source link

MintGate

Quickstart

If you don't have Rust:

Install Rust https://rustup.rs/

Add wasm32 target to Rust

rustup target add wasm32-unknown-unknown

Check for Rust version 1.51.0. To compile the simulation tests mg-sim, make sure to have at least Rust 1.51.0. The mg-sim tests depend indirectly on the arrayvec library. This library in v0.7.0 uses a Rust feature available from 1.51.0, const generics. You can check Rust version with rustc --version. If an update is needed, run

rustup update stable

Install near-ts and near-md (optional)

near-ts is a utility to generate TypeScript bindings from a Rust contract. On the other hand, near-md is a utility to generate Markdown documentation from a Rust contract. You can install it with

cargo install near-syn

Or alternatively you can install it directly from GitHub

cargo install --git https://github.com/epam/near-syn --branch main

To Explore

Scripts

The package.json contains scripts to facilitate running compilation targets and tests. The following are the most relevant scripts.

Terminology

Storage Costs

measure:storage-costs script measures the costs of storage for nft-contract and market-contract. It performs operations on collectibles and tokens on the contracts, collects the information on changes in Ⓝ reserved for storage for different methods.

By default, measure:storage-costs adds 20 collectibes and 40 tokens for test account (it reuses already present accounts or creates new ones and deploys contracts if needed).

It is also possible to instruct the script to add the arbitrary number of collectibles and tokens.

To do so run from project's root:

ts-node test/measure.ts --collectibles 100 -- tokens 200

where:

The script generates data.js file in tests folder. The information from data.js as datasets for charts in chart.html file also located in tests folder. To see the charts open chart.html in any browser.

Example of storage costs charts with data generated by running measure script with default values:

image