Feature/other containers (#692)

* Add block explorer to docker containers

* Add network explorer to docker containers

A private token is needed to build this container.

* Update docker README
This commit is contained in:
Bogdan-Ștefan Neacşu
2021-07-23 16:24:55 +03:00
committed by GitHub
parent 1d18def642
commit 2354828481
5 changed files with 134 additions and 3 deletions
+33
View File
@@ -51,7 +51,40 @@ services:
depends_on:
- "genesis_validator"
mongo:
image: mongo:latest
command:
- --storageEngine=wiredTiger
volumes:
- mongo_data:/data/db
block_explorer:
build:
context: https://github.com/forbole/big-dipper.git#v0.41.x-7
image: block_explorer:v0.41.x-7
ports:
- "3080:3000"
depends_on:
- "mongo"
environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb://mongo:27017/meteor
PORT: 3000
METEOR_SETTINGS: ${METEOR_SETTINGS}
network_explorer:
build:
context: docker/network_explorer
args:
PERSONAL_TOKEN: ${PERSONAL_TOKEN}
image: network_explorer:latest
ports:
- "3040:3000"
depends_on:
- "genesis_validator"
- "block_explorer"
volumes:
genesis_volume:
contract_volume:
mongo_data:
+14 -3
View File
@@ -5,16 +5,27 @@ Currently you can build and run locally in a Docker containers the following com
* One genesis validator
* Any number of secondary validators
* A contract uploader, that uploads the contract built from the local sources
* The web wallet application, accesible on port 3000
* The web wallet application, accessible on port 3000
* The block explorer application, accessible on port 3080
* The network explorer application, accessible on port 3040, for registered users
### Running
The following commands need to be run from the root of the Nym git project.
To start the dockerized environment, run the following command each time the local source code has changed:
To build the entire dockerized environment, run the following command:
```
docker-compose up --build -d --scale=secondary_validator=3
PERSONAL_TOKEN=[network explorer token] docker-compose build
```
or build each service separately, as changes are made to their relevant source code.
**Note** network-explorer build time is currently very high, so building it more than once is not advisable.
To start the dockerized environment, run the following command:
```
METEOR_SETTINGS=$(cat docker/block_explorer/settings.json) docker-compose up -d --scale=secondary_validator=3
```
**Note**: The `secondary_validator=3` can take any other number as value, depending on the desired setup.
+69
View File
@@ -0,0 +1,69 @@
{
"public":{
"chainName": "Nym",
"chainId": "nymnet",
"slashingWindow": 10000,
"uptimeWindow": 250,
"initialPageSize": 30,
"secp256k1": false,
"bech32PrefixAccAddr": "punk",
"bech32PrefixAccPub": "punkpub",
"bech32PrefixValAddr": "punkvaloper",
"bech32PrefixValPub": "punkvaloperpub",
"bech32PrefixConsAddr": "punkvalcons",
"bech32PrefixConsPub": "punkvalconspub",
"bondDenom": "punk",
"powerReduction": 1000000,
"coins": [
{
"denom": "upunk",
"displayName": "PUNK",
"fraction": 1000000
},
{
"denom": "punk",
"displayName": "PUNK",
"fraction": 1000000
}
],
"ledger":{
"coinType": 118,
"appName": "punk",
"appVersion": "2.16.0",
"gasPrice": 0.025
},
"modules": {
"bank": true,
"supply": true,
"minting": false,
"gov": true,
"distribution": false
},
"coingeckoId": "punk",
"networks": "https://gist.githubusercontent.com/kwunyeung/8be4598c77c61e497dfc7220a678b3ee/raw/bd-networks.json",
"banners": false
},
"remote":{
"rpc":"http://genesis_validator:26657",
"api":"http://genesis_validator:1317"
},
"debug": {
"startTimer": true
},
"params":{
"startHeight": 0,
"defaultBlockTime": 5000,
"validatorUpdateWindow": 300,
"blockInterval": 15000,
"transactionsInterval": 18000,
"keybaseFetchingInterval": 18000000,
"consensusInterval": 1000,
"statusInterval":7500,
"signingInfoInterval": 1800000,
"proposalInterval": 5000,
"missedBlocksInterval": 60000,
"delegationInterval": 900000
}
}
+8
View File
@@ -0,0 +1,8 @@
FROM node:14
ARG PERSONAL_TOKEN
RUN git clone "https://oauth2:${PERSONAL_TOKEN}@gitlab.nymte.ch/jessgess/network-explorer.git"
WORKDIR network-explorer
COPY ./setup.sh /setup.sh
RUN /setup.sh
CMD yarn dev
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
git checkout b1ba77461a50ab6b31b8384a8f8e348141b37a43
sed -i 's/https:\/\/testnet-finney-blocks.nymtech.net\//http:\/\/localhost:3080/' ./layouts/default.vue
sed -i 's/https:\/\/testnet-milhon-validator1.nymtech.net/http:\/\/localhost:26657/' networkVariables.json
sed -i 's/https:\/\/testnet-finney-blocks.nymtech.net\//http:\/\/localhost:3080/' pages/index.vue
yarn install