Skip to content
Merged
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
8 changes: 6 additions & 2 deletions .env.desmos → .env.desmos.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ OPERATOR_ORGANIZATION_IDENTIFIER=
# This domain must be reachable from the public internet and
# properly configured with DNS records and valid TLS certificates.
#
# Note: The API_EXTERNAL_DOMAIN must be set to a valid domain name that points to the Desmos service. This domain is used for external access to the Desmos API and should be configured with appropriate DNS records and SSL/TLS certificates.
# Please be sure to use the full URL, including the protocol (http:// or https://), and ensure that the domain is publicly accessible and properly configured with DNS records and valid TLS certificates.

# Example:
# API_EXTERNAL_DOMAIN=https://desmos.example.org
API_EXTERNAL_DOMAIN=
#API_EXTERNAL_DOMAIN=https://desmos.example.org
API_EXTERNAL_DOMAIN=

17 changes: 15 additions & 2 deletions .env.dlt-adapter-alastria → .env.dlt-adapter-alastria.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
DEBUG=*

# Use the private key obtained from Dome Access Node Keys Generator ( https://dome-marketplace.github.io/dome-crypto-generator/ )
# Example
# PRIVATE_KEY=0xcc80...
PRIVATE_KEY=
DOME_EVENTS_CONTRACT_ADDRESS=0xeBA8507227af9e6DfB8D4575549C52457112C957

# Use the DLT address obtained from Dome Access Node Keys Generator ( https://dome-marketplace.github.io/dome-crypto-generator/ )
# Example
# DOME_EVENTS_CONTRACT_ADDRESS=0xeBA850...
DOME_EVENTS_CONTRACT_ADDRESS=

DOME_EVENTS_CONTRACT_ABI=[ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "index", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "publisherAddress", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "authorAddress", "type": "address\"AuthorAddress", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "entityIDHash", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousEntityHash", "type": "bytes32" }, { "indexed": false, "internalType": "string", "name": "eventType", "type": "string" }, { "indexed": false, "internalType": "string", "name": "dataLocation", "type": "string" }, { "indexed": false, "internalType": "string[]", "name": "metadata", "type": "string[]" } ], "name": "EventDOMEv1", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [ { "internalType": "bytes32", "name": "_publisherAddress", "type": "bytes32" }, { "internalType": "address", "name": "_authorAdress", "type": "address" }, { "internalType": "bytes32", "name": "_entityIDHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "_previousEntityHash", "type": "bytes32" }, { "internalType": "string", "name": "_eventType", "type": "string" }, { "internalType": "string", "name": "_dataLocation", "type": "string" }, { "internalType": "string[]", "name": "_metadata", "type": "string[]" } ], "name": "emitNewEvent", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "index", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ]
DOME_PRODUCTION_BLOCK_NUMBER=118733266
RPC_ADDRESS=https://red-t.alastria.io/v0/9461d9f4292b41230527d57ee90652a6
ISS=0x6a2f383855cba0fff292455ccd908c4a08d6c07f5ef139b5afcef4cf62d4798b

