-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
22,264 additions
and
9,487 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,4 @@ | ||
node_modules | ||
helia* | ||
relay/node_modules | ||
relay/helia* |
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
name: Run Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Docker BuildX | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Set up Docker Compose | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: "docker-compose-test.yml" | ||
up-flags: "--build" | ||
- name: Check Docker Containers | ||
run: | | ||
echo "🔍 Checking Docker Containers..." | ||
docker compose -f "docker-compose-test.yml" ps | ||
- name: Check Relay Service Logs | ||
run: | | ||
echo "🔍 Checking Relay Service Logs..." | ||
sleep 30 && docker compose -f docker-compose-test.yml logs relay-service | ||
# docker compose -f docker-compose-test.yml logs relay-service | grep "Actual listen addresses: " | ||
- name: Running-Tests | ||
run: | | ||
echo "🧪 Running tests..." | ||
docker compose -f docker-compose-test.yml exec relay-service npm test |
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
node_modules/ | ||
relay/node_modules | ||
relay/helia* | ||
data/ | ||
.env | ||
.env* | ||
.idea | ||
data/ | ||
helia-blocks/ | ||
helia-data/ | ||
node_modules/ | ||
relay/helia* | ||
relay/helia-blocks | ||
relay/helia-data | ||
relay/ipns-keys/ | ||
relay/leveldb | ||
relay/leveldb/ | ||
relay/node_modules | ||
relay/orbitdb | ||
relay/relay.lock | ||
relay/scanning-state* | ||
relay/scanning-state.json |
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
services: | ||
regtest: | ||
image: "doichain/core:dc0.20.1.15" | ||
container_name: regtest | ||
ports: | ||
- "18332:18332" | ||
- "18443:18443" | ||
- "18445:18445" | ||
# command: ["/usr/local/bin/doichaind"] | ||
volumes: | ||
- ./docker/doichain-regtest.conf:/home/doichain/.doichain/doichain.conf | ||
|
||
electrumx: | ||
container_name: electrumx | ||
hostname: electrumx | ||
image: "doichain/electrumx:dc1.2.1" | ||
depends_on: | ||
- regtest | ||
volumes: | ||
# - ./db:/var/lib/electrumx | ||
- ./docker/startElectrumDOIRegTest.sh:/startElectrumDOIRegTest.sh | ||
entrypoint: ["/startElectrumDOIRegTest.sh"] | ||
ports: | ||
- "50001:50001" | ||
- "50002:50002" | ||
- "8443:8443" | ||
stdin_open: true | ||
tty: true | ||
privileged: true | ||
|
||
relay-service: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile | ||
volumes: | ||
- ./docker/entrypoint.sh:/usr/src/app/entrypoint.sh | ||
# - ./:/usr/src/app/ | ||
entrypoint: ["/usr/src/app/entrypoint.sh", "generate-key"] | ||
ports: | ||
- "1235:1235" | ||
- "9091:9091" | ||
- "12345:12345" | ||
- "3000:3000" | ||
depends_on: | ||
- regtest | ||
- electrumx | ||
|
||
volumes: | ||
doichain-data: |
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,71 @@ | ||
services: | ||
prometheus: | ||
image: prom/prometheus:v3.0.0 | ||
container_name: prometheus | ||
ports: | ||
- 90:9090 | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yaml' | ||
volumes: | ||
- ./prometheus.yaml:/etc/prometheus/prometheus.yaml | ||
- ./prometheus_data:/prometheus | ||
restart: unless-stopped | ||
networks: | ||
- local-first-network | ||
- monitoring | ||
|
||
grafana: | ||
image: grafana/grafana-oss:latest | ||
container_name: grafana | ||
ports: | ||
- 3001:3000 | ||
volumes: | ||
- grafana-data:/var/lib/grafana | ||
restart: unless-stopped | ||
networks: | ||
- local-first-network | ||
- monitoring | ||
|
||
node_exporter: | ||
image: quay.io/prometheus/node-exporter:v1.8.2 | ||
container_name: node_exporter | ||
command: '--path.rootfs=/host' | ||
pid: host | ||
restart: unless-stopped | ||
volumes: | ||
- /:/host | ||
networks: | ||
- local-first-network | ||
- monitoring | ||
|
||
cadvisor: | ||
image: gcr.io/cadvisor/cadvisor:v0.47.0 | ||
container_name: cadvisor | ||
command: | ||
- '-port=8098' | ||
volumes: | ||
- /:/rootfs:ro | ||
- /etc/machine-id:/etc/machine-id:ro | ||
- /var/run:/var/run:ro | ||
- /sys:/sys:ro | ||
- /var/lib/docker/:/var/lib/docker:ro | ||
- /dev/disk/:/dev/disk:ro | ||
devices: | ||
- /dev/kmsg | ||
privileged: true | ||
restart: unless-stopped | ||
networks: | ||
- local-first-network | ||
- monitoring | ||
|
||
volumes: | ||
prometheus-data: | ||
driver: local | ||
grafana-data: | ||
driver: local | ||
|
||
networks: | ||
local-first-network: | ||
external: true | ||
monitoring: | ||
driver: bridge |
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,8 @@ | ||
FROM node:20 | ||
WORKDIR /usr/src/app | ||
COPY relay/ ./ | ||
COPY docker/entrypoint.sh ./ | ||
COPY relay/.env.example ./.env | ||
RUN rm -rf node_modules && npm install | ||
ENTRYPOINT [ "./entrypoint.sh" ] | ||
CMD [ "node", "src/relay.js"] |
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,27 @@ | ||
regtest=1 | ||
daemon=1 | ||
server=1 | ||
wallet=1 | ||
rpcuser=admin | ||
rpcpassword=adminpw | ||
rpcallowip=0.0.0.0/0 | ||
rpcbind=0.0.0.0 | ||
txindex=1 | ||
fallbackfee=0.00001 | ||
namehistory=1 | ||
#blocknotify=curl -X GET http://localhost:3000/api/v1/blocknotify?block=%s | ||
#walletnotify=curl -X GET http://localhost:3000/api/v1/walletnotify?tx=%s | ||
|
||
[test] | ||
rpcport=18332 | ||
rpcbind=0.0.0.0 | ||
rpcallowip=0.0.0.0/0 | ||
wallet=1 | ||
port=18445 | ||
|
||
[regtest] | ||
rpcport=18332 | ||
rpcbind=0.0.0.0 | ||
rpcallowip=0.0.0.0/0 | ||
wallet=1 | ||
port=18445 |
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,28 @@ | ||
#!/bin/bash | ||
rm scanning-state.json | ||
|
||
if [ "$1" == "generate-key" ]; then | ||
echo "Generating private key..." | ||
npm run generate-keypair | ||
echo "--------------------------------" | ||
key_output=$(cat .env.privateKey) | ||
|
||
echo "Private key generated: $key_output" | ||
# Replace or add the RELAY_PRIVATE_KEY in the .env file | ||
if grep -q "^RELAY_PRIVATE_KEY=" .env; then | ||
sed -i "s/^RELAY_PRIVATE_KEY=.*/$key_output/" .env | ||
else | ||
echo "$key_output" >> .env | ||
fi | ||
cat .env | ||
npm run start | ||
elif [ "$1" == "start" ]; then | ||
echo "Starting node..." | ||
npm run start | ||
else | ||
echo "Invalid command. Use 'generate-key' or 'start'." | ||
exit 1 | ||
fi | ||
|
||
# Start the application if a valid command was provided | ||
# exec "$@" |
Oops, something went wrong.