Skip to content

Commit

Permalink
Merge pull request #107 from debridge-finance/mainnet-release/v2.1.0
Browse files Browse the repository at this point in the history
Mainnet release/v2.1.0
  • Loading branch information
artyukh authored Mar 9, 2022
2 parents 383ad32 + 2f05559 commit 2ac9fd3
Show file tree
Hide file tree
Showing 77 changed files with 3,370 additions and 56,265 deletions.
6 changes: 6 additions & 0 deletions .default.env
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ JWT_SECRET=FNJjknsjsnfnsfjskjnf
API_LOGIN=login
# TODO: update with your value
API_PASSWORD=password

THROTTLER_TTL=60
THROTTLER_LIMIT=10
WEB3_TIMEOUT=30000

ENABLE_DATAFIX=true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ data
/orbitdb/orbitdb/*

.DS_Store
heap_info.json
heap_info.json
config/chains_config.json
137 changes: 11 additions & 126 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ In order to set up the validation node, the following steps should be performed:
- https://github.com/nodesource/distributions/blob/master/README.md
5. psql
``` sudo apt-get install postgresql-client```

### Check that your version of docker-compose not older than

```
docker-compose --version
docker-compose version 1.29.2
```

## Set up the blockchain infrastructure:
1. Install full testnet nodes
Expand All @@ -46,7 +53,7 @@ In order to set up the validation node, the following steps should be performed:
2. Update HTTP RPC URL in /config/chains_config.json

3. Copy `.default.env` file and rename it to `.env`. Change default POSTGRES_PASSWORD, POSTGRES_USER credentials in .env file. During the first run (point 9) Postgres database will be automatically created with these credentials.
deBridge node has an embedded API through which node operator can authorize, query last scanned blocks, or rescan blockchain from the specific block. By default deBridge node is deployed on DEBRIDGE_NODE_PORT from .env file. Update JWT_SECRET, API_LOGIN, API_PASSWORD, ORBITDB_JWT_SECRET, ORBITDB_LOGIN, ORBITDB_PASSWORD to randomly generated ones. If you use sentry to track any errors of the node, please update SENTRY_DSN at .env file.
deBridge node has an embedded API through which node operator can authorize, query last scanned blocks, or rescan blockchain from the specific block. By default deBridge node is deployed on DEBRIDGE_NODE_PORT from .env file. Update JWT_SECRET, API_LOGIN, API_PASSWORD to randomly generated ones. If you use sentry to track any errors of the node, please update SENTRY_DSN at .env file.

4. Create a keystore file for the validation node. Script from `generate-keystore` folder can be used. To start generating new keystore info:
- npm i
Expand All @@ -58,10 +65,7 @@ The script will show the newly generated Ethereum address, private key, password
6. Store the password that decrypts the key from `keystore` in the .env file KEYSTORE_PASSWORD.
7. Contact deBridge team to make your wallet address to be whitelisted by deBridge governance
8. Run the command `docker-compose up --build -d`.
9. Backup and do not delete any files from the following directories:
- `./data/orbitdb`
- `./data/ipfs`
10. If there is a need to start multiple instances of the node (e.g. one for testnet and one for mainnet) on one server you can:
9. If there is a need to start multiple instances of the node (e.g. one for testnet and one for mainnet) on one server you can:
- checkout or copy repo to the new directory
- change DOCKER_ID variable in .env
- start as described above
Expand All @@ -72,18 +76,7 @@ The script will show the newly generated Ethereum address, private key, password
git pull
# Run debridge node
docker-compose up -d
```

# Pinners list
- `/ip4/139.59.164.64/tcp/4001/p2p/12D3KooWA84FLvoJb2QPut134ej9s4hukwmwpZ5DQXbebNBfogdk`
- `/ip4/161.35.31.27/tcp/4001/p2p/12D3KooWAfR9K7y4Y63dbCJ3io58dgTtFM3F2nycFWLo1LJg3Z1k`
- `/ip4/164.90.237.61/tcp/4001/p2p/12D3KooWDZxx4TMUjQzqqQAdZKUWNWAamcoBkMWBKfNnfLMSM6mP`
- `/dnsaddr/londonswarm.debridge.io/p2p/12D3KooWA84FLvoJb2QPut134ej9s4hukwmwpZ5DQXbebNBfogdk`

To add node to the bootstrap list manually, you can use the command:
```shell
docker-compose exec ipfs-daemon ipfs bootstrap add "$PINNER_ADDRESS"
docker-compose up -d --remove-orphans
```

# Miscellaneous
Expand All @@ -103,113 +96,5 @@ docker exec -it $(docker-compose ps | grep postgres | awk '{print $1}') psql -v
- deBridge node
3. It's recommended to check `docker-compose logs` for ERROR
# Changelog
## v1.1.2 (10.12.2021)
* add checker for chains_config
* fix config volume mounting
* send debridge-node version to the debridge
* create public ipfs-daemon image
**Full Changelog**: https://github.com/debridge-finance/debridge-launcher/compare/v1.1.1...v1.1.2
## How to update to v1.1.2
### 1. Pull latest changes
```shell
git checkout master
git pull
```
### 2. Run
```shell
docker-compose up -d
```

## v1.1.1 (27.11.2021)
- A component responsible for storing data in IPFS was moved to a separate service - orbitdb
- Fix LogConfirmNewAssets sending to orbitdb
- Add new env vars for orbitdb service and update .default.env to use specific sections for each service

### How to update to v1.1.1
#### 1. Fetch and checkout to the right tag
```shell
git fetch && git checkout v1.1.1
```
#### 2. Since the new orbitdb service was created, you should add following envs to your .env file:
```shell
- ORBITDB_JWT_SECRET # JWT random string. We recommend using upper and lower case symbols, numbers. The length should be at least 30 characters.
- ORBITDB_LOGIN # create a login to orbitdb API authentication
- ORBITDB_PASSWORD # create a strong password to orbitdb API authentication
- ORBITDB_PORT=3000
- ORBITDB_NODE_OPTIONS=--max_old_space_size=8192
- DEBRIDGE_NODE_NODE_OPTIONS=--max_old_space_size=8192
- ORBITDB_URL=http://orbitdb${DOCKER_ID}:${ORBITDB_PORT} # ORBITDB_PORT and DOCKER_ID should be set before ORBITDB_URL
```
![changed env vars](./assets/changed-env-vars-v1_1_1.png)
**Note: you can find the full list of env vars that you should need to setting up at the .default.env file. The simplest way to check if your .env file is up to date is to backup current .env file, recreate it from .default.env and update it with your values from your original .env.backup file**:
```shell
cp .env .env.backup
cp .default.env .env
vi .env
```

#### 3. Run
```shell
docker-compose up -d
```

## v1.1.0 (25.11.2021)
- Move orbitdb to a separate service
- Add checker for chains_config RPC correctness
- Add monitorings (mounts to the stats directory at host)
- Add node options env for debridge-node and orbitdb services to the .env
- Disable postgres logging for debridge-node

### How to update to v1.1.0
```shell
# pull the latest version
git pull
git checkout v1.1.0
# update .env file:
# 1. add env var `ORBITDB_NODE_OPTION=--max_old_space_size=8192`
# 2. add env var `DEBRIDGE_NODE_NODE_OPTION=--max_old_space_size=8192`
# you can find the full list of env vars at `.default.env`
# if `./config/chains_config.json` doesn't exist create it from `./config/chains_config_default.json`
cp ./config/chains_config_default.json ./config/chains_config.json
# and update ./config/chains_config.json with your values
# run new version
docker-compose up —build -d
```

## v1.0.2 (20.11.2021)
- debridge-node: add timeout for http requests
- ipfs-daemon: config node with entrypoint.sh script
- docker-compose.yml: update env vars for debridge-node service
- .env: update vars for postgres and add variable `IPFS_URL`
### How to update to v1.0.2
```shell
# pull the latest version
git pull
# update .env file as on the screenshot:
# 1. remove `EI_DATABASE`
# 2. change `POSTGRES_MULTIPLE_DATABASES=${EI_DATABASE}` to `POSTGRES_DATABASE=ei${PG_RANDOM_ID}`
# 3. add env var `IPFS_URL=http://ipfs-daemon${DOCKER_ID}:5001/api/v0`
# create ./config/chains_config.json from ./config/chains_config_default.json
cp ./config/chains_config_default.json ./config/chains_config.json
# update ./config/chains_config.json with your values
# run new version
docker-compose up —build -d
```
![change env vars](./assets/changed-env-vars-v1_0_2.png)

## v1.0.0 (27.10.2021)
- Change javascript instance of IPFS to separate service, which runs [go-IPFS](https://github.com/ipfs/go-ipfs) daemon.
- Move orbitdb mounting directory on the host to the top level at `./data/orbitdb`.
- Added ARBITRUM testnet to [config/chains_config.json](https://github.com/debridge-finance/debridge-launcher/tree/master/config)
- Added Sentry. If you are using sentry, please update SENTRY_DSN at .env file.
- Removed DEBRIDGE_API_ACCESS_KEY. We support validators auth by signing message with private key
# [Changelog](./changelog.md)
Binary file added assets/changed-env-vars-v2_1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/multiple-rpc-providers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/update-chains-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
199 changes: 199 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
<br/>
<p align="center">
<a href="https://debridge.finance/" target="_blank">
<img src="https://user-images.githubusercontent.com/10200871/137014801-40decb80-0595-4f0f-8ee5-f0f1ab5c0380.png" width="225" alt="logo">
</a>
</p>
<br/>

# Changelog

## v2.1.0(09.03.2022)
* Added support for multinode rpc connection
* Validate nonce before saving event to the database
* Refactor debrige-node Dockerfile and docker-compose
* Fix leaking connections to the rpc provider
* Add basic auth for node rpc

## How to update to v2.1.0
```shell
git checkout mainnet
git pull origin mainnet
```
### 2. Update .env file with new env var:
```
THROTTLER_TTL=60
THROTTLER_LIMIT=10
WEB3_TIMEOUT=30000
ENABLE_DATAFIX=true
```
![update env vars](assets/changed-env-vars-v2_1_0.png)


### 3. Optional. If you need to use multiple rpc providers or setting up basic auth just update config/chains_config.json as follow::
![multiple rpc providers](./assets/update-chains-config.png)
### 4. Run debridge-node
```shell
docker-compose up -d --build --remove-orphans
```

<br/>

## v1.1.4 (24.12.2021)
* temporary removed ipfs and orbitdb service
* applied halborn security audit

**Full Changelog**: https://github.com/debridge-finance/debridge-launcher/compare/v1.1.3...v1.1.4

## How to update to v1.1.4
### 1. Pull latest changes
```shell
git checkout master

git pull
```
### 2. Add env vars to .env file:
```
THROTTLER_TTL=60
THROTTLER_LIMIT=10
```
### 3. Run
```shell
docker-compose up -d --remove-orphans
```

<br/>

## v1.1.3 (20.12.2021)
* add timeout for Web3 requests

**Full Changelog**: https://github.com/debridge-finance/debridge-launcher/compare/v1.1.2...v1.1.3

## How to update to v1.1.3
### 1. Pull latest changes
```shell
git checkout master
git pull
```
### 2. Run
```shell
docker-compose up -d
```
<br/>

## v1.1.2 (10.12.2021)
* add checker for chains_config
* fix config volume mounting
* send debridge-node version to the debridge
* create public ipfs-daemon image

**Full Changelog**: https://github.com/debridge-finance/debridge-launcher/compare/v1.1.1...v1.1.2

## How to update to v1.1.2
### 1. Pull latest changes
```shell
git checkout master
git pull
```
### 2. Run
```shell
docker-compose up -d
```

<br/>

## v1.1.1 (27.11.2021)
- A component responsible for storing data in IPFS was moved to a separate service - orbitdb
- Fix LogConfirmNewAssets sending to orbitdb
- Add new env vars for orbitdb service and update .default.env to use specific sections for each service

### How to update to v1.1.1
#### 1. Fetch and checkout to the right tag
```shell
git fetch && git checkout v1.1.1
```
#### 2. Since the new orbitdb service was created, you should add following envs to your .env file:
```shell
- ORBITDB_JWT_SECRET # JWT random string. We recommend using upper and lower case symbols, numbers. The length should be at least 30 characters.
- ORBITDB_LOGIN # create a login to orbitdb API authentication
- ORBITDB_PASSWORD # create a strong password to orbitdb API authentication
- ORBITDB_PORT=3000
- ORBITDB_NODE_OPTIONS=--max_old_space_size=8192
- DEBRIDGE_NODE_NODE_OPTIONS=--max_old_space_size=8192
- ORBITDB_URL=http://orbitdb${DOCKER_ID}:${ORBITDB_PORT} # ORBITDB_PORT and DOCKER_ID should be set before ORBITDB_URL
```
![changed env vars](./assets/changed-env-vars-v1_1_1.png)
**Note: you can find the full list of env vars that you should need to setting up at the .default.env file. The simplest way to check if your .env file is up to date is to backup current .env file, recreate it from .default.env and update it with your values from your original .env.backup file**:
```shell
cp .env .env.backup
cp .default.env .env
vi .env
```

#### 3. Run
```shell
docker-compose up -d
```

<br/>

## v1.1.0 (25.11.2021)
- Move orbitdb to a separate service
- Add checker for chains_config RPC correctness
- Add monitorings (mounts to the stats directory at host)
- Add node options env for debridge-node and orbitdb services to the .env
- Disable postgres logging for debridge-node

### How to update to v1.1.0
```shell
# pull the latest version
git pull
git checkout v1.1.0
# update .env file:
# 1. add env var `ORBITDB_NODE_OPTION=--max_old_space_size=8192`
# 2. add env var `DEBRIDGE_NODE_NODE_OPTION=--max_old_space_size=8192`
# you can find the full list of env vars at `.default.env`
# if `./config/chains_config.json` doesn't exist create it from `./config/chains_config_default.json`
cp ./config/chains_config_default.json ./config/chains_config.json
# and update ./config/chains_config.json with your values
# run new version
docker-compose up —build -d
```

<br/>

## v1.0.2 (20.11.2021)
- debridge-node: add timeout for http requests
- ipfs-daemon: config node with entrypoint.sh script
- docker-compose.yml: update env vars for debridge-node service
- .env: update vars for postgres and add variable `IPFS_URL`
### How to update to v1.0.2
```shell
# pull the latest version
git pull
# update .env file as on the screenshot:
# 1. remove `EI_DATABASE`
# 2. change `POSTGRES_MULTIPLE_DATABASES=${EI_DATABASE}` to `POSTGRES_DATABASE=ei${PG_RANDOM_ID}`
# 3. add env var `IPFS_URL=http://ipfs-daemon${DOCKER_ID}:5001/api/v0`
# create ./config/chains_config.json from ./config/chains_config_default.json
cp ./config/chains_config_default.json ./config/chains_config.json
# update ./config/chains_config.json with your values
# run new version
docker-compose up —build -d
```
![change env vars](./assets/changed-env-vars-v1_0_2.png)

## v1.0.0 (27.10.2021)
- Change javascript instance of IPFS to separate service, which runs [go-IPFS](https://github.com/ipfs/go-ipfs) daemon.
- Move orbitdb mounting directory on the host to the top level at `./data/orbitdb`.
- Added ARBITRUM testnet to [config/chains_config.json](https://github.com/debridge-finance/debridge-launcher/tree/master/config)
- Added Sentry. If you are using sentry, please update SENTRY_DSN at .env file.
- Removed DEBRIDGE_API_ACCESS_KEY. We support validators auth by signing message with private key
Loading

0 comments on commit 2ac9fd3

Please sign in to comment.