Use the ISS obtained from Dome Access Node Keys Generator ( https://dome-marketplace.github.io/dome-crypto-generator/ )
# Example
# ISS=0x6a2f383...
ISS=
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ assets/*
# Ignore everything in postgres-init except SQL files
postgres-init/*
!postgres-init/*.sql


#Ignore customized .env files
.env.desmos
.env.dlt-adapter-alastria
.secrets.desmos
Caddyfile.example
4 changes: 3 additions & 1 deletion .secrets.desmos → .secrets.desmos.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
# SECURITY_PRIVATE_KEY=0xabc123...
SECURITY_PRIVATE_KEY=


# Base64-encoded LEAR credential obtained from the LEARCredentialMachine
# stored in your wallet.
# Note: the LEAR credential string is a JWT, so it seems to be a Base64 string, but it is Note. You have to encode it in base64 again
#
# Example:
# SECURITY_LEAR_CREDENTIAL_MACHINE_IN_BASE64=ZXlKaGJHY2lPaUpJVXpJMU5pSXNJbXRwWkNJNkltRjFZV3h6SWpwN0ltbGtJam9pYkd4aGJtNWxJam9pT0RZME5Ea3hOakV3TWpBeE1
SECURITY_LEAR_CREDENTIAL_MACHINE_IN_BASE64=
SECURITY_LEAR_CREDENTIAL_MACHINE_IN_BASE64=
19 changes: 19 additions & 0 deletions Caddyfile → Caddyfile.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
}

# Access Node API Gateway

# Replace with full domain name to enable https and TLS certificates, without specifying the protocol
# Do NOT use the protocol, just the domain name
# example: desmos.example.org

# use ":80" only for testing (http, without certificates)
:80 {
# TMForum APIs
handle_path /tmf-api/accountManagement* {
Expand Down Expand Up @@ -62,6 +68,19 @@
reverse_proxy desmos:8080
}

# DOZZLE
# Please uncomment this directive to enable proxy for dozzle
# If you disable it, Dozzle will only be reachable from the local dozzle port (usually only from your private network)
# Ex. https://dome.mydomain.com:8888
#
# If you enable proxy, Dozzle will be available to everyone in the /dozzle folder
# ex: https://dome.mydomain.com/dozzle

handle /dozzle* {
reverse_proxy dozzle:8080
}


# Fallback
handle {
error "Not Found" 404
Expand Down
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This README defines the formal requirements for the description of the Docker Compose file which implements a DOME Access Node using Docker Compose. The objective of this repo is to facilitate an Access Node implementation which is easy to understand, install and operate for those entities external to DOME which wish to use this form of Access Node.

The Docker Compose version of the Access Node is intended to be run externally to the DOME instance, so it should be self-contained and do not require any access to any service inside the DOME instance. The only communication between with the Access Node runnin in the DOME instance is for the replication protocol, implemented by the Desmos service.
The Docker Compose version of the Access Node is intended to be run externally to the DOME instance, so it should be self-contained and do not require any access to any service inside the DOME instance. The only communication between with the Access Node running in the DOME instance is for the replication protocol, implemented by the Desmos service.

To ensure all services remain integrated and documented, we use a metadata-as-code approach, including information about the services and their dependencies directly in the `compose.yaml` file.
To ensure that all services remain integrated and documented, we use a metadata-as-code approach, including information about the services and their dependencies directly in the `compose.yaml` file.

Every service defined in this `compose.yaml` **must** include specific labels. These labels allow the generation of documentation and dependency graphs, which can be used to better implement safe and controlled deployments.

Expand All @@ -19,7 +19,7 @@ When adding or updating your service, please follow this template:
```yaml
services:
desmos:
image: in2workspace/in2-desmos-api:v2.0.3
image: in2workspace/in2-desmos-api:v2.0.11
# ... standard docker configs (ports, volumes, etc) ...
labels:
# Description
Expand Down Expand Up @@ -62,3 +62,45 @@ All architectural metadata must be prefixed with `dome.`, acting as our namespac
2. **No Comments for Metadata:** Do not use YAML comments (`#`) for owner or dependency info.
3. **Sync Required:** If you add a new API call from Service A to Service B, you **must** update the `dome.dependsOn` label for Service A in the same PR.
4. **CI Validation:** Our (WIP) CI pipeline runs a checker. If a service is missing the `dome.owner` or `dome.type` labels, the build will fail.


## Configuration

To correctly configure the stack, you need to edit the following configuration files.

Please take a look at the provided samples and customize them for your own environment.

Inside every file, you will details for the parameters that you should customize for your environment.

- _**.env.desmos**_
- _**.env.dlt-adapter**_
- _**.secrets.desmos**_
- _**Caddyfile**_

Other env files should not be changed


## Execution
You can execute the Access Node using the following command

<pre> docker compose up -d</pre>

To stop the stack, use this command

<pre> docker compose down</pre>

### Dozzle
During setup/debug it is possible to start an instance of **Dozzle**, a service that provide a simple web UI to view container logs for all services, without having to view them from console.

Dozzle will NOT be started automatically with docker compose unless you run the stack using this command

<pre> docker compose up -d --profile debug</pre>

Also, please note that with provided configuration, Dozzle will NOT be exposed via proxy in https, but it will only be reachable from exposed Dozzle port (i.e. 8888), usually from you private network (depending on your firewall rule).

Ex: http://dome.mydomain.com:8888/dozzle


If you want to enable proxy for Dozzle, please comment the related lines in Caddyfile

The service will be available from this URL: https://dome.mydomain.com/dozzle
Loading
Loading