Development environment of the taral ecosystem
taral-docs
Taral local development environment for clarity contracts Development environment for Stacks smart contracts with support for unit tests and integration tests
➤ Table of Contents
- ➤ Getting started
- ➤ Thank you
- ➤ Local testnet
- ➤ Development of smart contracts
- ➤ Unit tests
- ➤ Integration tests
- ➤ Future work
- ➤ FAQ
- ➤ Contributors
- ➤ License
➤ Getting started
When getting started with developing smart contracts, you need to first install the packages by calling
./install.sh
This installs a certain version of clarity-cli we're using to interact with the smart contracts locally in unit-test mode
➤ Thank you
This wouldn't be possible without the wonderful work of:
- [Stacks] (https://www.stacks.co/)
/packages/shared is borrowed with gratitude from Clarigen and modified to fit our usecase.
- [Clarity-JS-SDK] (https://github.com/blockstack/clarity-js-sdk/)
/packages/shared/native-cli is borrowed with gratitude from @blockstack/clarity-js-sdk and Clarigen with few modifications.
- [Clarinet] (https://github.com/hirosystems/clarinet/)
/clarity/docker but will rely more and more on Clarinet.
- [Catamaran-Swaps] (https://github.com/friedger/stacks-swaps/)
Stacks swaps (smart contracts and swap verification functions) with the exception that this one runs directly against the bitcoin node, not using the blockcypher API or other external dependencies.
- [Arkadiko] (https://github.com/arkadiko-dao/arkadiko/)
➤ Local testnet
The docker folder contains a docker-compose configuration to run a local testnet Stacks blockchain environment from scratch
This starts the following private testnet components:
- Postgres database
- Bitcoin -
puppet chain - Stacks node
- Stacks api
- Local stacks blockchain explorer
docker-compose files:
- bns.yaml
- docker-compose.yaml
$> docker-compose -f bns.yaml pull
$> docker-compose -f bns.yaml build
$> docker-compose -f bns.yaml up
This will import bns data into the /provisioning/private-testnet/bns-data folder.
Moving forward, starting the stack:
$> docker-compose pull
$> docker-compose build
$> docker-compose up
Note:
If you do not want to import bns data, then you will need to comment out the environment line BNSIMPORTDIR: /provisioning/private-testnet/bns-data from the stacks-blockchain-api container, otherwise the container will panic if it doesn't find the files
If you did import the bns data, you need to uncomment (if previously commented out) the environment line above and be aware that the stacks-blockchain will experience Connection refused problems from stacks-blockchain-api for the duration of bns data import. After the import, the API will become ready and accept events from stacks-blockchain node
➤ Development of smart contracts
The contracts folder contains the smart contracts powering taral (development in progress).
When developing/updating a new smart contract you need to generate:
- Abi json file
- Typescript interface file
- Index file exposing a neat and simple way of accessing the smart contract interface
yarn generate
➤ Unit tests
Unit tests will run against an offline version of clarity cli without docker stacks blockchain on.
➤ Integration tests
Integration tests run against the local testnet stack started with docker.
The way we run it is:
First, start the local testnet by doing
$> cd docker && docker-compose up
Wait until the local testnet is fully started and then execute the integration tests
$> yarn integration-tests
➤ Future work
Start development of the taral token and split this monorepo into multiple separate repositories once the codebase gets larger.
➤ FAQ
How can I help the Taral project?
Glad you asked. Taral project is developed by open source developers. Please contact us on Discord or Telegram if you want to help the project.
Is there a token?
A token is being currently developed, the ticker is TAL
When will this get released?
We are actively developing Taral, we will update once we have a clear timeline.
➤ Contributors
| |
|
| |:--------------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------:| | Doru Cioclea Octavian | Vincent L | You? | | 🔥 | 🔥 | |
