[go: nahoru, domu]

Skip to content

Commit

Permalink
Site updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
farscapian committed Mar 27, 2020
1 parent f201e59 commit ef56dff
Show file tree
Hide file tree
Showing 227 changed files with 52,352 additions and 202 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Here are some of the development goals for Bitcoin Cache Machine:

## What is needed to Run Bitcoin Cache Machine

If you can run Ubuntu 18.04, you can run BCM. BCM is deployed as a data-center back-end, so you'll want to deploy BCM to a computer with reliable power and internet connections. Some of the services deployed on BCM require contant Internet connectivity (e.g., market maker functionality for Bisq and JoinMarket, transaction relay for Lightning node). You can run BCM data-center workloads directly on your Ubuntu installation (best performance) or it can run in a hardware-based VM (useful if you're running multiple BCM instances [e.g., family members] on shared hardware). User-facing GUI applications such as Electrum Wallet run within the context of docker which is automatically installed via snap.
If you can run Ubuntu, you can run BCM. BCM is deployed as a data-center back-end, so you'll want to deploy BCM to a computer with reliable power and internet connections. Some of the services deployed on BCM require contant Internet connectivity (e.g., market maker functionality for Bisq and JoinMarket, transaction relay for Lightning node). You can run BCM data-center workloads directly on your Ubuntu installation (best performance) or it can run in a hardware-based VM (useful if you're running multiple BCM instances [e.g., family members] on shared hardware). User-facing GUI applications such as Electrum Wallet run within the context of docker which is automatically installed via snap.

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions commands/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The BCM CLI can provision a cluster running on your localhost. This cluster can

