From 1f49e46d8c7c4ce86b253e0239e559204b432145 Mon Sep 17 00:00:00 2001 From: Salvatore Ingala <6681844+bigspider@users.noreply.github.com> Date: Sat, 13 Dec 2025 18:24:29 +0100 Subject: [PATCH] Simplify and cleanup README --- README.md | 126 ++++++++++++++----------------------------------- pyproject.toml | 10 +--- 2 files changed, 37 insertions(+), 99 deletions(-) diff --git a/README.md b/README.md index 2680471..623b0a8 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ ## WIP Python framework for MATT smart contracts -This repository contains a (very much Work In Progress) framework to create and test -smart contracts using the `OP_CHECKCONTRACTVERIFY` opcode of MATT. +This repository contains a (very much Work In Progress) framework to create and test smart contracts using the `OP_CHECKCONTRACTVERIFY` opcode. ## Prerequisites @@ -26,7 +25,7 @@ Install the library with: $ pip install pymatt ``` -### Run bitcoin-inquisition MATT in regtest mode +## Run bitcoin-inquisition MATT in regtest mode The fastest way to get started is [this docker container](https://github.com/Merkleize/docker): @@ -35,6 +34,28 @@ $ docker pull bigspider/bitcoin_matt $ docker run -d -p 18443:18443 bigspider/bitcoin_matt ``` +Alternatively, build the same yourself from [this branch](https://github.com/Merkleize/bitcoin/tree/inq-ccv). Here's the `bitcoin.conf` file used for these examples: + +
+ bitcoin.conf + + ``` + regtest=1 + printtoconsole=1 + server=1 + txindex=1 + fallbackfee=0.00001 + minrelaytxfee=0 + blockmintxfee=0 + + [regtest] + rpcbind=0.0.0.0 + rpcallowip=0.0.0.0/0 + rpcuser=rpcuser + rpcpassword=rpcpass + ``` +
+ ### Case studies The `examples` folder contains some utility scripts to work with regtest bitcoin-core: @@ -57,45 +78,32 @@ More code examples can be found in the test suite. See the [docs](./docs) folder for high-level documentation on how to design smart contracts using MATT. -As the framework is still in development, we recommend looking at the code examples below for -developer documentation on using pymatt. +As the framework is still in development, we recommend looking at the code examples below for developer documentation on using pymatt. ## Contribution ### Prerequisites -* [git](https://git-scm.com/) - --fast-version-control -* [uv](https://docs.astral.sh/uv) - extremely fast Python package & project manager written in Rust - +The examples in this repository can be installed and set up using [uv](https://docs.astral.sh/uv). -The following guide walks through setting up your local working environment using `git` -as distributed version control system and `uv` as Python package and version manager. -If you do not have `git` installed, run the following command. +If you do not have `uv` installed, run one of the following commands.
- Install using Homebrew (Darwin) - + Install using pipx + ```bash - brew install git + pipx install uv ```
- Install via binary installer (Linux) - - * Debian-based package management - ```bash - sudo apt install git-all - ``` + Install using standalone installer (Darwin and Linux) - * Fedora-based package management ```bash - sudo dnf install git-all + curl -LsSf https://astral.sh/uv/install.sh | sh ```
-If you do not have `uv` installed, run the following command. -
Install using Homebrew (Darwin) @@ -104,19 +112,7 @@ If you do not have `uv` installed, run the following command. ```
-
- Install using standalone installer (Darwin and Linux) - - ```bash - curl -LsSf https://astral.sh/uv/install.sh | sh - ``` -
- -Once you have `git` distributed version control system installed, you can -clone the current repository and install any version of Python above version -3.9 for this project. The following commands help you set up and activate a -Python virtual environment where `uv` can download project dependencies from the `PyPI` -open-sourced registry defined under `pyproject.toml` file. +The following commands help you set up and activate a Python virtual environment where `uv` can download project dependencies from the `PyPI` open-sourced registry defined under `pyproject.toml` file.
Set up environment and synchronize project dependencies @@ -153,29 +149,13 @@ If not using the container above, please see an [example of custom bitcoin.conf] to work with the scripts in this repository. You can use the following command to install the extra dependencies required for -running the examples attached. - -
- Install dependencies for `RAM` example - - ```bash - uv sync --dev --extra ram - ``` -
- -
- Install dependencies for `Rps` example - - ```bash - uv sync --dev --extra rps - ``` -
+running the examples in the repository.
- Install dependencies for `Vault` example + Install dependencies for the examples ```bash - uv sync --dev --extra vault + uv sync --dev --extra examples ```
@@ -187,40 +167,6 @@ This project uses `pytest` to run automated tests. Install the dependencies with uv sync --dev ``` -
- Sample installation output for development dependencies - - ```bash - $ uv sync --dev - > Resolved 30 packages in 0.35ms - > Installed 24 packages in 124ms - > + attrs==25.3.0 - > + bokeh==3.1.1 - > + contourpy==1.1.1 - > + iniconfig==2.1.0 - > + jinja2==3.1.6 - > + markupsafe==2.1.5 - > + matt==0.0.1 (from file:///path/to/your/local/workspace/pymatt) - > + networkx==3.1 - > + numpy==1.24.4 - > + packaging==25.0 - > + pandas==2.0.3 - > + pillow==10.4.0 - > + pluggy==1.5.0 - > + py==1.11.0 - > + pytest==6.2.5 - > + python-dateutil==2.9.0.post0 - > + pytz==2025.2 - > + pyyaml==6.0.2 - > + six==1.17.0 - > + toml==0.10.2 - > + tornado==6.4.2 - > + typing-extensions==4.13.2 - > + tzdata==2025.2 - > + xyzservices==2025.4.0 - ``` -
- The test suite requires a running instance of the MATT-enabled bitcoin-inquisition, for example using the container above. The [init.sh](examples/init.sh) script makes sure that a funded test wallet is loaded. diff --git a/pyproject.toml b/pyproject.toml index 1a46c0a..b32c17d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,18 +20,10 @@ version = '0.0.1' [project.optional-dependencies] -ram = [ +examples = [ 'prompt-toolkit >=3.0.31,<3.1', 'python-dotenv ==0.13.0', ] -rps = [ - 'python-dotenv ==0.13.0', -] -vault = [ - 'prompt-toolkit>=3.0.31, <3.1', - 'python-dotenv ==0.13.0', -] - [tool.flake8] max-line-length = 120