Skip to content

Commit

Permalink
Customize Quick-Start docs by OS (hyperledger-labs#299)
Browse files Browse the repository at this point in the history
* README for Linux/Mac split

Signed-off-by: Jacob Kopczynski <[email protected]>

* README: how to update Docker image

Signed-off-by: Jacob Kopczynski <[email protected]>
  • Loading branch information
jkopczyn authored May 12, 2022
1 parent f26b8be commit 3db0d34
Showing 1 changed file with 58 additions and 32 deletions.
90 changes: 58 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,58 +275,80 @@ $ cd blockchain-explorer/app
```
$ cd blockchain-explorer/app/persistence/fabric/postgreSQL/db
$ ./createdb.sh
$ createdb `whoami`
```
Connect to the PostgreSQL database and run DB status commands:
* **Ubuntu**
```shell
sudo -u postgres psql -c '\l'
sudo -u postgres psql $DATABASE_DATABASE -c '\d'
```
* **MacOS**
```shell
psql -c '\l'
psql $DATABASE_DATABASE -c '\d'
```
Expected output
```shell
$ sudo -u postgres psql -c '\l'
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
----------------+----------+----------+---------+---------+-----------------------
fabricexplorer | hppoc | UTF8 | C.UTF-8 | C.UTF-8 |
postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
----------------+---------------------+----------+---------+---------+-----------------------
fabricexplorer | $DATABASE_USERNAME | UTF8 | C.UTF-8 | C.UTF-8 |
postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
$ sudo -u postgres psql fabricexplorer -c '\d'
$ sudo -u postgres psql $DATABASE_DATABASE -c '\d'
List of relations
Schema | Name | Type | Owner
--------+---------------------------+----------+-------
public | blocks | table | hppoc
public | blocks_id_seq | sequence | hppoc
public | chaincodes | table | hppoc
public | chaincodes_id_seq | sequence | hppoc
public | channel | table | hppoc
public | channel_id_seq | sequence | hppoc
public | orderer | table | hppoc
public | orderer_id_seq | sequence | hppoc
public | peer | table | hppoc
public | peer_id_seq | sequence | hppoc
public | peer_ref_chaincode | table | hppoc
public | peer_ref_chaincode_id_seq | sequence | hppoc
public | peer_ref_channel | table | hppoc
public | peer_ref_channel_id_seq | sequence | hppoc
public | transactions | table | hppoc
public | transactions_id_seq | sequence | hppoc
public | write_lock | table | hppoc
public | write_lock_write_lock_seq | sequence | hppoc
Schema | Name | Type | Owner
--------+---------------------------+----------+-------------------
public | blocks | table | $DATABASE_USERNAME
public | blocks_id_seq | sequence | $DATABASE_USERNAME
public | chaincodes | table | $DATABASE_USERNAME
public | chaincodes_id_seq | sequence | $DATABASE_USERNAME
public | channel | table | $DATABASE_USERNAME
public | channel_id_seq | sequence | $DATABASE_USERNAME
public | orderer | table | $DATABASE_USERNAME
public | orderer_id_seq | sequence | $DATABASE_USERNAME
public | peer | table | $DATABASE_USERNAME
public | peer_id_seq | sequence | $DATABASE_USERNAME
public | peer_ref_chaincode | table | $DATABASE_USERNAME
public | peer_ref_chaincode_id_seq | sequence | $DATABASE_USERNAME
public | peer_ref_channel | table | $DATABASE_USERNAME
public | peer_ref_channel_id_seq | sequence | $DATABASE_USERNAME
public | transactions | table | $DATABASE_USERNAME
public | transactions_id_seq | sequence | $DATABASE_USERNAME
public | write_lock | table | $DATABASE_USERNAME
public | write_lock_write_lock_seq | sequence | $DATABASE_USERNAME
(18 rows)
```

(On MacOS, expect to see your `` `whoami` `` rather than `postgres`. Entries with
`$DATABASE_USERNAME` will have the valuei of that parameter, whether set as an
environment variable or as a JSON keyval; it will not show the literal string.)

## Build Hyperledger Explorer

**Important:** repeat the below steps after every git pull

* `./main.sh install`
* To install, run tests, and build project
From the root of the repository:

- `./main.sh clean`
* To clean the /node_modules, client/node_modules client/build, client/coverage, app/test/node_modules
directories
* `./main.sh install`
* To install, run tests, and build project

Or

Expand Down Expand Up @@ -386,6 +408,10 @@ $ DISCOVERY_AS_LOCALHOST=false npm start
$ DISCOVERY_AS_LOCALHOST=false ./syncstart.sh
```
# Updating Docker image
To build a new version of the Docker image, use `npm run-script docker_build`. This creates a new image, which will become `hyperledger-explorer:latest` (distinct from the canonical images, which are `hyperledger/explorer`, with a `/`). This is a distinct build from the local version used in the Quick Start process. Run this image with `docker-compose down && docker-compose up -d`; both commands are needed.
# Configuration
Please refer [README-CONFIG.md](README-CONFIG.md) for more detail on each configuration.
Expand Down

0 comments on commit 3db0d34

Please sign in to comment.