Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Latest commit

 

History

History
56 lines (34 loc) · 2.6 KB

README.md

File metadata and controls

56 lines (34 loc) · 2.6 KB

Pre requirements

In order to use the scripts described below, you need to build DDC contracts, and install the yarn package manager. Also, check the config file, to ensure that you are running scripts with expected environment variables.

Examples

The examples folder contains scripts that demonstrate how to properly send transacrions to DDC Bucket contracts using the @polkadot/api library. These simple scenarious should help other team members to clarify the business logic flow, and quickly detect issues related to various business constraints and infrastructue constraints (i.e. gas price, attached tokens, method signature, etc.). Scripts should be updated while the contract is evolving to reflect the actual logic.

DDC Contract demo scenario

Run the script as:

ENV=devnet yarn run demo-ddc-bucket

The execution progress will be displayed in the console along with links to explorer that will help you to investigate the details of each transaction

Display DDC Contract state

Run the script as:

ENV=devnet yarn run print-ddc-bucket

Deployment DDC Contract using script

The deployment folder contains scripts that allow you to deploy artifacts to a local or remote network. Typically, these scripts are used for EDC, Devnet and QAnet environments during development. For Testnet and Mainnet environments, it is recomended to upload the contract code manually and assert all the required keys, attached tokens, gas limits, etc. during deployment and contract instantianating.

DDC Contract deployment

Run the script as:

yarn run deploy-ddc-bucket

Optionally, the command can accept a code hash as the first parameter, and constructor name as the second parameter. In order to use these options, your contract artifacts must be registered to retrieve the required metadata from artifacts.

DDC Contract setup

Run the script as:

DDC_CONTRACT='6PZ6ndAdULxsnzLjyNmPuWonS9jSxTRgXN1EtVMnbi41VZZg' SUPERADMIN='//Alice' ENV='devnet' yarn run setup-ddc-bucket

Use the DDC Contract address in place of the DDC_CONTRACT variable that you want to configure, the admin of DDC Contract from the deployment step in place of SUPERADMIN variable, and DDC environment that you are targeting in place of the ENV variable

Build and Deploy all contracts

To run both building and deployment for all contracts, you can use the build-and-deploy.sh script.