Skip to content

Commit

Permalink
Merge pull request #9 from everledger/feature/fabric-operations-console
Browse files Browse the repository at this point in the history
feat: fabric operations console
  • Loading branch information
czar0 authored Feb 2, 2022
2 parents 11f308d + c2014f1 commit 459cac5
Show file tree
Hide file tree
Showing 25 changed files with 570 additions and 39 deletions.
12 changes: 9 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ FABKIT_COUCHDB_IMAGE="couchdb:3.1.1"
# HYPERLEDGER EXPLORER
########################################
FABKIT_EXPLORER_PATH="${FABKIT_ROOT}/explorer"
FABKIT_EXPLORER_VERSION=1.1.3
FABKIT_GRAFANA_VERSION=7.2.0
FABKIT_PROMETHEUS_VERSION=v2.21.0
# todo: set to fixed version. it does not work for apple silicon (workaround: build locally)
FABKIT_EXPLORER_VERSION=latest
FABKIT_GRAFANA_VERSION=8.2.2
FABKIT_PROMETHEUS_VERSION=v2.30.3
########################################
# HYPERLEDGER FABRIC CONSOLE
########################################
FABKIT_CONSOLE_PATH="${FABKIT_ROOT}/console"
FABKIT_CONSOLE_VERSION=latest
########################################
# THIRD PARTY
########################################
Expand Down
14 changes: 5 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
debug*
vendor/
dist/
.idea/

logs/
*.log*

network/cryptos/
network/channels/
data/
docker.sock

.DS_Store
*.tar*
*.zip
binary
binary_test

go.sum
*.pem

console/assets/
dist/
explorer/connection-profile/first-network.json
network/config/configtx.yaml
network/cryptos/
network/channels/
.lastrun
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,31 @@ fabkit explorer stop

Note: If you are using _docker-machine_ replace `localhost` with the docker-machine IP address. You can find this out by running `docker-machine ip`.

## Fabric Operations Console (aka IBM Blockchain Platform UI)

![Fabric Operations Console: Dashboard](./docs/images/console1.jpg)

Fabric Operations Console provides functionalities to manage Hyperledger Fabric components (peers, CAs, orderers) and perform operations on the network like installing, instantiating, upgrading chaincodes or creating new channels.

To start the console components:

```bash
fabkit console start
```

To stop and remove all console running components:

```bash
fabkit console stop
```

Accessing the console:

