Skip to content

Commit

Permalink
Added a list of environment variable to override config parameters fo…
Browse files Browse the repository at this point in the history
…r more config flexibility
  • Loading branch information
decentralgabe authored Jan 25, 2023
1 parent 793d29c commit e40e257
Show file tree
Hide file tree
Showing 35 changed files with 249 additions and 85 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ nunitresults.xml
coverage/

# sidetree-ipfs data folder
sidetree-ipfs/
sidetree-ipfs/

.DS_Store
.idea/*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions docker/docker-compose.testnet-override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ services:
ion-bitcoin:
container_name: testnet-ion-bitcoin
environment:
- ION_BITCOIN_CONFIG_FILE_PATH=/json/docker-testnet-bitcoin-config.json
- ION_BITCOIN_VERSIONING_CONFIG_FILE_PATH=/json/testnet-bitcoin-versioning.json
- ION_BITCOIN_CONFIG_FILE_PATH=/config/docker-testnet-bitcoin-config.json
- ION_BITCOIN_VERSIONING_CONFIG_FILE_PATH=/config/testnet-bitcoin-versioning.json

ion-core:
container_name: testnet-ion-core
environment:
- ION_CORE_CONFIG_FILE_PATH=/json/docker-testnet-core-config.json
- ION_CORE_VERSIONING_CONFIG_FILE_PATH=/json/testnet-core-versioning.json
- ION_CORE_CONFIG_FILE_PATH=/config/docker-testnet-core-config.json
- ION_CORE_VERSIONING_CONFIG_FILE_PATH=/config/testnet-core-versioning.json
8 changes: 4 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ services:
command: [ node, "src/bitcoin.js" ]
working_dir: /ion
environment:
- ION_BITCOIN_CONFIG_FILE_PATH=/json/docker-mainnet-bitcoin-config.json
- ION_BITCOIN_VERSIONING_CONFIG_FILE_PATH=/json/mainnet-bitcoin-versioning.json
- ION_BITCOIN_CONFIG_FILE_PATH=/config/docker-mainnet-bitcoin-config.json
- ION_BITCOIN_VERSIONING_CONFIG_FILE_PATH=/config/mainnet-bitcoin-versioning.json
volumes:
# for optional fast initialization feature
- ${ION_DATA_VOLUME:-~/ion-data}/bitcoin:/data/bitcoin
Expand All @@ -53,7 +53,7 @@ services:
command: [ node, "src/core.js" ]
working_dir: /ion
environment:
- ION_CORE_CONFIG_FILE_PATH=/json/docker-mainnet-core-config.json
- ION_CORE_VERSIONING_CONFIG_FILE_PATH=/json/mainnet-core-versioning.json
- ION_CORE_CONFIG_FILE_PATH=/config/docker-mainnet-core-config.json
- ION_CORE_VERSIONING_CONFIG_FILE_PATH=/config/mainnet-core-versioning.json
ports:
- "3000:3000"
2 changes: 1 addition & 1 deletion docker/dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM node:lts-alpine3.14

COPY dist /ion
COPY json /json
COPY config /config
COPY node_modules /node_modules
2 changes: 1 addition & 1 deletion docs/Q-and-A.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ Have a look at the port mappings in the [yml-file](https://github.com/decentrali
No, the value of running a node is accessing what may become the largest Web of identity for connecting to people, companies, apps, and services, which is the foundation of decentralized apps. One near term example: companies will run them so they can verify the DIDs /VC of customers.

## **Q: Have you got any instructions for regtest setup?
You might find what yu need here: https://github.com/decentralized-identity/ion/tree/master/json
You might find what you need here: https://github.com/decentralized-identity/ion/tree/master/config

# Q&A section Sidetree

Expand Down
27 changes: 24 additions & 3 deletions install-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Clone https://github.com/decentralized-identity/ion:
git clone https://github.com/decentralized-identity/ion
```

Example configuration files for both `testnet-` and `mainnet-` can be found under [the top-level `json/` directory](https://github.com/decentralized-identity/ion/tree/master/json).
Example configuration files for both `testnet-` and `mainnet-` can be found under [the top-level `config/` directory](https://github.com/decentralized-identity/ion/tree/master/config).

> NOTE: If not specified, **`json/testnet-*-*.json` files are used as default configuration values**. Be sure to start with whichever config template (`testnet-` or `mainnet-`) is right for your use case.
Expand Down Expand Up @@ -210,6 +210,18 @@ Update the configuration for the ION core service under `json/testnet-core-confi
- testnet: `ion:test`
- mainnet: `ion`

**NOTE**: You can set a few config variables via environment variables for simplicity. The following env variables, if
set, will override the values listed in the config files.

| Environment Variable | Config Mapping |
|------------------------|-------------------------------|
| `BITCOIN_DATA_DIR` | **bitcoinDataDirectory** |
| `BITCOIN_RPC_PASSWORD` | **bitcoinRpcPassword** |
| `BITCOIN_WALLET` | **bitcoinWalletImportString** |
| `BITCOIN_ENDPOINT` | **bitcoinPeerUri** |
| `MONGO_ENDPOINT` | **mongoDbConnectionString** |


Run the following commands to build ION:
```
npm i
Expand Down Expand Up @@ -244,9 +256,18 @@ Copy the configuration files `<testnet or mainnet>-core-config.json` and `<testn

Start a new console and run the following command to start the core service.

**NOTE**: You can set a few config variables via environment variables for simplicity. The following env variables, if
set, will override the values listed in the config files.

| Environment Variable | Config Mapping |
|-------------------------------|-----------------------------|
| `IPFS_ENDPOINT` | **ipfsHttpApiEndpointUri** |
| `BLOCKCHAIN_SERVICE_ENDPOINT` | **blockchainServiceUri** |
| `MONGO_ENDPOINT` | **mongoDbConnectionString** |

```
ION_CORE_CONFIG_FILE_PATH=/usr/local/src/ion/json/testnet-core-config.json
ION_CORE_VERSIONING_CONFIG_FILE_PATH=/usr/local/src/ion/json/testnet-core-versioning.json
ION_CORE_CONFIG_FILE_PATH=/usr/local/src/ion/config/testnet-core-config.json
ION_CORE_VERSIONING_CONFIG_FILE_PATH=/usr/local/src/ion/config/testnet-core-versioning.json
npm run core
```

Expand Down
64 changes: 32 additions & 32 deletions ion/install-guide/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">


<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand All @@ -16,15 +16,15 @@
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans&display=swap" rel="stylesheet">

<link href="/ion/css/compiled/head.css" rel="stylesheet">

<link href="/ion/css/imports/hero.css" rel="stylesheet" />

<link href="/ion/css/imports/page.css" rel="stylesheet" />

<link href="/ion/css/imports/markdown.css" rel="stylesheet" />

<link href="/ion/css/guide.css" rel="stylesheet" />


<script src="/ion/js/compiled/web-components.js" type="module"></script>

Expand All @@ -33,10 +33,10 @@
<body>

<svg style="display: none">

<!-- <svg class="preloader-icon" width="34" height="38" viewBox="0 0 34 38">
<path class="preloader-path" stroke-dashoffset="0" d="M29.437 8.114L19.35 2.132c-1.473-.86-3.207-.86-4.68 0L4.153 8.114C2.68 8.974 1.5 10.56 1.5 12.28v11.964c0 1.718 1.22 3.306 2.69 4.165l10.404 5.98c1.47.86 3.362.86 4.834 0l9.97-5.98c1.472-.86 2.102-2.45 2.102-4.168V12.28c0-1.72-.59-3.306-2.063-4.166z"></path>
SVG
width: 64px;
height: 76px;
Expand Down Expand Up @@ -64,7 +64,7 @@

<symbol id="line-chart-icon" viewBox="0 0 512 512">
<path d="m497 452h-437v-437c0-8.289062-6.710938-15-15-15h-30c-8.289062 0-15 6.710938-15 15s6.710938 15 15 15h15v61h-15c-8.289062 0-15 6.710938-15 15s6.710938 15 15 15h15v60h-15c-8.289062 0-15 6.710938-15 15s6.710938 15 15 15h15v60h-15c-8.289062 0-15 6.710938-15 15s6.710938 15 15 15h15v60h-15c-8.289062 0-15 6.710938-15 15s6.710938 15 15 15h15v61h-15c-8.289062 0-15 6.710938-15 15s6.710938 15 15 15h15v15c0 8.289062 6.710938 15 15 15s15-6.710938 15-15v-15h61v15c0 8.289062 6.710938 15 15 15s15-6.710938 15-15v-15h60v15c0 8.289062 6.710938 15 15 15s15-6.710938 15-15v-15h60v15c0 8.289062 6.710938 15 15 15s15-6.710938 15-15v-15h61v15c0 8.289062 6.710938 15 15 15s15-6.710938 15-15v-15h60v15c0 8.289062 6.710938 15 15 15s15-6.710938 15-15v-30c0-8.289062-6.710938-15-15-15zm0 0"/><path d="m467 61c-24.8125 0-45 20.1875-45 45 0 13.046875 5.671875 24.710938 14.570312 32.9375l-56.722656 132.351562c-.960937-.0625-1.871094-.289062-2.847656-.289062-6.925781 0-14.410156 1.703125-20.277344 4.511719l-60.234375-60.234375c2.808594-5.867188 4.511719-12.351563 4.511719-19.277344 0-24.8125-20.1875-45-45-45s-45 20.1875-45 45c0 8.695312 2.589844 16.746094 6.875 23.632812l-67.222656 84.023438c-4.617188-1.601562-9.496094-2.65625-14.652344-2.65625-24.8125 0-46 20.1875-46 45s21.1875 45 46 45 45-20.1875 45-45c0-8.695312-2.589844-16.746094-6.875-23.632812l67.222656-84.023438c4.617188 1.601562 9.496094 2.65625 14.652344 2.65625 6.925781 0 13.410156-1.703125 19.277344-4.511719l60.234375 60.234375c-2.808594 5.867188-4.511719 12.351563-4.511719 19.277344 0 24.8125 21.1875 45 46 45s45-20.1875 45-45c0-13.046875-5.671875-24.710938-14.570312-32.9375l56.722656-132.351562c.957031.0625 1.871094.289062 2.847656.289062 24.8125 0 45-20.1875 45-45 0-24.816406-20.1875-45-45-45zm0 0"/>
</symbol>
</symbol>

<symbol id="github-icon" viewBox="0 0 24 24">
<path fill="inherit" d="m12 .5c-6.63 0-12 5.28-12 11.792 0 5.211 3.438 9.63 8.205 11.188.6.111.82-.254.82-.567 0-.28-.01-1.022-.015-2.005-3.338.711-4.042-1.582-4.042-1.582-.546-1.361-1.335-1.725-1.335-1.725-1.087-.731.084-.716.084-.716 1.205.082 1.838 1.215 1.838 1.215 1.07 1.803 2.809 1.282 3.495.981.108-.763.417-1.282.76-1.577-2.665-.295-5.466-1.309-5.466-5.827 0-1.287.465-2.339 1.235-3.164-.135-.298-.54-1.497.105-3.121 0 0 1.005-.316 3.3 1.209.96-.262 1.98-.392 3-.398 1.02.006 2.04.136 3 .398 2.28-1.525 3.285-1.209 3.285-1.209.645 1.624.24 2.823.12 3.121.765.825 1.23 1.877 1.23 3.164 0 4.53-2.805 5.527-5.475 5.817.42.354.81 1.077.81 2.182 0 1.578-.015 2.846-.015 3.229 0 .309.21.678.825.56 4.801-1.548 8.236-5.97 8.236-11.173 0-6.512-5.373-11.792-12-11.792z"/>
Expand Down Expand Up @@ -167,14 +167,14 @@
<defs><path d="M223.15 22.98C210.75 12.33 194.93 6.47 178.61 6.47C166.36 6.47 154.63 9.63 144.27 15.66C133.31 5.63 118.93 0 103.82 0C71.41 0 44.93 25.83 43.87 57.99C32.67 61.12 22.52 67.49 14.77 76.38C5.25 87.3 0 101.29 0 115.77C0 148.84 26.91 175.75 59.98 175.75C76.74 175.75 210.84 175.75 227.6 175.75C260.68 175.75 287.59 148.84 287.59 115.77C287.59 89.25 270 65.95 245.03 58.37C241.61 44.68 233.97 32.28 223.15 22.98Z" id="agYm6WZCD"></path><path d="M90.43 223.64C72.54 223.64 62.6 223.64 60.61 223.64C56.93 210.69 45.01 201.17 30.89 201.17C13.86 201.17 0 215.03 0 232.06C0 249.1 13.86 262.96 30.89 262.96C45.01 262.96 56.93 253.44 60.61 240.49C64.43 240.49 95.03 240.49 98.86 240.49C103.51 240.49 107.28 236.72 107.28 232.06C107.28 230.43 107.28 211.66 107.28 175.75L90.43 175.75L90.43 223.64Z" id="ajbjOYiHM"></path><path d="M152.22 175.75L135.37 175.75C135.37 217.42 135.37 239.4 135.37 241.67C122.42 245.34 112.9 257.27 112.9 271.38C112.9 288.42 126.76 302.28 143.79 302.28C160.83 302.28 174.69 288.42 174.69 271.38C174.69 257.27 165.17 245.34 152.22 241.67C152.22 237.12 152.22 215.15 152.22 175.75Z" id="c3Slxl5lCg"></path><path d="M226.98 223.64C224.99 223.64 215.05 223.64 197.15 223.64L197.15 175.75L180.3 175.75C180.3 211.66 180.3 230.43 180.3 232.06C180.3 236.72 184.08 240.49 188.73 240.49C192.55 240.49 223.15 240.49 226.98 240.49C230.65 253.44 242.58 262.96 256.69 262.96C273.73 262.96 287.59 249.1 287.59 232.06C287.59 215.03 273.73 201.17 256.69 201.17C242.58 201.17 230.66 210.69 226.98 223.64Z" id="a3xeyOTnST"></path></defs><g><g><use href="#agYm6WZCD" opacity="1" fill="inherit" fill-opacity="1"></use></g><g><use href="#ajbjOYiHM" opacity="1" fill="inherit" fill-opacity="1"></use><g><use href="#ajbjOYiHM" opacity="1" fill-opacity="0" stroke="inherit" stroke-width="1" stroke-opacity="0"></use></g></g><g><use href="#c3Slxl5lCg" opacity="1" fill="inherit" fill-opacity="1"></use><g><use href="#c3Slxl5lCg" opacity="1" fill-opacity="0" stroke="inherit" stroke-width="1" stroke-opacity="0"></use></g></g><g><use href="#a3xeyOTnST" opacity="1" fill="inherit" fill-opacity="1"></use><g><use href="#a3xeyOTnST" opacity="1" fill-opacity="0" stroke="inherit" stroke-width="1" stroke-opacity="0"></use>
</symbol>


<symbol id="docker-icon" viewBox="0 0 640 512">
<path d="M349.9 236.3h-66.1v-59.4h66.1v59.4zm0-204.3h-66.1v60.7h66.1V32zm78.2 144.8H362v59.4h66.1v-59.4zm-156.3-72.1h-66.1v60.1h66.1v-60.1zm78.1 0h-66.1v60.1h66.1v-60.1zm276.8 100c-14.4-9.7-47.6-13.2-73.1-8.4-3.3-24-16.7-44.9-41.1-63.7l-14-9.3-9.3 14c-18.4 27.8-23.4 73.6-3.7 103.8-8.7 4.7-25.8 11.1-48.4 10.7H2.4c-8.7 50.8 5.8 116.8 44 162.1 37.1 43.9 92.7 66.2 165.4 66.2 157.4 0 273.9-72.5 328.4-204.2 21.4.4 67.6.1 91.3-45.2 1.5-2.5 6.6-13.2 8.5-17.1l-13.3-8.9zm-511.1-27.9h-66v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm-78.1-72.1h-66.1v60.1h66.1v-60.1z"/>
</symbol>

</svg>


<header id="header">
<nav id="nav">
<a id="logo" href="/ion">
Expand Down Expand Up @@ -217,11 +217,11 @@
</nav>
</header>


<aside id="sidebar"></aside>

<main>


<section id="hero" full-width>
<div id="hero_content">
Expand Down Expand Up @@ -346,7 +346,7 @@ <h2>5. Configure &amp; Build ION Microservices</h2>
<p>Clone <a href="https://github.com/decentralized-identity/ion:">https://github.com/decentralized-identity/ion:</a></p>
<pre><code>git clone https://github.com/decentralized-identity/ion
</code></pre>
<p>Example configuration files for both <code>testnet-</code> and <code>mainnet-</code> can be found under <a href="https://github.com/decentralized-identity/ion/tree/master/json">the top-level <code>json/</code> directory</a>.</p>
<p>Example configuration files for both <code>testnet-</code> and <code>mainnet-</code> can be found under <a href="https://github.com/decentralized-identity/ion/tree/master/config">the top-level <code>config/</code> directory</a>.</p>
<blockquote>
<p>NOTE: If not specified, <strong><code>json/testnet-*-*.json</code> files are used as default configuration values</strong>. Be sure to start with whichever config template (<code>testnet-</code> or <code>mainnet-</code>) is right for your use case.</p>
</blockquote>
Expand Down Expand Up @@ -418,8 +418,8 @@ <h3>(Optional) Create your configuration files from templates</h3>
</blockquote>
<p>Copy the configuration files <code>&lt;testnet or mainnet&gt;-core-config.json</code> and <code>&lt;testnet or mainnet&gt;-core-versioning.json</code> to another directory, (e.g. <code>/etc/ion/</code> or <code>~</code>)</p>
<p>Start a new console and run the following command to start the core service.</p>
<pre><code>ION_CORE_CONFIG_FILE_PATH=/usr/local/src/ion/json/testnet-core-config.json
ION_CORE_VERSIONING_CONFIG_FILE_PATH=/usr/local/src/ion/json/testnet-core-versioning.json
<pre><code>ION_CORE_CONFIG_FILE_PATH=/usr/local/src/ion/config/testnet-core-config.json
ION_CORE_VERSIONING_CONFIG_FILE_PATH=/usr/local/src/ion/config/testnet-core-versioning.json
npm run core
</code></pre>
<blockquote>
Expand All @@ -440,7 +440,7 @@ <h2>8. Verify ION is working properly</h2>

</main>


<footer id="footer">

<div>
Expand Down Expand Up @@ -468,12 +468,12 @@ <h4>Icons &amp; Design</h4>
<div>
<ul>
<li>
Some icons were made by <a href="https://www.flaticon.com/authors/freepik">Freepik</a>,
<a href="https://www.flaticon.com/authors/becris">Becris</a>,
<a href="https://www.flaticon.com/authors/eucalyp">Eucalyp</a>,
<a href="https://www.flaticon.com/authors/linector">Linector</a>,
<a href="https://www.flaticon.com/authors/pixel-perfect">Pixel Perfect</a>,
and <a href="https://www.flaticon.com/authors/vitaly-gorbachev">Vitaly Gorbachev</a>
Some icons were made by <a href="https://www.flaticon.com/authors/freepik">Freepik</a>,
<a href="https://www.flaticon.com/authors/becris">Becris</a>,
<a href="https://www.flaticon.com/authors/eucalyp">Eucalyp</a>,
<a href="https://www.flaticon.com/authors/linector">Linector</a>,
<a href="https://www.flaticon.com/authors/pixel-perfect">Pixel Perfect</a>,
and <a href="https://www.flaticon.com/authors/vitaly-gorbachev">Vitaly Gorbachev</a>
from <a href="https://www.flaticon.com/" title="Flaticon">Flaticon.com</a>.
</li>
</ul>
Expand All @@ -487,21 +487,21 @@ <h4>Icons &amp; Design</h4>

</footer>










<script src="/ion/js/compiled/body.js"></script>






<script src="/ion/js/imports/hero.js" ></script>

<script src="/ion/js/guide.js" type=module></script>


</body>

</html>
</html>
Loading

0 comments on commit e40e257

Please sign in to comment.