Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector base #1

Open
wants to merge 16 commits into
base: vector-node
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .theia/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"galileo.logo": "https://cryptologos.cc/logos/ethereum-eth-logo.svg?v=010",
"galileo.title": "Connext Vector Node",
"galileo.description": "Say Hello to a Multichain Ethereum",
"galileo.widget_label": "Vector Node Portal",
"galileo.social_links": [
{
"icon": {
"prefix": "fab",
"name": "twitter"
},
"href": "https://twitter.com/connextnetwork",
"priority": 0
},
{
"icon": {
"prefix": "fab",
"name": "github"
},
"href": "https://github.com/connext",
"priority": 1
}
],
"galileo.ui_components": [
{
"type": "custom",
"title": "Getting Started",
"content": [
{
"title": "🏡 Connext Home Page",
"href": "https://algorand.com/",
"priority": 0
},
{
"title": "🤓 Developer Resources",
"href": "https://docs.connext.network/",
"priority": 2
},
{
"title": "💸 Liquidity Guide",
"href": "https://developer.algorand.org/docs/run-a-node/setup/types/",
"priority": 3
}
]
},
{
"type": "custom",
"title": "Help",
"content": [
{
"title": "🤔 Connext Chat",
"href": "https://discord.com/invite/VcNFQdKuxM",
"priority": 0
},
{
"title": "🌎 Connext FAQ",
"href": "https://docs.connext.network/faq",
"priority": 1
}
]
},
{
"type": "custom",
"title": "Galileo APIs",
"content": [
{
"title": "🏃‍♂️ Relay API",
"href": "/relay/",
"priority": 0
},
{
"title": "☁ Rest API",
"href": "/restapi/",
"priority": 1
},
{
"title": "📊 Node Metrics",
"href": "/restapi/metrics",
"priority": 2
},
{
"title": "🐛 Teal Debugger",
"href": "/tealdbg/",
"priority": 2
}
]
}
],
"workbench.colorTheme": "Galileo Dark"
}
48 changes: 48 additions & 0 deletions .theia/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"tasks": [
{
"id": "start-algorand-node",
"label": "Start Relay Node",
"description": "Start the Algorand Relay node in the backgournd.",
"type": "shell",
"command": "/home/galileo/goal node start",
"icon": {
"prefix": "far",
"name": "play-circle"
}
},
{
"id": "stop-algorand-node",
"label": "Stop Relay Node",
"description": "Stop the Algorand Relay node.",
"type": "shell",
"command": "/home/galileo/goal node stop",
"icon": {
"prefix": "far",
"name": "stop-circle"
}
},
{
"id": "algorand-node-status",
"label": "Get Node Status",
"description": "Check on the status of your Algorand node.",
"type": "shell",
"command": "/home/galileo/goal node status",
"icon": {
"prefix": "fas",
"name": "info-circle"
}
},
{
"id": "algorand-node-update",
"label": "Upgrade Node",
"description": "Check for upgrades and apply them if necessary.",
"type": "shell",
"command": "bash /home/galileo/update.sh -d /home/galileo/data",
"icon": {
"prefix": "fas",
"name": "sync"
}
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"json.schemas": [
{
"fileMatch": [
"/.theia/settings.json"
],
"url": "./widget-config.schema.json"
}
]

}
24 changes: 24 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
:8888 {
log
root * /home/galileo
redir / /ui/

handle_path /ui/* {
reverse_proxy http://localhost:3000
import /tmp/hashpass.txt
}

handle_path /relay/* {
reverse_proxy http://localhost:4161
}

handle_path /restapi/* {
reverse_proxy http://localhost:8080
}

handle_path /tealdbg/* {
reverse_proxy http://localhost:9392
import /tmp/hashpass.txt
}

}
90 changes: 90 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# get the caddy executable
FROM caddy AS caddy-build

FROM connextproject/vector_router:0.2.5-beta.18 as router-layer

FROM connextproject/vector_node:0.2.5-beta.18 as ide-build

RUN apk update && \
apk add git openssh bash python3 python3-dev py-pip make gcc g++ libx11-dev libxkbfile-dev supervisor && \
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && \
apk add nodejs npm

# create a build directory for the IDE
RUN mkdir /theia
WORKDIR /theia

# build the IDE
COPY package.json .
COPY preload.html .
RUN yarn --pure-lockfile && \
NODE_OPTIONS="--max_old_space_size=4096" yarn theia build && \
yarn theia download:plugins && \
yarn --production && \
yarn autoclean --init && \
echo *.ts >> .yarnclean && \
echo *.ts.map >> .yarnclean && \
echo *.spec.* >> .yarnclean && \
yarn autoclean --force && \
yarn cache clean

# Final build stage
# FROM connextproject/vector-node:0.2.5-beta.18 as final
FROM connextproject/vector_node:0.2.5-beta.18

RUN apk update && \
apk add git zip unzip openssh bash python3 python3-dev py-pip make gcc g++ libx11-dev libxkbfile-dev supervisor && \
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && \
apk add nodejs npm && \
curl https://rclone.org/install.sh | bash

# add galileo non-root user
RUN adduser -S galileo
COPY .theia /home/galileo/.theia
COPY .vscode /home/galileo/.vscode
RUN chmod a+rwx /home/galileo/.theia
RUN chmod a+rwx /app

# edit the node configuration file for operating as a relay node
RUN mkdir /theia
WORKDIR /theia

# switch to non-root user
#USER galileo
WORKDIR /theia

# get the IDE
COPY --from=ide-build /theia /theia
COPY --from=router-layer /app /router/app

# get superviserd
COPY supervisord.conf /etc/
# copy node.config
COPY node.config.json /app/config.json
# copy router.config
COPY router.config.json /router/app/config.json

# set environment variable to look for plugins in the correct directory
# set environment variable to look for plugins in the correct directory
ENV SHELL=/bin/bash \
THEIA_DEFAULT_PLUGINS=local-dir:/theia/plugins
ENV USE_LOCAL_GIT true

# get the Caddy server executable
# copy the caddy server build into this container
COPY --from=caddy-build /usr/bin/caddy /usr/bin/caddy
COPY Caddyfile /etc/

# Vector environment variables
RUN mkdir /database
ENV VECTOR_PROD true
ENV VECTOR_SQLITE_FILE "/database/store.db"

# # set login credintials and write them to text file
ENV USERNAME "a"
ENV PASSWORD "a"
RUN echo "basicauth /* {" >> /tmp/hashpass.txt && \
echo " {env.USERNAME}" $(caddy hash-password -plaintext $(echo $PASSWORD)) >> /tmp/hashpass.txt && \
echo "}" >> /tmp/hashpass.txt

ENTRYPOINT ["sh", "-c", "supervisord"]
48 changes: 31 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
<p align="center">
<img src="https://github.com/GoHypernet/Galileo-Mission-Frameworks/blob/master/galileo_pres.png" width="500">
<img src="https://github.com/GoHypernet/Galileo-Mission-Frameworks/blob/connext/connext_logo.png" width="200">
</p>

# Galileo Mission Framework Types
This repository contains [Dockerfiles](https://docs.docker.com/engine/reference/builder/) and associated data to
build frameworks supported by the [Galileo](https://hypernetlabs.io/galileo/) platform. Each branch is named after
the target application and contains information on the target audience of the application, how it is built, and how
it is intended to be executed.

## Framework Guidelines
A well defined containerized framework should adhere to the following pattern:
1. The default user is non-root user named galileo with uid 1000
2. The default working directory is /home/galileo for linux and C:\Users\Public\ for windows (or a subdirectory of these paths)
3. The framework must not require special kernel priviledges (i.e. the container should run with the flag [--cap-drop all](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) enabled)
4. The framework should be architecture-agnostic and should detect the architecture available to it and adapt accordingly (i.e. multi-core or GPU acceleration)
5. The framework author should contruct the entrypoint such that it requires minimal user input to execute properly.
6. The framework author should leverage clearly named environment variables to pass relevant arguments to the target application.
7. For frameworks built around software that require a license, the framework should test that a license is included before attempting to run the software and alert the user if it does not detect an appropriate license file.
8. Best effort should be made to print relevant information to stdout for progress tracking.
# Connext Vector Node

## Overview
- **Industry**: Cryptocurrency, Layer 2 Scaling

- **Target Container OS**: Linux

- **Source Code**: open source

- **Github**: https://github.com/connext/

## Notes

Connext is a Layer 2 scaling technology based on the concept of state channels. It is designed to work with
EVM-based smart contract platforms.


## Building

This container runtime is targeted at linux. To build the container run:

```
docker build -t vector_node .
```

## Running

```
docker run -d -p 8888:8888 --rm --name vector_node vector_node .
```
Binary file added connext_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed galileo_pres.png
Binary file not shown.
8 changes: 8 additions & 0 deletions node.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"adminToken":"asdf",
"chainProviders": {"1":"https://eth-mainnet.alchemyapi.io/v2/_2mBX3HGWRFlLSg_2JeqBn3Ljlfn2hqU"},
"mnemonic": "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat",
"messagingUrl": "https://messaging.connext.network",
"port": 8000,
"nodeUrl": "http://0.0.0.0:8000"
}
Loading