Skip to content

Commit

Permalink
Merge branch 'release-3.9'
Browse files Browse the repository at this point in the history
BE-535 Merge release-3.9 branch into master

* Updated release notes

Change-Id: Ie8c8e5aa80166746e49335bdaeac7261fae11ad3
Signed-off-by: nfrunza <nfrunza@gmail.com>
  • Loading branch information
nfrunza committed Feb 6, 2019
2 parents 9e8a944 + f56f3ea commit 5941ea1
Show file tree
Hide file tree
Showing 23 changed files with 864 additions and 3,061 deletions.
36 changes: 2 additions & 34 deletions CONFIG-CELLO-HLEXPLORER.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,6 @@ ed09a52dba0e hyperledger/fabric-orderer:1.1.0 "orderer" About an hour ago Up Abo
##Hyperledger Explorer configuration

/app/platform/fabric/config.json (change the configuration , request,event,server-hostname,tls_cacerts,admin(key,value), channelname,mspid,server-hostname,requests,tls_cacerts)
{
"network-config": {
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"peer1": {
"requests": "grpcs://127.0.0.1:7150",
"events": "grpcs://127.0.0.1:7050",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "/opt/cello/fabric-1.1/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"admin": {
"key": "/opt/cello/fabric-1.1/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
"cert": "/opt/cello/fabric-1.1/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
}
}
},
"channel": "businessChannel",
"orderers":[
{
"mspid": "OrdererMSP",
"server-hostname":"orderer.example.com",
"requests":"grpcs://127.0.0.1:8050",
"tls_cacerts":"/opt/cello/fabric-1.1/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
}
],
"keyValueStore": "/tmp/fabric-client-kvs",
"configtxgenToolPath": "fabric/fabric-samples/bin",
"SYNC_START_DATE_FORMAT":"YYYY/MM/DD",
"syncStartDate":"2018/01/01",
"eventWaitTime": "30000",
"license": "Apache-2.0",
"version": "1.1"
}

- Sample configuration provided, see file: blockchain-explorer/app/platform/fabric/config-cello.json.

39 changes: 1 addition & 38 deletions CONFIG-COMPOSER-HLEXPLORER.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,7 @@ you can open the ~/fabric-tools/DevServer_connectio.json and check , channels ,

