An open API service indexing awesome lists of open source software.

https://github.com/Arvolear/smplx-template

Smplx template project for ad-hoc simplicity development
https://github.com/Arvolear/smplx-template

bitcoin elements liquid simplicity smart-contracts template

Last synced: about 1 month ago
JSON representation

Smplx template project for ad-hoc simplicity development

Awesome Lists containing this project

README

          

# Smplx Template

Template [Smplx](https://github.com/BlockstreamResearch/smplx) repository for ad-hoc simplicity smart contracts development.

## Overview

The repository structure is the following:

```md
root
├── simf — Simplicity smart contracts source directory
├── src — The project's Rust code (witness, transaction, etc builders)
│ └── artifacts — Simplicity artifacts generated by Simplex (gitignored)
├── tests — Simplex tests directory
├── Cargo.toml — The project's Rust configuration
└── Simplex.toml — The project's Simplex configuration
```

> [!NOTE]
> The tempalate assumes that the framework has already been installed via [`simplexup`](https://github.com/BlockstreamResearch/smplx/blob/master/simplexup/README.md).

## How to use

The provided template works out of the box, but you may need to build the smart contract artifacts first to make Rust happy.

### Build

First run the build command to generate Simplicity artifacts:

```bash
simplex build
```

### Test

Once the artifacts are generated, run Simplex test "basic_test" inside `basic_test.rs`:

```bash
simplex test basic_test --nocapture
```

You will see the test passing!

### Regtest

If you wish to keep the blockchain's state between the tests, you will need to spin un a local regest separately:

```bash
simplex regtest
```

This command sets up the standalone nodes that can be connected to via Simplex configuration.

### Configuration

Check out `Simplex.toml` example to see how to configure Simplex for your needs.

## Disclaimer

GLHF!