If your localhost (e.g., SDN Controller) supports hardware virtualization and you choose to deploy a `vm`, [multipass](https://github.com/CanonicalLtd/multipass) will be installed locally and BCM data-center components will be deployed to that. If your hardware doesn't support virtualization, BCM can still be installed using directly to your Ubuntu OS. VM is a good choice if you're just testing or developing BCM applications. You won't achieve any kind of local HA when deploying BCM in VMs (since the VMs run on the same hardware), however. For that, you MUST install BCM to the native OS via 'local' or 'ssh' deployment methods. Since 'local' and 'ssh' avoid hardware virtualization, they are generally more performant.

The only assumptions that BCM makes is that each machine is running a fresh installation of Ubuntu 18.04 (Desktop or Server) and has SSH exposed on port 22 (for remote machines). Each remote machine you provision MUST be DNS-resolvable by your SDN controller, or be accessible as a TOR (v3) onion service for the management plane (i.e., SSH, LXD). The [server prep script](./server_prep.sh) helps you prepare a new server so you can remotely access it using TOR.
The only assumptions that BCM makes is that each machine is running a fresh installation of Ubuntu (Desktop or Server) and has SSH exposed on port 22 (for remote machines). Each remote machine you provision MUST be DNS-resolvable by your SDN controller, or be accessible as a TOR (v3) onion service for the management plane (i.e., SSH, LXD). The [server prep script](./server_prep.sh) helps you prepare a new server so you can remotely access it using TOR.

Clusters are created and destroyed using the `bcm cluster create` and `bcm cluster destroy` commands, respectively. Add the `--help` flag to determine how best to use `bcm cluster` commands. Most users won't need to use these commands directly as they are automatically invoked when users start user-facing application using `bcm stack start` commands.

Expand All @@ -27,7 +27,7 @@ Cluster mode is when you run BCM data center workloads on more than one LXD inst

# How to prepare a physical server for BCM workloads

If you want to run BCM on one or more dedicated server machines (e.g., an old NUC on your home network), you must first prepare it. It is recommended that you install a fresh copy of Ubuntu 18.04 Server on these machines using the instructions below. You will need Ubuntu 18.04 Server [installed on a USB thumb drive](https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0). Ensure the drive is first plugged into the computer. Also ensure the computer is plugged into a functional network.
If you want to run BCM on one or more dedicated server machines (e.g., an old NUC on your home network), you must first prepare it. It is recommended that you install a fresh copy of Ubuntu Server on these machines using the instructions below. You will need Ubuntu Server [installed on a USB thumb drive](https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0). Ensure the drive is first plugged into the computer. Also ensure the computer is plugged into a functional network.

1. Boot to the USB medium. You may have to enter the BIOS to select a boot device, or press an F-key (e.g., F2, F8, F11) at boot to ensure the device boots from the USB thumb drive.
2. Press enter to accept the defaults regarding keyboard layout (US English).
Expand Down
69 changes: 0 additions & 69 deletions commands/web/build-site.sh

This file was deleted.

118 changes: 0 additions & 118 deletions commands/web/entrypoint.sh

This file was deleted.

1 change: 0 additions & 1 deletion commands/web/help.txt

This file was deleted.

3 changes: 2 additions & 1 deletion project/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@


# purpose of this script is to call the scripts that are necessary to deploy BCM
# we start bottom up and terminate each script upon service activation.
# we start bottom up (i.e., LXC image, LXC containers, docker images, docker containers, etc)
# and terminate each script upon service activation.

set -Eeuo pipefail
cd "$(dirname "$0")"
Expand Down
13 changes: 11 additions & 2 deletions project/tiers/manager/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
ARG BASE_IMAGE

FROM ${BASE_IMAGE}

RUN apt-get update \
&& apt-get install -y wait-for-it git iproute2 curl dnsutils wait-for-it iputils-ping iproute2 duplicity ca-certificates net-tools \
&& apt-get install -y \
wait-for-it \
apt-transport-https \
git \
iproute2 \
curl \
dnsutils \
iputils-ping \
iproute2 \
ca-certificates \
net-tools \
&& rm -rf /var/lib/apt/lists/*
13 changes: 5 additions & 8 deletions stacks/toronion/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ ARG BASE_IMAGE

FROM ${BASE_IMAGE}

#ENV DEBIAN_FRONTEND=noninteractive
# TODO implement method https://2019.www.torproject.org/docs/debian.html.en to
# to apt as tor.
ENV DEBIAN_FRONTEND=noninteractive

# get the codename, usually bionic or debian
ENV CODE_NAME="$(< /etc/os-release grep VERSION_CODENAME | cut -d "=" -f 2)"

RUN echo "deb https://deb.torproject.org/torproject.org $CODE_NAME main" >> /etc/apt/sources.list
RUN echo "deb-src https://deb.torproject.org/torproject.org $CODE_NAME main" >> /etc/apt/sources.list
RUN echo "deb https://mirror.netcologne.de/torproject.org bionic main" >> /etc/apt/sources.list
RUN echo "deb-src https://mirror.netcologne.de/torproject.org bionic main" >> /etc/apt/sources.list

COPY ./TOR-project-PGP.pub tor.pgp.pub
RUN gpg --import tor.pgp.pub
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
RUN gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -

RUN apt-get update
RUN apt-get install -y apt-transport-https
RUN apt-get install -y tor deb.torproject.org-keyring

# SOCKS5, Control Port, DNS
Expand Down
Empty file removed uninstall.sh
Empty file.
33 changes: 33 additions & 0 deletions website/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM alpine:3.11

#Base settings
ENV HOME /root

COPY requirements.txt /root/requirements.txt

#Install ZeroNet
RUN apk --update --no-cache --no-progress add python3 python3-dev gcc libffi-dev musl-dev make tor openssl \
&& pip3 install -r /root/requirements.txt \
&& apk del python3-dev gcc libffi-dev musl-dev make \
&& echo "ControlPort 9051" >> /etc/tor/torrc \
&& echo "CookieAuthentication 1" >> /etc/tor/torrc

RUN python3 -V \
&& python3 -m pip list \
&& tor --version \
&& openssl version

#Add Zeronet source
COPY . /root
VOLUME /root/data

#Control if Tor proxy is started
ENV ENABLE_TOR false

WORKDIR /root

#Set upstart command
CMD (! ${ENABLE_TOR} || tor&) && python3 zeronet.py --ui_ip 0.0.0.0 --fileserver_port 26552

#Expose ports
EXPOSE 43110 26552
23 changes: 23 additions & 0 deletions website/build_site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -Eeuox pipefail
cd "$(dirname "$0")"

source ./env

# this stores cached jekyll data that is pulled from the
# internet the first time an image is created.
if ! docker volume list | grep -q "$BUILDCACHE_DOCKERVOL"; then
docker volume create "$BUILDCACHE_DOCKERVOL"
fi

if docker image list | grep -q "$BCM_DOCKER_BASE_TAG"; then
docker image pull "$BCM_DOCKER_BASE_TAG"
fi

docker tag "$BCM_DOCKER_BASE_TAG" "jekyll:$SITE_NAME"

docker run --rm -it \
-v "$BUILDCACHE_DOCKERVOL":/usr/local/bundle \
-v "$SITE_PATH:/srv/jekyll" \
"jekyll:$SITE_NAME" jekyll build --trace
9 changes: 9 additions & 0 deletions website/env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

export SITE_NAME="bcmweb"
export SITE_PATH="$(pwd)/jekyll_site"
export NGINX_IMAGE="nginx:latest"
export BUILDCACHE_DOCKERVOL="$SITE_NAME-buildcache"
export BCM_DOCKER_BASE_TAG="jekyll/jekyll"
export DOMAIN_NAME="127.0.0.1"
export EXTERNAL_PORT="28953"
export SERVICE_ENDPOINT="$DOMAIN_NAME:$EXTERNAL_PORT"
24 changes: 24 additions & 0 deletions website/jekyll_site/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
1 change: 1 addition & 0 deletions website/jekyll_site/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
www.bitcoincachemachine.org
14 changes: 14 additions & 0 deletions website/jekyll_site/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins

# source "https://rubygems.org"

# # bundle exec jekyll serve

# # If you have any plugins, put them here!
# group :jekyll_plugins do
# gem "jekyll-feed", "~> 0.6"
# end

# gem "github-pages", group: :jekyll_plugins
# gem 'nokogiri', '~> 1.10', '>= 1.10.1'
Loading

0 comments on commit ef56dff

Please sign in to comment.