This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' of github.com:CityOfZion/neo-python into d…
…evelopment
- Loading branch information
Showing
9 changed files
with
194 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Dockerfile to setup neo-python on the master branch. | ||
# https://github.com/CityOfZion/neo-python/tree/master/docker | ||
# | ||
# Building (these commands create a Docker image called neopython): | ||
# | ||
# $ docker build -f Dockerfile -t neopython . | ||
# | ||
# Build without caching: | ||
# | ||
# $ docker build --no-cache -f Dockerfile -t neopython . | ||
# | ||
# At this point there is a Docker image called 'neopython'. If you want to run it connecting | ||
# to a private network, make sure the privatenet container is already running. | ||
# https://hub.docker.com/r/cityofzion/neo-privatenet | ||
# | ||
# Start a container interactively, opening a bash in `/neo-python`, and mounting the current directory as `/neo-python/sc`: | ||
# | ||
# $ docker run --rm -it -v $(pwd):/neo-python/sc --net=host -h neopython --name neopython neopython /bin/bash | ||
# | ||
# Once you are inside the container, you can start neo-python with `python3 prompt.py -p` (using -p to connect to a private net). | ||
# To update neo-python, just run `git pull` and `pip install -e .` | ||
FROM ubuntu:16.04 | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
git-core \ | ||
python3-dev \ | ||
python3-pip \ | ||
libleveldb-dev \ | ||
libssl-dev \ | ||
man | ||
|
||
# APT cleanup to reduce image size | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
# Clone and setup | ||
RUN git clone https://github.com/CityOfZion/neo-python.git | ||
WORKDIR neo-python | ||
RUN pip3 install -e . | ||
|
||
CMD python3 prompt.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Dockerfile to setup neo-python on the development branch. | ||
# https://github.com/CityOfZion/neo-python/tree/master/docker | ||
# | ||
# Building (these commands create a Docker image called neopython-dev): | ||
# | ||
# $ docker build -f Dockerfile.dev -t neopython-dev . | ||
# | ||
# Build without caching: | ||
# | ||
# $ docker build --no-cache -f Dockerfile.dev -t neopython-dev . | ||
# | ||
# At this point there is a Docker image called 'neopython-dev'. If you want to run it connecting | ||
# to a private network, make sure the privatenet container is already running. | ||
# https://hub.docker.com/r/cityofzion/neo-privatenet | ||
# | ||
# Start a container interactively, opening a bash in `/neo-python`, and mounting the current directory as `/neo-python/sc`: | ||
# | ||
# $ docker run --rm -it -v $(pwd):/neo-python/sc --net=host -h neopython-dev --name neopython-dev neopython-dev /bin/bash | ||
# | ||
# Once you are inside the container, you can start neo-python with `python3 prompt.py -p` (using -p to connect to a private net). | ||
# To update neo-python, just run `git pull` and `pip install -e .` | ||
# | ||
FROM ubuntu:16.04 | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
git-core \ | ||
python3-dev \ | ||
python3-pip \ | ||
libleveldb-dev \ | ||
libssl-dev \ | ||
man | ||
|
||
# APT cleanup to reduce image size | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
# Clone and setup | ||
RUN git clone https://github.com/CityOfZion/neo-python.git | ||
WORKDIR neo-python | ||
|
||
RUN git checkout origin/development -b development | ||
RUN git branch -u origin/development | ||
RUN pip3 install -e . | ||
|
||
CMD python3 prompt.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
This directory contains various Docker related utilities. | ||
|
||
* `Dockerfile.master` -- a Dockerfile to build neo-python's master branch | ||
* `Dockerfile.dev` -- a Dockerfile to build neo-python's development branch | ||
* `docker-compose-neoscan.yml` -- a Docker compose file to start a private network and a neoscan container | ||
|
||
--- | ||
|
||
## Simple Docker container for neo-python master and dev branches | ||
|
||
Take a look at the Dockerfiles, they have some documentation and example usage inside. | ||
|
||
Let's use the development branch Dockerfile as example. To build it, use this command: | ||
|
||
$ docker build -f Dockerfile.dev -t neopython-dev . | ||
|
||
Build without caching: | ||
|
||
$ docker build --no-cache -f Dockerfile.dev -t neopython-dev . | ||
|
||
At this point there is a Docker image called 'neopython-dev'. If you want to run it connecting | ||
to a private network, make sure the privatenet container is already running. | ||
https://hub.docker.com/r/cityofzion/neo-privatenet | ||
|
||
Start a container interactively, opening a bash in `/neo-python`, and mounting the current directory as `/neo-python/sc`: | ||
|
||
$ docker run --rm -it -v $(pwd):/neo-python/sc --net=host -h neopython-dev --name neopython-dev neopython-dev /bin/bash | ||
|
||
Once you are inside the container, you can start neo-python with `python3 prompt.py -p` (using -p to connect to a private net). | ||
To update neo-python, just run `git pull` and `pip install -e .` | ||
|
||
|
||
## NeoScan and the private network | ||
|
||
`docker-compose-neoscan.yml` sets you up with 2 Docker containers: one for the private network and one for neoscan connected to it. | ||
The base project and neoscan Dockerfile is currently maintained here: https://github.com/slipo/neo-scan-docker | ||
|
||
You can start the privatenet+neoscan combo with this command: | ||
|
||
$ docker-compose -f docker-compose-neoscan.yml up | ||
|
||
It will take some time to set up. | ||
|
||
While you wait, add this line to your hosts file: | ||
|
||
127.0.0.1 neo-privnet | ||
|
||
That allows you to connect to the privnet NEO nodes with the URLs returned by the neo-scan container. If you're using neo-python to connect to the privnet, you can use the standard configuration. 127.0.0.1:30333 will continue to work, for example. | ||
|
||
OK, if you waited a few minutes, it should be ready. Check: http://localhost:4000/. You should see neo-scan with some blocks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: "3" | ||
services: | ||
neo-scan: | ||
image: slipoh/neo-scan | ||
container_name: "neo-scan" | ||
ports: | ||
- 4000:4000 | ||
links: | ||
- postgresql:postgres | ||
- neo-privnet:20333 | ||
- neo-privnet:20334 | ||
- neo-privnet:20335 | ||
- neo-privnet:20336 | ||
- neo-privnet:30333 | ||
- neo-privnet:30334 | ||
- neo-privnet:30335 | ||
- neo-privnet:30336 | ||
depends_on: | ||
- postgresql | ||
- neo-privnet | ||
postgresql: | ||
image: postgres:10.1 | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
neo-privnet: | ||
image: cityofzion/neo-privatenet | ||
container_name: "neo-privnet" | ||
ports: | ||
- 20333:20333 | ||
- 20334:20334 | ||
- 20335:20335 | ||
- 20336:20336 | ||
- 30333:30333 | ||
- 30334:30334 | ||
- 30335:30335 | ||
- 30336:30336 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters