-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Connext support Co-authored-by: Yang Yang <[email protected]> Co-authored-by: michael1011 <[email protected]> Co-authored-by: kilrau <[email protected]> Co-authored-by: raladev <[email protected]>
- Loading branch information
1 parent
29b3c18
commit 678c66c
Showing
31 changed files
with
403 additions
and
89 deletions.
There are no files selected for viewing
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,24 @@ | ||
FROM node:12-alpine3.11 AS builder | ||
ARG REPO=connext/rest-api-client | ||
ARG BRANCH=master | ||
# Use pure JS implemented secp256k1 bindings | ||
RUN apk add --no-cache git bash python3 make g++ python | ||
# This is a "hack" to automatically invalidate the cache in case there are new commits | ||
ADD https://api.github.com/repos/$REPO/commits/$BRANCH /dev/null | ||
RUN git clone -b $BRANCH --depth=2 https://github.com/$REPO /connext | ||
# lock connext container down to specific commit hash | ||
WORKDIR /connext | ||
RUN git checkout 0d9bb0f7c0aa76423e65bac27a937a612ad3eabb | ||
RUN npm install | ||
RUN npm run build | ||
|
||
FROM node:12-alpine3.11 | ||
RUN apk add --no-cache bash supervisor curl | ||
RUN mkdir /root/.connext | ||
VOLUME [ "/root/.connext" ] | ||
COPY --from=builder /connext /app | ||
COPY entrypoint.sh /app | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
WORKDIR /app | ||
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] | ||
EXPOSE 5040 |
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,24 @@ | ||
FROM node:12-alpine3.11 AS builder | ||
ARG REPO=connext/rest-api-client | ||
ARG BRANCH=master | ||
# Use pure JS implemented secp256k1 bindings | ||
RUN apk add --no-cache git bash python3 make g++ python | ||
# This is a "hack" to automatically invalidate the cache in case there are new commits | ||
ADD https://api.github.com/repos/$REPO/commits/$BRANCH /dev/null | ||
RUN git clone -b $BRANCH --depth=2 https://github.com/$REPO /connext | ||
# lock connext container down to specific commit hash | ||
WORKDIR /connext | ||
RUN git checkout 0d9bb0f7c0aa76423e65bac27a937a612ad3eabb | ||
RUN npm install | ||
RUN npm run build | ||
|
||
FROM node:12-alpine3.11 | ||
RUN apk add --no-cache bash supervisor curl | ||
RUN mkdir /root/.connext | ||
VOLUME [ "/root/.connext" ] | ||
COPY --from=builder /connext /app | ||
COPY entrypoint.sh /app | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
WORKDIR /app | ||
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] | ||
EXPOSE 5040 |
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,3 @@ | ||
#!/bin/bash | ||
set -m | ||
npm run start |
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,11 @@ | ||
[supervisord] | ||
nodaemon=true | ||
logfile=/app/supervisord.log | ||
childlogdir=/app | ||
user=root | ||
|
||
[program:connext] | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
command=/app/entrypoint.sh | ||
stopsignal=SIGINT |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,35 @@ | ||
from .node import XudApiError | ||
|
||
class Action: | ||
def __init__(self, node_manager): | ||
self.node_manager = node_manager | ||
|
||
@property | ||
def shell(self): | ||
return self.node_manager.shell | ||
|
||
def xud_is_locked(self, xud): | ||
try: | ||
info = xud.api.getinfo() | ||
return False | ||
except XudApiError as e: | ||
if "xud is locked" in str(e): | ||
return True | ||
return False | ||
|
||
def xucli_unlock_wrapper(self, xud): | ||
while True: | ||
try: | ||
print() | ||
xud.cli("unlock", self.shell) | ||
break | ||
except KeyboardInterrupt: | ||
break | ||
except: | ||
pass | ||
|
||
def execute(self): | ||
xud = self.node_manager.get_node("xud") | ||
if not self.xud_is_locked(xud): | ||
return | ||
self.xucli_unlock_wrapper(xud) |
Oops, something went wrong.