Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/sdediego/blockchain

Blockchain written in Python3
https://github.com/sdediego/blockchain

api asynchronous backend blockchain consensus-algorithm cryptocurrency cryptography fastapi frontend javascript mining peer-to-peer proof-of-work python react transaction transaction-pool wallet websocket-server

Last synced: about 1 month ago
JSON representation

Blockchain written in Python3

Awesome Lists containing this project

README

        

# Blockchain

### Backend

#### Activate virtualenv
Create a virtual environment called blockchain.
Then execute:
```sh
source .virtualenvs/blockchain/bin/activate
```

#### Install dependencies
Make sure that the virtual environment is activated.
From the backend directory:
```sh
pip install -r requirements.txt
```

#### Run tests
Make sure that the virtual environment is activated.
From the backend directory:

To run the complete tests suite execute:
```sh
tox
```

To run a particular test case execute:
```sh
python -m unittest tests...
```

#### Run application
Make sure that the virtual environment is activated.
Start several application instances in localhost.
From the backend directory in different terminals:
```sh
python -m src.bin.www -ap 5000 -pp 6000
python -m src.bin.www -ap 5001 -pp 6001 -n "ws://127.0.0.1:6000"
python -m src.bin.www -ap 5002 -pp 6002 -n "ws://127.0.0.1:6000, ws://127.0.0.1:6001"
```
where
ap = api port
pp = p2p server port
n = already known p2p nodes uris