- Username: `admin` | Password: `password`
- Host: [http://localhost:3000](http://localhost:3000)

For additional information on how to configure and use the console check the [Fabric Operations Console](./docs/console.md) page.

## Register and enroll users

Fabkit offers full support to interact with a Fabric CA. To have a complete overview of the all available commands visit the [Fabric CA and user certificates management](./docs/ca.md) page.
Expand Down
84 changes: 84 additions & 0 deletions console/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
version: "2.4"

networks:
default:
external:
# This value should be the same for fabric network and client
name: ${FABKIT_DOCKER_NETWORK}

volumes:
console-couchdb:
name: ${FABKIT_DOCKER_NETWORK}_console-couchdb

services:
fabric-console:
container_name: fabric-console
image: ghcr.io/hyperledger-labs/fabric-console:latest
ports:
- "3000:3000"
volumes:
- ${FABKIT_HOST_ROOT}/console/env:/home/athena/env
environment:
- CONFIGURE_FILE=./env/config.yaml
- DB_CONNECTION_STRING=http://admin:password@console-couchdb:5984
- DB_SYSTEM=athena_system

configtxlator:
container_name: configtxlator
image: hyperledger/fabric-tools:${FABKIT_FABRIC_VERSION}
command: /bin/bash -c "/usr/local/bin/configtxlator start --CORS=*"
ports:
- "7059:7059"

console-couchdb:
container_name: console-couchdb
extends:
file: ${FABKIT_NETWORK_PATH}/base/base.yaml
service: couchdb-base
environment:
- COUCHDB_USER=admin
- COUCHDB_PASSWORD=password
volumes:
- "console-couchdb:/opt/couchdb/data"
ports:
- "5985:5984"

proxy.peer0.org1.example.com:
container_name: proxy.peer0.org1.example.com
image: ghcr.io/hyperledger-labs/grpc-web:latest
environment:
- BACKEND_ADDRESS=peer0.org1.example.com:7051
- SERVER_TLS_CERT_FILE=/certs/tls/server.crt
- SERVER_TLS_KEY_FILE=/certs/tls/server.key
- BACKEND_TLS_CA_FILES=/certs/tls/ca.crt
- SERVER_BIND_ADDRESS=0.0.0.0
- SERVER_HTTP_DEBUG_PORT=8080
- SERVER_HTTP_TLS_PORT=7443
- BACKEND_TLS=true
- SERVER_HTTP_MAX_WRITE_TIMEOUT=5m
- SERVER_HTTP_MAX_READ_TIMEOUT=5m
- USE_WEBSOCKETS=true
volumes:
- ${FABKIT_HOST_ROOT}/network/cryptos/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/certs/tls
ports:
- "7443:7443"

proxy.orderer.example.com:
container_name: proxy.orderer.example.com
image: ghcr.io/hyperledger-labs/grpc-web:latest
environment:
- BACKEND_ADDRESS=orderer.example.com:7050
- SERVER_TLS_CERT_FILE=/certs/tls/server.crt
- SERVER_TLS_KEY_FILE=/certs/tls/server.key
- BACKEND_TLS_CA_FILES=/certs/tls/ca.crt
- SERVER_BIND_ADDRESS=0.0.0.0
- SERVER_HTTP_DEBUG_PORT=8082
- SERVER_HTTP_TLS_PORT=7445
- BACKEND_TLS=true
- SERVER_HTTP_MAX_WRITE_TIMEOUT=5m
- SERVER_HTTP_MAX_READ_TIMEOUT=5m
- USE_WEBSOCKETS=true
volumes:
- ${FABKIT_HOST_ROOT}/network/cryptos/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/certs/tls
ports:
- "7445:7445"
8 changes: 8 additions & 0 deletions console/env/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
version: v1.0
app_port: 3000
auth_scheme: couchdb
initial_admin: admin
configtxlator_url_original: http://localhost:7059
host_url: http://localhost:3000
default_user_password_initial: password
11 changes: 11 additions & 0 deletions console/templates/Certificate_Authorities/ordererca-local_ca.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"display_name": "ordererca - local",
"api_url": "https://ca_orderer:9054",
"operations_url": "http://ca_orderer:19054",
"ca_url": "https://ca_orderer:9054",
"type": "fabric-ca",
"ca_name": "ca-orderer",
"tlsca_name": "ca-orderer",
"tls_cert": "<TLS_CERT>",
"name": "ordererca - local"
}
11 changes: 11 additions & 0 deletions console/templates/Certificate_Authorities/orgca-local_ca.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"display_name": "org%ORG%ca - local",
"api_url": "https://ca.org%ORG%.example.com:7054",
"operations_url": "http://ca.org%ORG%.example.com:1%PORT_INDEX%054",
"ca_url": "https://ca.org%ORG%.example.com:7054",
"name": "org%ORG%ca - local",
"type": "fabric-ca",
"ca_name": "ca.org%ORG%.example.com",
"tlsca_name": "ca.org%ORG%.example.com",
"tls_cert": ""
}
30 changes: 30 additions & 0 deletions console/templates/Ordering_Services/orderer-local_orderer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"display_name": "ordering node - local",
"grpcwp_url": "https://proxy.orderer.example.com:7445",
"api_url": "grpcs://orderer.example.com:7050",
"operations_url": "http://orderer.example.com:17050",
"type": "fabric-orderer",
"msp_id": "OrdererMSP",
"system_channel_id": "orderer-system-channel",
"cluster_id": "kcfhqzuxci",
"cluster_name": "orderer_local",
"name": "ordering node - local",
"msp": {
"component": {
"tls_cert": ""
},
"ca": {
"root_certs": [
""
]
},
"tlsca": {
"root_certs": [
""
]
}
},
"pem": "",
"tls_cert": "",
"tls_ca_root_cert": ""
}
33 changes: 33 additions & 0 deletions console/templates/Organizations/orderermsp_msp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"display_name": "Orderer MSP",
"msp_id": "OrdererMSP",
"type": "msp",
"admins": [],
"root_certs": [
""
],
"tls_root_certs": [
""
],
"fabric_node_ous": {
"admin_ou_identifier": {
"certificate": "",
"organizational_unit_identifier": "admin"
},
"client_ou_identifier": {
"certificate": "",
"organizational_unit_identifier": "client"
},
"enable": true,
"orderer_ou_identifier": {
"certificate": "",
"organizational_unit_identifier": "orderer"
},
"peer_ou_identifier": {
"certificate": "",
"organizational_unit_identifier": "peer"
}
},
"host_url": "http://localhost:3002",
"name": "Orderer MSP"
}
33 changes: 33 additions & 0 deletions console/templates/Organizations/orgmsp_msp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"display_name": "Org%ORG% MSP",
"msp_id": "Org%ORG%MSP",
"type": "msp",
"admins": [],
"root_certs": [
""
],
"tls_root_certs": [
""
],
"fabric_node_ous": {
"admin_ou_identifier": {
"certificate": "",
"organizational_unit_identifier": "admin"
},
"client_ou_identifier": {
"certificate": "",
"organizational_unit_identifier": "client"
},
"enable": true,
"orderer_ou_identifier": {
"certificate": "",
"organizational_unit_identifier": "orderer"
},
"peer_ou_identifier": {
"certificate": "",
"organizational_unit_identifier": "peer"
}
},
"host_url": "http://localhost:3002",
"name": "Org%ORG% MSP"
}
28 changes: 28 additions & 0 deletions console/templates/Peers/org_peer-local_peer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"display_name": "org%ORG%_peer0 - local",
"grpcwp_url": "https://proxy.peer0.org%ORG%.example.com:%PORT_INDEX%443",
"api_url": "grpcs://peer0.org%ORG%.example.com:%PORT_INDEX%051",
"operations_url": "http://peer0.org%ORG%.example.com:1%PORT_INDEX%051",
"msp_id": "Org%ORG%MSP",
"name": "org%ORG%_peer0 - local",
"type": "fabric-peer",
"msp": {
"component": {
"admin_certs": [],
"tls_cert": ""
},
"ca": {
"root_certs": [
""
]
},
"tlsca": {
"root_certs": [
""
]
}
},
"pem": "",
"tls_cert": "",
"tls_ca_root_cert": ""
}
Loading

0 comments on commit 459cac5

Please sign in to comment.