forked from ic-matcom/test-network-optativo-nanobash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpeer2.sh
executable file
·51 lines (46 loc) · 2.45 KB
/
peer2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env sh
set -eu
if uname -r | grep -iq "wsl"
then
CCADDR="host.docker.internal"
else
CCADDR="127.0.0.1"
fi
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
export FABRIC_CFG_PATH="${PWD}"/../config
export FABRIC_LOGGING_SPEC=debug:cauthdsl,policies,msp,grpc,peer.gossip.mcs,gossip,leveldbhelper=info
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_TLS_CERT_FILE="${PWD}"/crypto-config/organizations/org2.example.com/peers/peer0.org2.example.com/tls/server.crt
export CORE_PEER_TLS_KEY_FILE="${PWD}"/crypto-config/organizations/org2.example.com/peers/peer0.org2.example.com/tls/server.key
export CORE_PEER_TLS_ROOTCERT_FILE="${PWD}"/crypto-config/organizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
export CORE_PEER_ID=peer0.org2.example.com
export CORE_PEER_ADDRESS=127.0.0.1:7055
export CORE_PEER_LISTENADDRESS=127.0.0.1:7055
export CORE_PEER_CHAINCODEADDRESS="${CCADDR}":7056
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7056
# bootstrap peer is the other peer in the same org
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7055
export CORE_PEER_GOSSIP_EXTERNALENDPOINT=127.0.0.1:7055
export CORE_PEER_LOCALMSPID=Org2MSP
export CORE_PEER_MSPCONFIGPATH="${PWD}"/crypto-config/organizations/org2.example.com/peers/peer0.org2.example.com/msp
export CORE_PEER_FILESYSTEMPATH="${PWD}"/data/peer0.org2.example.com
export CORE_LEDGER_SNAPSHOTS_ROOTDIR="${PWD}"/data/peer0.org2.example.com/snapshots
# used in metrics
export CORE_METRICS_PROVIDER=prometheus
export CORE_OPERATIONS_LISTENADDRESS=127.0.0.1:9446
# uncomment the lines below to utilize couchdb state database, when done with the environment you can stop the couchdb container with "docker rm -f couchdb3"
# export CORE_LEDGER_STATE_STATEDATABASE=CouchDB
# export CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=127.0.0.1:6984
# export CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=portainer
# export CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=N@rut0
## remove the container only if it exists
# CONTAINER_NAME=$(docker ps -aqf "NAME=worldstate_org2")
# if [ -z "$CONTAINER_NAME" -o "$CONTAINER_NAME" == " " ]; then
# echo "---- No world-state container available for deletion ----"
# else
# docker rm -f $CONTAINER_NAME
# fi
# docker run --publish 6984:5984 --detach -e COUCHDB_USER=portainer -e COUCHDB_PASSWORD=N@rut0 --name worldstate_org2 couchdb:3.1.1
# start peer
peer node start