Skip to content

Commit

Permalink
Merge pull request #51 from hoprnet/lukas/improved-dappnode
Browse files Browse the repository at this point in the history
Improvements to HOPR DappNode package
  • Loading branch information
tropicar authored Sep 6, 2022
2 parents 9b687e3 + 5148cd3 commit f82a558
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# DAppNodeSDK release directories
build_*
build
/build_*/
/build/
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
ARG UPSTREAM_VERSION
FROM gcr.io/hoprassociation/hoprd:${UPSTREAM_VERSION}

#Entrypoint
ENTRYPOINT [ "sh", "-c", "exec /usr/bin/tini -- yarn hoprd \
--password=\"$DB_PASSWORD\" \
--init --admin \
--adminHost=\"0.0.0.0\" \
--rest \
--restHost=\"0.0.0.0\" \
--healthCheck \
--healthCheckHost=\"0.0.0.0\" \
--data=\"/app/hoprd-db/data-master-goerli\" \
--identity=\"/app/hoprd-db/.hopr-identity\" \
--apiToken=\"$API_TOKEN\" "]
ENV AVADO=true
ENTRYPOINT [ "/usr/bin/tini", "--", "yarn", "hoprd"]
17 changes: 17 additions & 0 deletions build_dappnode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# prevent sourcing of this script, only allow execution
$(return >/dev/null 2>&1)
test "$?" -eq "0" && { echo "This script should only be executed." >&2; exit 1; }

# exit on errors, undefined variables, ensure errors in pipes are not hidden
set -Eeuo pipefail


