Edit readme

This commit is contained in:
Jay Graber 2017-08-02 12:55:24 -07:00
parent 0a36f800a3
commit 2a4f082765
1 changed files with 30 additions and 23 deletions

View File

@ -6,7 +6,7 @@ Bitcoin scripts use python-bitcoinlib, and Zcash scripts use python-zcashlib (a
## Setup
To successfully run this, you'll need python3, the dependencies installed, and a bitcoin and zcash daemon synced on whichever chain you want to trade on.
To successfully run this code, you'll need python3, the dependencies installed, and a bitcoin and zcash daemon synced on whichever chain you want to trade on.
It's recommended that you install python3 in a virtualenv. Run this command from the top level of the directory:
```
@ -14,45 +14,39 @@ virtualenv -p python3 venv
source venv/bin/activate
```
To install this code, clone the repo and install as a python package.
```
git clone https://github.com/zcash/zbxcat.git
pip install zbxcat
```
To install dependencies, run:
```
pip install -r requirements.txt
```
To install python-zcashlib for testing and editing, clone the repository to your local filesystem.
You'll have to clone the repository to install python-zcashlib.
```
git clone https://github.com/arcalinea/python-zcashlib.git
pip install <path to python-zcashlib>
```
# Testing
Run Zcash and Bitcoin daemons locally, on whichever network you want to trade on (recommended: testnet, regtest).
Install modules locally in editable mode through pip, so that you can make changes to the code and they will be applied immediately.
Make sure the rpcuser and rpcpassword values are set in your zcash.conf or bitcoin.conf files.
To use pip to install a package in editable mode, use the `-e` flag to pass in the path on your local filesystem:
`pip install -e <path-to-package-repo>`
## Run Zcash and Bitcoin daemons locally
To test, run a Zcash daemon and bitcoin daemon in regtest mode.
To run a bitcoin daemon in regtest mode, with the ability to inspect transactions outside your wallet (useful for testing purposes), use the command
Example `~/.zcash/zcash.conf` file:
```
bitcoind -regtest -txindex=1 -daemon
rpcuser=user
rpcpassword=password
```
Be sure to run a Zcash daemon in regtest mode as well.
```
zcashd -regtest -txindex=1 --daemon
```
## Walking through a new trade
You can try this on regtest on one computer, or on testnet across two computers.
## Workflow for a new trade
Install our code as a python package in editable mode. Installing relative to the directory containing `setup.py` should work.
`pip install -e <directory that setup.py for xcat is in>`
Since this is beta software that is still under active development, we recommend that you do not trade more than you can afford to lose on mainnet.
### Seller:
@ -99,3 +93,16 @@ Redeems seller p2sh. The secret they need to redeem will be automatically parsed
`xcat checktrade testtrade`
Trade is done! Buyer or seller can check the status again, but it will indicate that it is complete.
# Testing and Development
You can install modules locally in editable mode through pip, so that you can make changes to the code and they will be applied immediately.
To use pip to install a package in editable mode, use the `-e` flag to pass in the path on your local filesystem:
`pip install -e <path-to-package-repo>`
To install our code as a python package in editable mode, passing in the directory containing `setup.py` should work.
`pip install -e <directory that setup.py for xcat is in>`