Cleanup and roadmap

This commit is contained in:
Vivek Teega 2024-06-09 03:52:19 +05:30
parent 76a911542b
commit 81b6cee363
22 changed files with 5 additions and 418 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -1,16 +0,0 @@
# Use a base image
FROM nestybox/ubuntu-focal-systemd-docker
# Install necessary packages
RUN apt update && \
apt install -y wget gnupg2 software-properties-common unzip
# Download deb files
RUN wget https://github.com/ranchimall/blockbook-docker/archive/main.zip && unzip main.zip
RUN cd blockbook-docker-main && sudo apt install -y ./deb-files/dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && sudo apt install -y ./deb-files/dind_blockbook-flo_0.4.0_amd64.deb
# Expose ports
EXPOSE 22 80 9166
# Start your applications (Uncomment and replace with your application start commands)
CMD ["/lib/systemd/systemd"]

View File

@ -1,52 +0,0 @@
# Use a base image
FROM cruizba/ubuntu-dind:latest
# Install necessary packages
RUN apt-get update && \
apt-get install -y wget gnupg2 software-properties-common supervisor make git sudo
# Mount the Docker socket from the host into the container
# VOLUME /var/run/docker.sock:/var/run/docker.sock
# Build app (You can add your application build steps here)
RUN git clone https://github.com/ranchimall/blockbook
# WORKDIR /blockbook
# RUN sudo make all-flo
# Install deb files
# RUN sudo apt install -y ./build/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && \
# sudo apt install -y ./build/blockbook-flo_0.4.0_amd64.deb
# Download deb files
# RUN wget https://github.com/ranchimall/blockbook/releases/download/flo-v0.4.0-ubuntu/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb \
# https://github.com/ranchimall/blockbook/releases/download/flo-v0.4.0-ubuntu/blockbook-flo_0.4.0_amd64.deb
# Create run flo directory
# RUN mkdir -p /run/flo
# # Create a common group (e.g., flo-group) and set permissions
# RUN groupadd flo-group && \
# usermod -aG flo-group flo && \
# usermod -aG flo-group blockbook-flo && \
# chown :flo-group /run/flo && \
# chmod 777 /run/flo
# Setting up supervisor configurations (Uncomment and add your configuration files)
COPY alt-helper.sh /
# COPY blockbook-flo.conf /etc/supervisor/conf.d/
# COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Create log files
# RUN touch /var/log/backend-flo-error.log && \
# touch /var/log/backend-flo.log && \
# touch /var/log/blockbook-flo-error.log && \
# touch /var/log/blockbook-flo.log
# Expose ports
EXPOSE 22 80 9166
# Start supervisord (Uncomment this line)
# CMD ["/usr/bin/supervisord"]
# Start your applications (Uncomment and replace with your application start commands)
CMD ["/usr/bin/bash", "/alt-helper.sh"]

View File

@ -1,55 +0,0 @@
# syntax=docker/dockerfile:1.3-labs
# Use a base image
FROM cruizba/ubuntu-dind:focal-24.0.6
# Install necessary packages
RUN apt update && \
apt install -y wget gnupg2 software-properties-common supervisor sudo unzip
# Mount the Docker socket from the host into the container
# VOLUME /var/run/docker.sock:/var/run/docker.sock
# # Build app (You can add your application build steps here)
# RUN git clone https://github.com/ranchimall/blockbook
# WORKDIR /blockbook
# RUN --security=insecure cd /blockbook && make all-flo
# # Install deb files
# RUN sudo apt install -y ./build/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && \
# sudo apt install -y ./build/blockbook-flo_0.4.0_amd64.deb
# Download deb files
RUN wget https://github.com/ranchimall/blockbook-docker/archive/main.zip && unzip main.zip
RUN cd blockbook-docker-main && sudo apt install -y ./dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && sudo apt install -y ./dind_blockbook-flo_0.4.0_amd64.deb
# Create run flo directory
RUN mkdir -p /run/flo
# # Create a common group (e.g., flo-group) and set permissions
RUN groupadd flo-group && \
usermod -aG flo-group flo && \
usermod -aG flo-group blockbook-flo && \
chown :flo-group /run/flo && \
chmod 777 /run/flo
# Setting up supervisor configurations (Uncomment and add your configuration files)
# COPY alt-helper.sh /
# COPY blockbook-flo.conf /etc/supervisor/conf.d/
# COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Create log files
# RUN touch /var/log/backend-flo-error.log && \
# touch /var/log/backend-flo.log && \
# touch /var/log/blockbook-flo-error.log && \
# touch /var/log/blockbook-flo.log
COPY prebuilt-helper.sh /
# Expose ports
EXPOSE 22 80 9166
# Start supervisord (Uncomment this line)
# CMD ["/usr/bin/supervisord"]
# Start your applications (Uncomment and replace with your application start commands)
CMD ["/usr/bin/bash", "/prebuilt-helper.sh"]

