blockchain/README.md

58 lines
1.1 KiB
Markdown
Raw Normal View History

2017-09-24 21:44:13 +02:00
# Learn Blockchains by Building One
This is the source code for my post on [Building a Blockchain](https://medium.com/p/117428612f46).
## Installation
1. Make sure [Python 3.6+](https://www.python.org/downloads/) is installed.
2. Install [pipenv](https://github.com/kennethreitz/pipenv).
```
$ pip install pipenv
```
3. Create a _virtual environment_ and specify the Python version to use.
```
$ pipenv --python=python3.6
```
4. Install requirements.
```
$ pipenv install
```
5. Run the server:
* `$ pipenv run python blockchain.py`
* `$ pipenv run python blockchain.py -p 5001`
* `$ pipenv run python blockchain.py --port 5002`
2017-10-03 20:01:36 +02:00
## Docker
1. Clone this repository
2. Build the docker container
```
$ docker build -t blockchain .
```
3. Run the container
```
$ docker run --rm -p 80:5000 blockchain
```
4. To add more instances, vary the public port number before the colon:
```
$ docker run --rm -p 81:5000 blockchain
$ docker run --rm -p 82:5000 blockchain
$ docker run --rm -p 83:5000 blockchain
```
2017-09-24 21:44:13 +02:00
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.