Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Apekshit Sharma <apekshit.sharma@hedera.com>
  • Loading branch information
apeksharma committed Nov 25, 2019
1 parent d7f0544 commit 5c0e8f8
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 31 deletions.
4 changes: 0 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,3 @@ jobs:
- *attach_workspace
- store_artifacts:
path: /tmp/workspace/artifacts

dependencies:
override:
- mvn install -DskipTests
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
*/target/**
target/
.project
/data/
mirror-importer/data/
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3.3'
version: "3.3"
services:
mirror-node-postgres:
mirror-db:
image: postgres:9.6-alpine
restart: unless-stopped
stop_grace_period: 2m
Expand All @@ -15,20 +15,20 @@ services:
ports:
- 5432:5432

mirror-node-backend:
image: hederahashgraph/mirror-node
mirror-importer:
image: hederahashgraph/mirror-importer
restart: unless-stopped
environment:
HEDERA_MIRROR_DATAPATH: /var/lib/mirror-node
HEDERA_MIRROR_DB_HOST: mirror-node-postgres
HEDERA_MIRROR_DATAPATH: /var/lib/mirror-importer
HEDERA_MIRROR_DB_HOST: mirror-db
HEDERA_MIRROR_DOWNLOADER_BUCKETNAME: ${BUCKET_NAME}
volumes:
- ./data:/var/lib/mirror-node
- ./data:/var/lib/mirror-importer

mirror-node-api:
image: hederahashgraph/mirror-node-api
mirror-rest:
image: hederahashgraph/mirror-rest
environment:
HEDERA_MIRROR_DB_HOST: mirror-node-postgres
HEDERA_MIRROR_DB_HOST: mirror-db
restart: unless-stopped
tty: true
ports:
Expand Down
15 changes: 8 additions & 7 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ Docker Compose scripts are provided and run all the mirror node components:
Containers use the following persisted volumes:

- `./db` on your local machine maps to `/var/lib/postgresql/data` in the containers. This contains the files for the
PostgreSQL database. If the database container fails to initialise properly and the database fails to run, you will have
to delete this folder prior to attempting a restart otherwise the database initialisation scripts will not be run.
PostgreSQL database. If the database container fails to initialise properly and the database fails to run, you will
have to delete this folder prior to attempting a restart otherwise the database initialisation scripts will not be
run.

- `./data` on your local machine maps to `/var/lib/mirror-node` in the container. This contains files downloaded from S3
or GCP. These are necessary not only for the database data to be persisted, but also so that the parsing containers can
access file obtained via the downloading containers
- `./data` on your local machine maps to `/var/lib/mirror-importer` in the container. This contains files downloaded
from S3 or GCP. These are necessary not only for the database data to be persisted, but also so that the parsing
containers can access file obtained via the downloading containers

### Starting

Expand All @@ -104,9 +105,9 @@ BUCKET_NAME=<your-bucket> docker-compose up
Shutting down the database container via `docker-compose down` may result in a corrupted database that may not restart
or may take longer than usual to restart. In order to avoid this, shell into the container and issue the following command:

Use `docker ps` to get the name of the database container, it should be something like `mirror-node-postgres`.
Use `docker ps` to get the name of the database container, it should be something like `mirror-db`.

Use the command `docker exec -it docker_mirror-node-postgres_1 /bin/sh` to get a shell in the container.
Use the command `docker exec -it docker_mirror-db_1 /bin/sh` to get a shell in the container.

`su - postgres -c "PGDATA=$PGDATA /usr/local/bin/pg_ctl -w stop"`

Expand Down
8 changes: 4 additions & 4 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ be no errors but you won't receive any new data after the restart event. To reco
1 ) Stop Mirror Node

```console
sudo systemctl stop mirror-node
sudo systemctl stop mirror-importer
```

2 ) Change Bucket Name and Region

```console
sudo vi /usr/etc/mirror-node/application.yml
sudo vi /usr/etc/mirror-importer/application.yml
```

3 ) Backup files

```console
cd /var/lib/mirror-node
cd /var/lib/mirror-importer
sudo mkdir backup20191114
sudo mv accountBalances eventsStreams recordstreams backup20191114/
```
Expand All @@ -115,5 +115,5 @@ psql -h dbhost -d mirror_node -U mirror_node -f cleanup.sql
5 ) Start Mirror Node

```console
sudo systemctl start mirror-node
sudo systemctl start mirror-importer
```
2 changes: 1 addition & 1 deletion mirror-importer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<version>${jib.version}</version>
<configuration>
<to>
<image>hederahashgraph/mirror-node</image>
<image>hederahashgraph/mirror-importer</image>
<tags>
<tag>${project.version}</tag>
</tags>
Expand Down
2 changes: 1 addition & 1 deletion mirror-importer/scripts/deploy-mirror-importer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ -f "/usr/lib/mirror-node/mirror-node.jar" ] || [ -f "${usrlib}/mirror-impor
systemctl stop ${oldjarname}.service || true

if [ -f "/usr/lib/mirror-node/mirror-node.jar" ]; then
echo "Migrating from 'mirror-node' to 'mirror-importer'"
echo "Migrating from 'mirror-node' to 'mirror-importer'"
oldjarname="mirror-node"
mv /usr/etc/mirror-node/* ${usretc}
mv /usr/lib/mirror-node/* ${usrlib}
Expand Down
2 changes: 1 addition & 1 deletion mirror-importer/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ logging:
#org.hibernate.type.descriptor.sql.BasicBinder: trace
spring:
application:
name: hedera-mirror-node
name: hedera-importer
datasource:
name: ${hedera.mirror.db.name}
password: ${hedera.mirror.db.password}
Expand Down
4 changes: 2 additions & 2 deletions mirror-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>hederahashgraph/mirror-node-api</argument>
<argument>hederahashgraph/mirror-rest</argument>
<argument>-t</argument>
<argument>hederahashgraph/mirror-node-api:${project.version}</argument>
<argument>hederahashgraph/mirror-rest:${project.version}</argument>
<argument>./</argument>
</arguments>
</configuration>
Expand Down

0 comments on commit 5c0e8f8

Please sign in to comment.