Punica Python
Overview
Punica Python is a dApp development command line tool which has (almost) everything you need to start developing your dApp based on Ontology network.
There are a few technical requirements before we start. Please install the following:
Then, execute the following command to install your tool:
Quickstart
To use most Punica commands, you need to run them against an existing Punica project. So the first step is to create a Punica project.
You can create a bare Punica project with no smart contracts included, use punica init
command.
Once this operation is completed, you'll now have a project structure with the following items:
contracts/
: Directory for Ontology smart contracts.src/
: Directory for DApp source file.test/
: Directory for test files for testing your application and contracts.wallet/
: Directory for save Ontology wallet file.
Creating Project
To use most Punica commands, you need to run them against an existing Punica project. So the first step is to create a Punica project.
Create New Project
You can create a bare Punica project with no smart contracts included, use punica init
command.
Once this operation is completed, you'll now have a project structure with the following items:
contracts/
: Directory for Ontology smart contracts.src/
: Directory for DApp source file.test/
: Directory for test files for testing your application and contracts.wallet/
: Directory for save Ontology wallet file.
If you not run Punica CLI in you project root directory, you need to use -p
or --project
option to specify your DApp project's path.
Creating Box Project
You can create a bare project template, but for those just getting started, you can use Punica Boxes, which are example applications and project templates.
We'll use the ontology-tutorialtoken box, which creates a OEP4 token that can be transferred between accounts:
Create a new directory for your Punica project:
Download ("unbox") the MetaCoin box:
You can use the punica unbox <box-name>
command to download any of the other Punica Boxes.
If you not run punica cli in you project root directory, you need to use -p
or --project
option to specify your DApp project's path.
Last updated