mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Docker Boxes For ShyftGeth, BlockExplorer & PG
This commit is contained in:
parent
f29117c193
commit
81a40842f5
7 changed files with 16 additions and 67 deletions
|
|
@ -293,7 +293,7 @@ Run `./shyft-geth.sh` with one of the following flags:
|
|||
|
||||
Docker Images are available for ShyftGeth and the Postgresql Database which can be used for development and testing. To launch these containers you will need to have docker-compose installed on your computer. Installation instructions for docker-compose are available [here](https://docs.docker.com/install/).
|
||||
|
||||
To launch ShyftGeth and PG - issue the following command from the root of the project directory:
|
||||
To launch ShyftGeth, PG, the ShyftBlock Explorer Api and UI - issue the following command from the root of the project directory:
|
||||
|
||||
`docker-compose up`
|
||||
|
||||
|
|
@ -301,12 +301,13 @@ If you would like to reinitialize/rebuild the docker images you can issue the fo
|
|||
|
||||
`docker-compose up --build`
|
||||
|
||||
The Postgresql Database Container will persist the database data to the the pg-data/ directory. So if you do want to reinitialize the database you should delete the content of this directory prior to launching the docker containers. From your local machine you can view the database by connecting to the database in the container at 127.0.0.1:8001
|
||||
The Postgresql Database Container will persist the database data to the the pg-data/ directory. So if you do want to reinitialize the database you should delete the content of this directory prior to launching the docker containers. From your local machine you can view the database by connecting to the database in the container at 127.0.0.1:8001. To access the shyftBlockExplorer open a browser and visit http://localhost:3000
|
||||
|
||||
NB: The Shyft Geth docker image size is 5+ GB so make sure you have adequate space on your disk drive/
|
||||
|
||||
_TODO_
|
||||
|
||||
- Dockerize shyftBlockExplorerAPI
|
||||
- Dockerize shyftBlockExplorerUI
|
||||
- Reduce size of the ShytfGeth docker container which is responsible for mining and running the blockchain
|
||||
- Adjust docker scripts and ports to facilitate sending of test transactions
|
||||
- Modify Docker scripts to facilitate hot reloading during development
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ FROM postgres:10.4-alpine
|
|||
|
||||
# @NOTE:Shyft - need to modify scripts to check db/table existence
|
||||
WORKDIR /
|
||||
COPY ./shyft-cli/postgres_setup/docker_init_user_db.sh /docker-entrypoint-initdb.d/docker_init_user_db.sh
|
||||
COPY ./shyft-cli/postgres_setup/docker_init_user_db.sh /docker-entrypoint-initdb.d/
|
||||
COPY ./shyft-cli/postgres_setup/create_tables.psql /create_tables.psql
|
||||
RUN cd /docker-entrypoint-initdb.d && ls -a
|
||||
VOLUME ["/var/lib/postgresql"]
|
||||
EXPOSE 5432
|
||||
EXPOSE 5432
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ services:
|
|||
- shyftnet
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSGRES_PASSWORD=docker
|
||||
- POSTGRES_PASSWORD=docker
|
||||
shyft_block_api:
|
||||
build:
|
||||
context: $PWD
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
CREATE DATABASE shyftdb
|
||||
CREATE DATABASE shyftdb;
|
||||
|
|
|
|||
|
|
@ -55,4 +55,4 @@ CREATE TABLE IF NOT EXISTS internalTxs (
|
|||
time text,
|
||||
input text,
|
||||
output text
|
||||
)
|
||||
);
|
||||
|
|
@ -2,64 +2,9 @@
|
|||
set -e
|
||||
echo $POSTGRES_USER
|
||||
echo $POSTGRES_DB
|
||||
# createTables="$(cat /create_tables.psql)"
|
||||
# echo $createTables
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
CREATE DATABASE shyftdb;
|
||||
\connect shyftdb;
|
||||
CREATE TABLE IF NOT EXISTS blocks (
|
||||
hash text primary key,
|
||||
coinbase text,
|
||||
gasUsed numeric,
|
||||
gasLimit numeric,
|
||||
txCount numeric,
|
||||
uncleCount numeric,
|
||||
age timestamp,
|
||||
parentHash text,
|
||||
uncleHash text,
|
||||
difficulty bigint,
|
||||
size text,
|
||||
nonce numeric,
|
||||
rewards numeric,
|
||||
number bigint
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS txs (
|
||||
txHash text primary key unique,
|
||||
to_addr text,
|
||||
from_addr text,
|
||||
blockhash text references blocks(hash),
|
||||
blocknumber text,
|
||||
amount numeric,
|
||||
gasprice numeric,
|
||||
gas numeric,
|
||||
gasLimit numeric,
|
||||
txFee numeric,
|
||||
nonce numeric,
|
||||
txStatus text,
|
||||
isContract bool,
|
||||
age timestamp,
|
||||
data bytea
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS accounts (
|
||||
addr text primary key unique,
|
||||
balance numeric,
|
||||
txCountAccount numeric
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS contracts (
|
||||
txHash text
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS internalTxs (
|
||||
id SERIAL PRIMARY KEY,
|
||||
txHash text references txs(txHash),
|
||||
type text,
|
||||
to_addr text,
|
||||
from_addr text,
|
||||
amount text,
|
||||
gas numeric,
|
||||
gasUsed numeric,
|
||||
time text,
|
||||
input text,
|
||||
output text
|
||||
);
|
||||
EOSQL
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -d shyftdb < /create_tables.psql
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
\connect
|
||||
shyftdb;
|
||||
DROP TABLE internalTxs;
|
||||
DROP TABLE txs;
|
||||
DROP TABLE blocks;
|
||||
|
|
|
|||
Loading…
Reference in a new issue