This commit is contained in:
callebtc
2022-09-19 00:35:26 +03:00
parent afce11686c
commit 895a0582a1

View File

@@ -6,9 +6,20 @@
Cashu is an Ecash implementation based on David Wagner's variant of Chaumian blinding. Token logic based on [minicash](https://github.com/phyro/minicash) ([description](https://gist.github.com/phyro/935badc682057f418842c72961cf096c)) which implements a [Blind Diffie-Hellman Key Exchange](https://cypherpunks.venona.com/date/1996/03/msg01848.html) scheme written down by Ruben Somsen [here](https://gist.github.com/RubenSomsen/be7a4760dd4596d06963d67baf140406). The database mechanics and the Lightning backend uses parts from [LNbits](https://github.com/lnbits/lnbits-legend).
## Install
### Prerequisites
## Easy Install
The easiest way to use Cashu is to install the package it via pip:
```bash
pip install cashu
```
To update Cashu, use `pip install cashu -U`. You can skip the entire next section about Poetry and jump right to [Using Cashu](#using-cashu).
### Hard install: Poetry
These steps help you install Python via pyenv and Poetry. If you already have Poetry running on your computer, you can skip this step and jump right to [Install Cashu](#install-cashu).
#### Poetry: Prerequisites
```bash
sudo apt install -y build-essential pkg-config libffi-dev libpq-dev zlib1g-dev libssl-dev python3-dev
# on mac: brew install postgres
@@ -27,7 +38,7 @@ curl -sSL https://install.python-poetry.org | python3 -
echo export PATH=\"$HOME/.local/bin:$PATH\" >> ~/.bashrc
source ~/.bashrc
```
### Install Cashu
#### Poetry: Install Cashu
```bash
# install cashu
git clone https://github.com/callebtc/cashu.git
@@ -36,13 +47,21 @@ pyenv local 3.9.13
poetry install
```
#### Update Cashu
#### Poetry: Update Cashu
To update Cashu to the newest version enter
```bash
git pull && poetry install
```
#### Poetry: Using Cashu
### Configuration
Cashu should be now installed. To execute the following commands, activate your virtual Poetry environment via
```bash
poetry shell
```
If you don't activate your environment, just prepent `poetry run` to all following commands.
## Configuration
```bash
mv .env.example .env
# edit .env file
@@ -63,16 +82,6 @@ MINT_PORT=3338
# Using Cashu
Cashu should be now installed. To execute the following commands, activate your virtual Poetry environment via
```bash
poetry shell
```
If you don't activate your environment, just prepent `poetry run` to all following commands.
## Using the wallet
#### Request a mint
This command will return a Lightning invoice and a payment hash. You have to pay the invoice before you can receive the tokens. Note: Minting tokens involves two steps: requesting a mint, and actually minting tokens (see below).