usage() {
msg
msg "Usage: $0 [-h|--help] version environment"
msg
msg "Sets the version of the Dappnode build & environment and builds the image. Version must be semver"
msg
}
22 changes: 17 additions & 5 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "hopr.dnp.dappnode.eth",
"version": "0.1.0",
"upstreamVersion": "ouagadougou",
"version": "1.89.18",
"upstreamVersion": "paleochora",
"description": "The HOPR protocol ensures everyone has control of their privacy, data, and identity. By running a HOPR Node, you can obtain HOPR tokens by relaying data and connect to the HOPR Network.",
"type": "service",
"architectures": ["linux/amd64"],
"author": "DAppNode Association <admin@dappnode.io> (https://github.com/dappnode)",
"author": "HOPR Association <admin@hoprnet.org> (https://hoprnet.org)",
"contributors": [
"Tropicar <[email protected]> (https://github.com/tropicar)"
],
Expand All @@ -15,7 +15,8 @@
"categories": ["Blockchain"],
"links": {
"homepage": "https://hoprnet.org/",
"logs": "http://hopr.dappnode:3000",
"ui": "http://hopr.dappnode:3000?apiEndpoint=http://hopr.dappnode:3001&apiToken=!5qxc9Lp1BE7IFQ-nrtttU",
"api": "http://hopr.dappnode:3001",
"healthcheck": "http://hopr.dappnode:8080/healthcheck/v1/version"
},
"repository": {
Expand All @@ -25,11 +26,22 @@
"bugs": {
"url": "https://github.com/dappnode/DAppNodePackage-Hopr/issues"
},
"exposable": [
{
"name": "HOPR",
"description": "HOPR P2P port",
"port": 9091
}
],
"license": "GLP-3.0",
"backup": [
{
"name": "db",
"path": "/app/hoprd-db"
"path": "/app/hoprd/data"
},
{
"name": "identity",
"path": "/app/hoprd/.hopr-identity"
}
]
}
37 changes: 27 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
version: "3.5"
services:
node:
image: "node.hopr.dnp.dappnode.eth:0.1.0"
image: "node.hopr.dnp.dappnode.eth:1.89.18"
build:
context: .
args:
UPSTREAM_VERSION: ouagadougou
UPSTREAM_VERSION: paleochora
ports:
- "9091"
- 9091/udp
- "3000"
- "3001"
- "8080"
- "9091:9091/tcp"
- "9091:9091/udp"
- "3000:3000"
- "3001:3001"
- "8080:8080"
volumes:
- "db:/app/hoprd-db"
environment:
DEBUG: hopr*
DB_PASSWORD: open-sesame-iTwnsPNg0hpagP+o6T0KOwiH9RQ0
API_TOKEN: yLWk!W@Z9G&14O^xbtpBc
- DEBUG=hopr*
- HOPRD_ENVIRONMENT=paleochora
- HOPRD_HOST=0.0.0.0:9091
- HOPRD_ANNOUNCE=false
- HOPRD_ADMIN=true
- HOPRD_ADMIN_HOST=0.0.0.0
- HOPRD_ADMIN_PORT=3000
- HOPRD_API=true
- HOPRD_API_HOST=0.0.0.0
- HOPRD_API_PORT=3001
- HOPRD_HEALTH_CHECK=true
- HOPRD_HEALTH_CHECK_HOST=0.0.0.0
- HOPRD_HEALTH_CHECK_PORT=8080
- HOPRD_PASSWORD=open-sesame-iTwnsPNg0hpagP+o6T0KOwiH9RQ0
- HOPRD_API_TOKEN=!5qxc9Lp1BE7IFQ-nrtttU
- HOPRD_IDENTITY=/app/hoprd/.hopr-identity
- HOPRD_DATA=/app/hoprd/data
- HOPRD_INIT=true
- HOPRD_ALLOW_PRIVATE_NODE_CONNECTIONS=false
- HOPRD_PROVIDER=https://provider-proxy.hoprnet.workers.dev/xdai_mainnet
restart: unless-stopped
volumes:
db: {}
40 changes: 38 additions & 2 deletions releases.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,44 @@
{
"0.1.0": {
"hash": "/ipfs/QmYBtLitBzzGKtgxifzjDvMUnes1y8mYW7uHaV413kYYep",
"hash": "/ipfs/QmbJfKYP16LLKHNNYp3jfNTU2t6Butwc7EZkW1NWDjqVoA",
"uploadedTo": {
"dappnode": "Fri, 04 Jun 2021 10:42:59 GMT"
"dappnode": "Tue, 09 Aug 2022 18:51:43 GMT"
}
},
"0.1.1": {
"hash": "/ipfs/QmRVqU4eZzW3yvve5sSVtS9VAqNPmSfZcTDkHYHBPg8dVf",
"uploadedTo": {
"dappnode": "Fri, 05 Aug 2022 07:39:48 GMT"
}
},
"0.2.0": {
"hash": "/ipfs/QmeLX7iou476GQ2MVftc1m8pTqnnzZ7XCvscanF75F4eZj",
"uploadedTo": {
"dappnode": "Tue, 09 Aug 2022 18:31:13 GMT"
}
},
"1.88.0": {
"hash": "/ipfs/QmWDYy3SMd69pmMUHNFrMtnQakQvMywSyCk8pUcHtcR47u",
"uploadedTo": {
"dappnode": "Tue, 09 Aug 2022 18:40:38 GMT"
}
},
"1.89.5": {
"hash": "/ipfs/QmRSBb2beDdTtgQ3nGTfUDj1cYqt9s2YeT5SrWAE1UtMex",
"uploadedTo": {
"dappnode": "Fri, 19 Aug 2022 09:07:20 GMT"
}
},
"1.89.8": {
"hash": "/ipfs/QmQNbZQhAzeJ5yd6rD1W7XrGFTLfN44VXFq3r3t5wEYqf2",
"uploadedTo": {
"dappnode": "Thu, 25 Aug 2022 06:13:01 GMT"
}
},
"1.89.18": {
"hash": "/ipfs/QmVgZ4h1CRhrbWJ82T1hP7BbfwH48Pv5VP1dBXeieA7gFC",
"uploadedTo": {
"dappnode": "Mon, 29 Aug 2022 13:29:12 GMT"
}
}
}
40 changes: 36 additions & 4 deletions setup-wizard.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,52 @@
version: "2"
fields:
- id: DB_PASSWORD

- id: HOPRD_PASSWORD
target:
type: environment
name: DB_PASSWORD
name: HOPRD_PASSWORD
service: node
title: Database Password
required: true
description: It's the password which will be used to encrypt the database.
secret: true
- id: API_TOKEN

- id: HOPRD_API_TOKEN
target:
type: environment
name: API_TOKEN
name: HOPRD_API_TOKEN
service: node
title: Api token
required: true
description: It's the password which will be used to access to the logs
secret: true

- id: HOPRD_PROVIDER
target:
type: environment
name: HOPRD_PROVIDER
service: node
title: RPC Provider URL
required: false
description: Optional URL to the custom RPC provider this HOPR node should use.
secret: false

- id: HOPRD_ENVIRONMENT
target:
type: environment
name: HOPRD_ENVIRONMENT
service: node
title: HOPR network environment
required: false
description: Optional network environment this HOPR node should use.
secret: false

- id: IDENTITY
target:
type: fileUpload
path: /app/hoprd/.hopr-identity
service: node
title: Custom identity file
required: false
description: Upload custom identity file of a previously deployed HOPR node.
secret: false

0 comments on commit f82a558

Please sign in to comment.