based on that above file configuration we need to configure in Hyperledger Explorer config json ( network-config-name,mspid,peer(requests,events,server-hostname,tls_cacerts),admin(key,cert),channel and orderers(mspid,server_hostname,requests,tls_cacerts).

```
{
network-config: {
org1: {
name: Org1,
mspid: Org1MSP,
peer1: {
requests: grpc://127.0.0.1:7051,
events: grpc://127.0.0.1:7053,
server-hostname: peer0.org1.example.com,
tls_cacerts: /home/playground/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
},
admin: {
key: /home/playground/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore,
cert: /home/playground/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts
}
}
},
channel: composerchannel,
orderers: [{
mspid: OrdererMSP,
server-hostname: orderer.example.com,
requests: grpc://127.0.0.1:7050,
tls_cacerts: /home/playground/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt
}],
keyValueStore: /tmp/fabric-client-kvs,
configtxgenToolPath: /home/playground/fabric-samples/bin,
SYNC_START_DATE_FORMAT: YYYY/MM/DD,
syncStartDate: 2018/01/01,
eventWaitTime: 30000,
license: Apache-2.0,
version: 1.0
}
```
- Sample configuration provided, see file: blockchain-explorer/app/platform/fabric/config-composer.json.

## Run Hyperledger Explorer

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0

FROM node:8.11.3-alpine
FROM node:8.15.0-alpine

# default values pf environment variables
# that are used inside container
Expand Down
62 changes: 57 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Hyperledger Explorer is a simple, powerful, easy-to-use, highly maintainable, op

## Release Notes

- [Release Notes v0.3.9](release_notes/v0.3.9.md)
- [Release Notes v0.3.8](release_notes/v0.3.8.md)
- [Release Notes v0.3.7](release_notes/v0.3.7.md)
- [Release Notes v0.3.6.1](release_notes/v0.3.6.1.md)
Expand Down Expand Up @@ -64,7 +65,7 @@ Following are the software dependencies required to install and run hyperledger
* PostgreSQL 9.5 or greater
* Jq [https://stedolan.github.io/jq/]

Hyperledger Explorer works with Hyperledger Fabric 1.3. Install the following software dependencies to manage fabric network.
Hyperledger Explorer works with Hyperledger Fabric 1.4. Install the following software dependencies to manage fabric network.
* docker 17.06.2-ce [https://www.docker.com/community-edition]
* docker-compose 1.14.0 [https://docs.docker.com/compose/]

Expand All @@ -74,8 +75,8 @@ Hyperledger Explorer works with Hyperledger Fabric 1.3. Install the following s

Clone this repository to get the latest using the following command.

- `git clone https://github.com/hyperledger/blockchain-explorer.git`.
- `cd blockchain-explorer`.
- `git clone https://github.com/hyperledger/blockchain-explorer.git`
- `cd blockchain-explorer`

<a name="Database-Setup"/>

Expand Down Expand Up @@ -119,7 +120,7 @@ Connect to PostgreSQL database.

#### macOS

- `psql postgres`
- `psql postgres`

- `\l` view created fabricexplorer database
- `\d` view created tables
Expand All @@ -128,7 +129,8 @@ Connect to PostgreSQL database.

## Fabric Network Setup

Setup your own network using [Build your network](http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html) tutorial from Fabric. Once you setup the network, please modify the values in `/blockchain-explorer/app/platform/fabric/config.json` accordingly.
- Setup your own network using [Build your network](http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html) tutorial from Fabric. Once you setup the network, please modify the values in `/blockchain-explorer/app/platform/fabric/config.json` accordingly.
- Hyperledger Explorer defaults to [fabric-samples/first-network sample](https://github.com/hyperledger/fabric-samples).

<a name="Fabric-Configure-Hyperledger-Explorer"/>

Expand All @@ -142,6 +144,29 @@ On another terminal.
example: "/home/user1/workspace/fabric-samples" for the following keys: "tlsCACerts", "adminPrivateKey", "signedCert".
- Final path for key "tlsCACerts" will be: "/home/user1/workspace/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt".
- Modify "network-id.clients.client-id.channel" to your default channel for each client
- Sample configuration provided, see file: blockchain-explorer/app/platform/fabric/config-balance-transfer.json

### Configure to work with fabric-ca server

- `cd blockchain-explorer/app/platform/fabric`
- Modify config.json to add configurations related to CA server.
- Add "certificateAuthorities" to 2 sections
- The first one is for each organization to specify which CA server should be used
- network-configs > network-1 > organizations > Org* > certificateAuthorities
- The second one is for each network to access to CA server
- network-configs > network-1 > certificateAuthorities
- Please refer [here](https://hyperledger-fabric.readthedocs.io/en/latest/developapps/connectionprofile.html#sample) about more detail
- If leave certificateAuthorities of each organization empty, system will not use fabric-ca (it'll run with admin user)
- Modify config_ca.json to configure for your environment
- Configure admin ID and credential to register a new user to CA server
- Configure a user ID which is registered and enrolled as a user for managing blockchain explorer
- Another alternative to configure them is to use environment variables, example of setting:
```
export ENROLL_ID="hlbeuser"
export ENROLL_AFFILIATION=".department1"
export ADMIN_USERNAME="admin"
export ADMIN_SECRET="adminpw"
```

**or**

Expand Down Expand Up @@ -313,6 +338,33 @@ To push the container to your registry, run:

npm run docker_push


## Run Hyperledger Explorer using Docker-Compose

* Modify docker-compose.yaml to align with your environment
* networks > mynetwork.com > external > name
* services > explorer.mynetwork.com > volumes
* Connection profile path (ex. ./examples/net1/config.json)
* Directory path for crypto artifacts of fabric network (ex. ./examples/net1/crypto)
* Run the following to start up explore and explorer-db services

```
cd /some/where/blockchain-explorer
docker-compose up -d
```

* To stop services without removing persistent data, run the following:

```
docker-compose down
```

* In this docker-compose.yaml, 2 named volumes are allocated for persistent data (for Postgres data and user credential provided by fabric-ca)
* If you would like to clear these named volumes, run the following:
```
docker-compose down -v
```

## Hyperledger Explorer Swagger

- Once the Hyperledger Explorer has been launched go to http://localhost:8080/api-docs to view the Rust API description
Expand Down
8 changes: 6 additions & 2 deletions app/persistence/fabric/postgreSQL/db/createdb.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

#if [ $(whoami) != 'postgres' ]; then
# echo "You need to call as postgres user. sudo -u postgres $0"
# exit 1
#fi

echo "Copying ENV variables into temp file..."
node processenv.js
Expand Down Expand Up @@ -28,8 +32,8 @@ echo "Executing SQL scripts..."
case $OSTYPE in
darwin*) psql postgres -v dbname=$DATABASE -v user=$USER -v passwd=$PASSWD -f ./explorerpg.sql ;
psql postgres -v dbname=$DATABASE -v user=$USER -v passwd=$PASSWD -f ./updatepg.sql ;;
linux*) sudo -u postgres psql -v dbname=$DATABASE -v user=$USER -v passwd=$PASSWD -f ./explorerpg.sql ;
sudo -u postgres psql -v dbname=$DATABASE -v user=$USER -v passwd=$PASSWD -f ./updatepg.sql ;;
linux*) psql -v dbname=$DATABASE -v user=$USER -v passwd=$PASSWD -f ./explorerpg.sql ;
psql -v dbname=$DATABASE -v user=$USER -v passwd=$PASSWD -f ./updatepg.sql ;;
esac


Loading

0 comments on commit 5941ea1

Please sign in to comment.