View File

@ -1,16 +0,0 @@
# Use a base image
FROM nestybox/ubuntu-focal-systemd-docker
# Install necessary packages
RUN apt update && \
apt install -y wget gnupg2 software-properties-common unzip
# Download deb files
RUN wget https://github.com/ranchimall/blockbook-docker/archive/main.zip && unzip main.zip
RUN cd blockbook-docker-main && sudo apt install -y ./deb-files/backend-flo-testnet_0.15.1.1-satoshilabs-1_amd64.deb && sudo apt install -y ./deb-files/blockbook-flo-testnet_0.4.0_amd64.deb
# Expose ports
EXPOSE 22 80 19166
# Start your applications (Uncomment and replace with your application start commands)
CMD ["/lib/systemd/systemd"]

View File

@ -1,35 +1,9 @@
# Blockbook docker
## Pre-requisites
Should have [sysbox installed on your machine](https://github.com/nestybox/sysbox/blob/master/docs/developers-guide/build.md)
## Roadmap for upgrade
## Main commands
```
sudo docker run -d --runtime=sysbox-runc -P -p <hostport>:9166 --name blockbook ranchimallfze/blockbook:1.0.0
```
[ ] - Create separate images for both backend and blockbook.
[ ] - Attach the same volume to both the running containers of the images.
[ ] - Think of how Blockbook container will detect the spots of backend container
[ ] - See if creating a new network for both the containers will be a good option.
## Testing
The code and steps required to run Docker version of Blockbook block explorer
```
sudo docker build -t blockbook-althelper -f Dockerfile-althelper .
sudo docker run -d --privileged -p 9166:9166 d5e56e218acd
```
```
docker buildx create --driver-opt image=moby/buildkit:master --use --name insecure-builder --buildkitd-flags '--allow-insecure-entitlement security.insecure'
docker buildx use insecure-builder
docker buildx build --allow security.insecure ...(other build args)...
sudo docker buildx build --allow security.insecure -t blockbook .
docker buildx rm insecure-builder
sudo docker run -v /var/run/docker.sock:/var/run/docker.sock -ti ubuntu:20.04
```
```
sudo docker run -d --runtime=sysbox-runc -P -p 9167:9166 5018bee64419
sudo docker run -d --runtime=sysbox-runc --net=host -P 5018bee64419
```

View File

@ -1,28 +0,0 @@
cd /blockbook && sudo make all-flo
#1. Install deb files
cd /blockbook/build && sudo apt install -y ./backend-flo_0.15.1.1-satoshilabs-1_amd64.deb
cd /blockbook/build && sudo apt install -y ./blockbook-flo_0.4.0_amd64.deb
#2. create run flo dir
mkdir -p /run/flo
#3. create a group and add flo and blockbook-flo & set permission for dir
# Create a common group (e.g., flo-group)
groupadd flo-group
# Add users to the common group
usermod -aG flo-group flo
usermod -aG flo-group blockbook-flo
# Set the common group ownership on the directory
chown :flo-group /run/flo
# Give the group read-write permissions on the directory
chmod 777 /run/flo
# 4. run main commands as user
su -s /bin/bash -c "/opt/coins/nodes/flo/bin/flod -datadir=/opt/coins/data/flo/backend -conf=/opt/coins/nodes/flo/flo.conf -pid=/run/flo/flo.pid" flo
su -s /bin/bash -c "cd /opt/coins/blockbook/flo && /opt/coins/blockbook/flo/bin/blockbook -blockchaincfg=/opt/coins/blockbook/flo/config/blockchaincfg.json -datadir=/opt/coins/data/flo/blockbook/db -sync -internal=:9066 -public=:9166 -certfile=/opt/coins/blockbook/flo/cert/blockbook -explorer= -log_dir=/opt/coins/blockbook/flo/logs -dbcache=1073741824" blockbook-flo

View File

@ -1,8 +0,0 @@
[program:backend-flo]
command=/opt/coins/nodes/flo/bin/flod -datadir=/opt/coins/data/flo/backend -conf=/opt/coins/nodes/flo/flo.conf -pid=/run/flo/flo.pid
user=flo
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/backend-flo.log
stderr_logfile=/var/log/backend-flo-error.log

View File

@ -1,8 +0,0 @@
[program:blockbook-flo]
command=/opt/coins/blockbook/flo/bin/blockbook -blockchaincfg=/opt/coins/blockbook/flo/config/blockchaincfg.json -datadir=/opt/coins/data/flo/blockbook/db -sync -internal=:9066 -public=:9166 -certfile=/opt/coins/blockbook/flo/cert/blockbook -explorer= -log_dir=/opt/coins/blockbook/flo/logs -dbcache=1073741824
user=root
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/blockbook-flo.log
stderr_logfile=/var/log/blockbook-flo-error.log

View File

@ -1,35 +0,0 @@
# Install make and git
apt install -y make git sudo
wget https://github.com/ranchimall/blockbook/releases/download/flo-v0.4.0-ubuntu/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb
wget https://github.com/ranchimall/blockbook/releases/download/flo-v0.4.0-ubuntu/blockbook-flo_0.4.0_amd64.deb
#1. Install deb files
apt install sudo
sudo apt install -y /opt/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb
sudo apt install -y /opt/blockbook-flo_0.4.0_amd64.deb
#2. create run flo dir
mkdir -p /run/flo
#3. create a group and add flo and blockbook-flo & set permission for dir
# Create a common group (e.g., flo-group)
groupadd flo-group
# Add users to the common group
usermod -aG flo-group flo
usermod -aG flo-group blockbook-flo
# Set the common group ownership on the directory
chown :flo-group /run/flo
# Give the group read-write permissions on the directory
chmod 777 /run/flo
# 4. run main commands as user
# su -s /bin/bash -c "/opt/coins/nodes/flo/bin/flod -datadir=/opt/coins/data/flo/backend -conf=/opt/coins/nodes/flo/flo.conf -pid=/run/flo/flo.pid" flo
# su -s /bin/bash -c "/opt/coins/blockbook/flo/bin/blockbook -blockchaincfg=/opt/coins/blockbook/flo/config/blockchaincfg.json -datadir=/opt/coins/data/flo/blockbook/db -sync -internal=:9066 -public=:9166 -certfile=/opt/coins/blockbook/flo/cert/blockbook -explorer= -log_dir=/opt/coins/blockbook/flo/logs -dbcache=1073741824" blockbook-flo

View File

@ -1,50 +0,0 @@
# Use the official Ubuntu 22.04 as the base image
FROM ubuntu:22.04
# Set the DEBIAN_FRONTEND environment variable to noninteractive to avoid prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Update the package list and clean up the apt cache to reduce image size
RUN apt-get update && \
#apt-get install -y supervisor && \
rm -rf /var/lib/apt/lists/*
# Copy the .deb package for backend-flo into the container
COPY dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb /tmp/backend-flo.deb
# Update the package list, install the .deb package, and remove the .deb file to reduce image size
RUN apt-get update && \
apt-get install -y /tmp/backend-flo.deb && \
rm /tmp/backend-flo.deb
# Expose the RPC port for the backend
EXPOSE 8066
# Copy the .deb package for blockbook-flo into the container
COPY dind_blockbook-flo_0.4.0_amd64.deb /tmp/blockbook-flo.deb
# Update the package list, install the .deb package, and remove the .deb file to reduce image size
RUN apt-get update && \
apt-get install -y /tmp/blockbook-flo.deb && \
rm /tmp/blockbook-flo.deb
# Expose ports for the frontend
EXPOSE 9166
EXPOSE 9066
# Copy supervisor configuration
#COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Declare volumes for persistence
VOLUME /
# Start the service and keep the container running by tailing the log file
CMD /bin/bash -c "/opt/coins/nodes/flo/bin/flod -datadir=/opt/coins/data/flo/backend -conf=/opt/coins/nodes/flo/flo.conf -pid=/run/flo/flo.pid && tail -f /opt/coins/data/flo/backend/debug.log && /opt/coins/blockbook/flo/bin/blockbook -blockchaincfg=/opt/coins/blockbook/flo/config/blockchaincfg.json -datadir=/opt/coins/data/flo/blockbook/db -sync -internal=:9066 -public=:9166 -certfile=/opt/coins/blockbook/flo/cert/blockbook -explorer= -log_dir=/opt/coins/blockbook/flo/logs -dbcache=1073741824"
# Start supervisor
#CMD ["/usr/bin/supervisord"]
# check logs of the services
# tail -f /opt/coins/data/flo/backend/debug.log
# tail -f /opt/coins/blockbook/flo/logs/blockbook.INFO

View File

@ -1,24 +0,0 @@
# Use the official Ubuntu 22.04 as the base image
FROM ubuntu:22.04
# Set the DEBIAN_FRONTEND environment variable to noninteractive to avoid prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Update the package list and clean up the apt cache to reduce image size
RUN apt-get update && \
rm -rf /var/lib/apt/lists/*
# Copy the .deb package for backend-flo into the container
COPY dind_backend-flo_0.15.1.1-satoshilabs-1_amd64.deb /tmp/backend-flo.deb
# Update the package list, install the .deb package, and remove the .deb file to reduce image size
RUN apt-get update && \
apt-get install -y /tmp/backend-flo.deb && \
rm /tmp/backend-flo.deb
# Expose the RPC port for the backend
EXPOSE 8066
# Start the service and keep the container running by tailing the log file
CMD ["/bin/bash", "-c", "/opt/coins/nodes/flo/bin/flod -datadir=/opt/coins/data/flo/backend -conf=/opt/coins/nodes/flo/flo.conf -pid=/run/flo/flo.pid & tail -f /opt/coins/data/flo/backend/debug.log"]

View File

@ -1,26 +0,0 @@
# Use the official Ubuntu 22.04 as the base image
FROM ubuntu:22.04
# Set the DEBIAN_FRONTEND environment variable to noninteractive to avoid prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Update the package list and clean up the apt cache to reduce image size
RUN apt-get update && \
rm -rf /var/lib/apt/lists/*
# Copy the .deb package for blockbook-flo into the container
COPY dind_blockbook-flo_0.4.0_amd64.deb /tmp/blockbook-flo.deb
# Update the package list, install the .deb package, and remove the .deb file to reduce image size
RUN apt-get update && \
apt-get install -y /tmp/blockbook-flo.deb && \
rm /tmp/blockbook-flo.deb
# Expose ports for the frontend
EXPOSE 9166
EXPOSE 9066
# Start the service and keep the container running by tailing the log file
CMD ["/bin/bash", "-c", "/opt/coins/blockbook/flo/bin/blockbook -blockchaincfg=/opt/coins/blockbook/flo/config/blockchaincfg.json -datadir=/opt/coins/data/flo/blockbook/db -sync -internal=:9066 -public=:9166 -certfile=/opt/coins/blockbook/flo/cert/blockbook -explorer= -log_dir=/opt/coins/blockbook/flo/logs -dbcache=1073741824 & tail -f /opt/coins/blockbook/flo/logs/blockbook.INFO"]

View File

@ -1,31 +0,0 @@
version: '3.8'
services:
backend:
build:
context: .
dockerfile: Dockerfile.backend
ports:
- "8066:8066"
networks:
- app-network
frontend:
build:
context: .
dockerfile: Dockerfile.blockbook
ports:
- "9166:9166"
- "9066:9066"
depends_on:
- backend
environment:
- BACKEND_HOST=backend
- BACKEND_PORT=8066
networks:
- app-network
networks:
app-network:
driver: bridge

View File

@ -1,19 +0,0 @@
[supervisord]
nodaemon=true
user=root
[program:flod]
command=/opt/coins/nodes/flo/bin/flod -datadir=/opt/coins/data/flo/backend -conf=/opt/coins/nodes/flo/flo.conf -pid=/run/flo/flo.pid
user=flo
autostart=false
autorestart=false
redirect_stderr=true
stdout_logfile=/var/log/backend-flo.log
stderr_logfile=/var/log/backend-flo-error.log
[program:blockbook]
command=/opt/coins/blockbook/flo/bin/blockbook -blockchaincfg=/opt/coins/blockbook/flo/config/blockchaincfg.json -datadir=/opt/coins/data/flo/blockbook/db -sync -internal=:9066 -public=:9166 -certfile=/opt/coins/blockbook/flo/cert/blockbook -explorer= -log_dir=/opt/coins/blockbook/flo/logs -dbcache=1073741824
autostart=true
autorestart=true
stdout_logfile=/var/log/blockbook-flo.log
stderr_logfile=/var/log/blockbook-flo-error.log

View File

@ -1,3 +0,0 @@
sudo systemctl start backend-flo.service
sudo systemctl start blockbook-flo.service

View File

@ -1,3 +0,0 @@
su -s /bin/bash -c "/opt/coins/nodes/flo/bin/flod -datadir=/opt/coins/data/flo/backend -conf=/opt/coins/nodes/flo/flo.conf -pid=/run/flo/flo.pid" flo
su -s /bin/bash -c "cd /opt/coins/blockbook/flo && /opt/coins/blockbook/flo/bin/blockbook -blockchaincfg=/opt/coins/blockbook/flo/config/blockchaincfg.json -datadir=/opt/coins/data/flo/blockbook/db -sync -internal=:9066 -public=:9166 -certfile=/opt/coins/blockbook/flo/cert/blockbook -explorer= -log_dir=/opt/coins/blockbook/flo/logs -dbcache=1073741824" blockbook-flo

View File

@ -1,13 +0,0 @@
[supervisord]
nodaemon=true
user=root
[program:backend-flo]
command=/opt/coins/nodes/flo/bin/flod -datadir=/opt/coins/data/flo/backend -conf=/opt/coins/nodes/flo/flo.conf -pid=/run/flo/flo.pid
user=flo
autostart=false
autorestart=false
redirect_stderr=true
stdout_logfile=/var/log/backend-flo.log
stderr_logfile=/var/log/backend-flo-error.log