blockchain/README.md

66 lines
1.8 KiB
Markdown
Raw Normal View History

2017-09-24 21:44:13 +02:00
# Learn Blockchains by Building One
2017-11-12 22:35:26 +01:00
[![Build Status](https://travis-ci.org/dvf/blockchain.svg?branch=master)](https://travis-ci.org/dvf/blockchain)
2017-09-24 21:44:13 +02:00
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
```
2018-10-13 19:17:05 +02:00
3. Install requirements
```
$ pipenv install
```
2018-10-13 19:17:05 +02:00
4. 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
2017-10-04 13:59:43 +02:00
Another option for running this blockchain program is to use Docker. Follow the instructions below to create a local Docker container:
2017-10-03 20:01:36 +02:00
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
2017-11-29 01:02:08 +01:00
## Installation (C# Implementation)
1. Install a free copy of Visual Studio IDE (Community Edition):
https://www.visualstudio.com/vs/
2. Once installed, open the solution file (BlockChain.sln) using the File > Open > Project/Solution menu options within Visual Studio.
3. From within the "Solution Explorer", right click the BlockChain.Console project and select the "Set As Startup Project" option.
4. Click the "Start" button, or hit F5 to run. The program executes in a console window, and is controlled via HTTP with the same commands as the Python version.
2017-09-24 21:44:13 +02:00
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.