Add v1.3.0

pull/126/head
Baohua Yang 2018-10-11 13:53:01 +08:00
parent 8c92d1c0f1
commit afaa0195f9
451 changed files with 221954 additions and 54977 deletions

View File

@ -2,7 +2,7 @@
This project provides several useful Docker-Compose script to help quickly bootup a Hyperledger Fabric network, and do simple testing with deploy, invoke and query transactions.
Currently we support Hyperledger Fabric v0.6.x and v1.x.
Currently we support Hyperledger Fabric all releases from v0.6 to latest v1.x.
If you're not familiar with Docker and Blockchain, can have a look at these books (in CN):
@ -13,30 +13,35 @@ If you're not familiar with Docker and Blockchain, can have a look at these book
Fabric Release | Description
--- | ---
[Fabric v0.6.0](v0.6.0/) | fabric v0.6.0 release (too old, not recommend to use).
[Fabric v1.0.0](v1.0.0/) | fabric v1.0.0 release.
[Fabric v1.0.2](v1.0.2/) | fabric v1.0.2 release.
[Fabric v1.0.5](v1.0.5/) | fabric v1.0.5 release.
[Fabric Latest](latest/) | latest fabric code, unstable.
[Fabric v1.3.0](v1.3.0/) | stable fabric 1.3.0 release.
[Fabric v1.2.0](v1.2.0/) | stable fabric 1.2.0 release.
[Fabric v1.1.0](v1.1.0/) | stable fabric 1.1.0 release.
[Fabric v1.0.6](v1.0.6/) | fabric v1.0.6 release.
[Fabric v1.1.0](v1.1.0/) | latest stable fabric 1.1.0 release.
[Fabric v1.2.0](v1.2.0/) | latest stable fabric 1.2.0 release.
[Fabric Latest](latest/) | experimental with latest fabric code, unstable.
[Fabric v1.0.5](v1.0.5/) | fabric v1.0.5 release.
[Fabric v1.0.2](v1.0.2/) | fabric v1.0.2 release.
[Fabric v1.0.0](v1.0.0/) | fabric v1.0.0 release.
[Fabric v0.6.0](v0.6.0/) | fabric v0.6.0 release (too old, not recommend to use).
## Getting Started
### TLDR
RELEASE=v1.3.0
```bash
$ cd v1.2.0; make
$ cd ${RELEASE}; make setup test
```
More details are releaved below.
### Pick up a fabric version
Enter the subdir of specific version, e.g.,
Enter the subdir of specific version and setup, e.g.,
```bash
$ cd v1.2.0 # select a fabric version
$ cd ${RELEASE} # select a fabric version
$ make setup download # Install docker/compose, and pull required images
```
### Quick Test
@ -44,7 +49,6 @@ $ cd v1.2.0 # select a fabric version
The following command will run the entire process (start a fabric network, create channel, test chaincode and stop it.) pass-through.
```bash
$ make setup download # Install docker/compose, and pull required images
$ make test # Test with default fabric solo mode
```
@ -62,10 +66,6 @@ $ HLF_MODE=be make test # Start a blockchain-explorer to view network info
See [detailed steps](docs/steps.md)
## TODO
* Support boot up a fabric network with hyperledger composer
## Acknowledgement
* [Hyperledger Fabric](https://github.com/hyperledger/fabric/) project.

View File

@ -0,0 +1,3 @@
FABRIC_IMG_TAG=latest
EXT_IMG_TAG=amd64-0.4.13
NETWORK=hlf_net

View File

@ -8,7 +8,6 @@ SHELL:=/bin/bash
# mode of the network: solo, kafka, couchdb, event, dev
HLF_MODE ?= solo
HLF_VERSION ?= latest
CODE_BUILD_WAIT=40 # time to wait to build peer/orderer from local code
NETWORK_INIT_WAIT=2 # time to wait the fabric network finish initialization

View File

@ -11,7 +11,7 @@ services:
extends:
file: base.yaml
service: orderer-base
image: yeasy/hyperledger-fabric:latest
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
container_name: orderer.example.com
hostname: orderer.example.com
ports:
@ -38,7 +38,7 @@ services:
extends:
file: base.yaml
service: peer-base
image: yeasy/hyperledger-fabric:latest
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
container_name: peer0.org1.example.com
hostname: peer0.org1.example.com
environment:
@ -67,7 +67,7 @@ services:
extends:
file: base.yaml
service: cli-base
image: yeasy/hyperledger-fabric:latest
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
container_name: fabric-cli
hostname: fabric-cli
tty: true

View File

@ -18,15 +18,17 @@ version: '2' # compose v3 still doesn't support `extends`, shame!
services:
ca-base:
image: yeasy/hyperledger-fabric-ca:latest
image: yeasy/hyperledger-fabric-ca:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_TLS_ENABLED=true # change to false to disable TLS
orderer-base:
image: yeasy/hyperledger-fabric-orderer:latest
image: yeasy/hyperledger-fabric-orderer:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
# Default config can be found at https://github.com/hyperledger/fabric/blob/master/orderer/common/localconfig/config.go
environment:
- ORDERER_GENERAL_LOGLEVEL=DEBUG # default: INFO
@ -56,13 +58,14 @@ services:
command: orderer start
peer-base: # abstract base for fabric-peer, will be used in peer.yaml
image: yeasy/hyperledger-fabric-peer:latest
image: yeasy/hyperledger-fabric-peer:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
environment:
- CORE_PEER_ADDRESSAUTODETECT=false
- CORE_LOGGING_LEVEL=DEBUG
- CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=latest_default # uncomment this to use specific network
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${NETWORK} # uncomment this to use specific network
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false # whether this node is the org leader, default to false
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=0.0.0.0:7051 # external addr for peers in other orgs
@ -85,8 +88,9 @@ services:
command: peer node start
cli-base:
image: yeasy/hyperledger-fabric:latest
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
environment:
- CORE_LOGGING_LEVEL=DEBUG
@ -98,8 +102,9 @@ services:
#deprecated
event-listener-base:
image: yeasy/hyperledger-fabric:latest
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
environment:
- CORE_PEER_ID=fabric-event-listener
@ -110,8 +115,9 @@ services:
command: bash -c 'while true; do sleep 20170504; done'
zookeeper-base:
image: hyperledger/fabric-zookeeper:amd64-0.4.13
image: hyperledger/fabric-zookeeper:${EXT_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
expose:
- '2181'
@ -121,8 +127,9 @@ services:
kafka-base:
# official repo doesn't have 1.1.0-alpha tag, however, kafka changes version recently
#image: yeasy/hyperledger-fabric-kafka:0.10.2.0
image: hyperledger/fabric-kafka:amd64-0.4.13
image: hyperledger/fabric-kafka:${EXT_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
environment:
- KAFKA_MESSAGE_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
@ -133,8 +140,9 @@ services:
- '9092'
couchdb-base:
image: hyperledger/fabric-couchdb:amd64-0.4.13
image: hyperledger/fabric-couchdb:${EXT_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
explorer-base:
@ -146,5 +154,11 @@ services:
mysql-base: # mysql service
image: mysql:8.0
restart: always
network_mode: ${NETWORK}
expose:
- "3306"
networks:
default:
external:
name: ${NETWORK}

View File

@ -0,0 +1,18 @@
OU
Role
EnrollmentID
RevocationHandleD
/KÙ—\TMÖ°NÉ®ðc[½ó_­Óš €»?8þñr´-<2D>`—S¸Á!*1WØø~þ¿þöD
Ò!ÐÂR"$“ºDþeR¢œoö{Ù%‡{„ú¾ c†Û¾ CO?wê=Û¦(\Ó¹Z<C2B9>üEª§ï«\Ût‡"D
÷s€“@É´O<C2B4>ojRA£hÙ¬ùn¥
Á3ÀRUEÇy¯> FÆ0mpPr»è{ÚV㥟¦æpö¡ÀM¨ù gèn"D
ÀKV¨Q£Ì•OÐÄ|ß!š°R*!å¹îàW<1B>àdˆ tT@w.ÛáŸù' mùüp¶"Qã2t[ñ<>#™Ñ„"D
¹ppŸ²¨•ž9J8wÎœú <™è× [™,>˜OÀH€
Ïô?[®‰ztýP_Á-gto+«4Ô³æ?$"D
<20>º¡)T¦p3o<sÆ6MŽý ~Ñx×]x È 笴.)ûºÿäKÌ!_IÒá=åD•î*•îÜú*ˆ
€G£e—Ã÷†xùh”X±MHY¬Ï±½h±£PB„½ ^Ï„/„aÔÃù`Æ™ï\áJHay¨
Ùñ`­BäyÑÐÓ OëŠÊõGf‰ôͨKÞXåEËð|~°:<16>¾ " <20>Sr{ȼtÕ³D•¶ƒþ²º?¹—WNèlOùÓˆ'2D
K¨û<C2A8>öâ0VÊÄEì”BV†êûª$ßxâj¡†ö "~AŠJ9<4A>Ù`mü<À^Ž_9 óz$Q¬÷:D
8°QÂÈ*´ú½ÕDhïñ<C3AF>Lù26µOÀxN Äû «>MX>õÛ¿e£ MxõB) IÜTô¾E<C2BE>%öÍB I“°lÌ0„hŸõ@Q ¨³§ ƒ«Ë‰Û¡µJJ ]œA½ëò0³¨(Ð<>O ëx]<5D>QGÏ-«Š1R ¥šÌeÈëC†Á•`>`£Fû
¢l=Á‰f0øô

View File

@ -0,0 +1,5 @@
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEDSMDdZOsmA1SpSm9GK1mKkTPBPVKjeYo
mEZMM/kqHNiXQErz6y77zu+kaxVwMM2I+jipDuYHzFxJA9m27hpFODNHApg5WEla
Ak5Fo+Ak9cw5WUydukL1FjBg3UICNOgi
-----END PUBLIC KEY-----

View File

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICHjCCAcWgAwIBAgIUFBjX17iaFQ0kRSLN1YQIdlBIdM0wCgYIKoZIzj0EAwIw
bDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRkwFwYDVQQK
ExBvcmcxLmV4YW1wbGUuY29tMQswCQYDVQQLEwJjYTEcMBoGA1UEAxMTY2Eub3Jn
MS5leGFtcGxlLmNvbTAeFw0xODEwMTAwOTI2MDBaFw0zMzEwMDYwOTI2MDBaMGwx
CzAJBgNVBAYTAlVTMRcwFQYDVQQIEw5Ob3J0aCBDYXJvbGluYTEZMBcGA1UEChMQ
b3JnMS5leGFtcGxlLmNvbTELMAkGA1UECxMCY2ExHDAaBgNVBAMTE2NhLm9yZzEu
ZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR/vnxyLUrmMJJx
h1nGAk+YidN8RL0XKl8gjzNa2SuEHfaROUhBVU3r06rDuJoNn+P3tcIwFsgndJmk
vLrCBcQDo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd
BgNVHQ4EFgQUu79ukG5b4N19gYSYYALk+wY91SYwCgYIKoZIzj0EAwIDRwAwRAIg
THDvbxlsa/Xw0gEAXlSfNS5XIthdULlQmsWzA0WEz1ACICXifW6iWfl4fibYwqR5
L/XiIQ/2UQ9nHnPbZm3ISVvN
-----END CERTIFICATE-----

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgiN1Z0HqaMHo8VPPt
2267O46l2yZ1r411HjSr9rOPXeOhRANCAAR/vnxyLUrmMJJxh1nGAk+YidN8RL0X
Kl8gjzNa2SuEHfaROUhBVU3r06rDuJoNn+P3tcIwFsgndJmkvLrCBcQD
-----END PRIVATE KEY-----

View File

@ -0,0 +1,132 @@
version: 1.3.0
port: 7054
debug: false
crlsizelimit: 512000
tls:
enabled: false
certfile: null
keyfile: null
clientauth:
type: noclientcert
certfiles: null
ca:
name: ca.org1.example.com
keyfile: ca.org1.example.com_sk
certfile: ca.org1.example.com-cert.pem
chainfile: null
crl:
expiry: 24h
registry:
maxenrollments: -1
identities:
- name: admin-default
pass: pass-default
type: client
affiliation: ""
attrs:
hf.Registrar.Roles: '*'
hf.Registrar.DelegateRoles: '*'
hf.Revoker: true
hf.IntermediateCA: true
hf.GenCRL: true
hf.Registrar.Attributes: '*'
hf.AffiliationMgr: true
db:
type: sqlite3
datasource: fabric-ca-server.db
tls:
enabled: false
certfiles: null
client:
certfile: null
keyfile: null
ldap:
enabled: false
url: ldap://<adminDN>:<adminPassword>@<host>:<port>/<base>
tls:
certfiles: null
client:
certfile: null
keyfile: null
attribute:
names:
- uid
- member
converters:
- name: null
value: null
maps:
groups:
- name: null
value: null
affiliations:
org1:
- department1
- department2
org2:
- department1
signing:
default:
usage:
- digital signature
expiry: 8760h
profiles:
ca:
usage:
- cert sign
- crl sign
expiry: 43800h
caconstraint:
isca: true
maxpathlen: 0
tls:
usage:
- signing
- key encipherment
- server auth
- client auth
- key agreement
expiry: 8760h
csr:
cn: ca.org1.example.com
keyrequest:
algo: ecdsa
size: 256
names:
- C: US
ST: North Carolina
L: null
O: org1.example.com
OU: ca
hosts:
- ca.org1.example.com
- localhost
ca:
expiry: 131400h
pathlength: 1
idemix:
rhpoolsize: 1000
nonceexpiration: 15s
noncesweepinterval: 15m
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
keystore: msp/keystore
cacount: null
cafiles: null
intermediate:
parentserver:
url: null
caname: null
enrollment:
hosts: null
profile: null
label: null
tls:
certfiles: null
client:
certfile: null
keyfile: null

View File

@ -0,0 +1,6 @@
-----BEGIN PRIVATE KEY-----
MIGkAgEBBDB9kCD1CUKnFFo6ks3Mo2qS/X+GFNPPT0SZkeR4iHswUzsZIV7bTwN9
0RDjlfS2Ix+gBwYFK4EEACKhZANiAAQNIwN1k6yYDVKlKb0YrWYqRM8E9UqN5iiY
Rkwz+Soc2JdASvPrLvvO76RrFXAwzYj6OKkO5gfMXEkD2bbuGkU4M0cCmDlYSVoC
TkWj4CT1zDlZTJ26QvUWMGDdQgI06CI=
-----END PRIVATE KEY-----

View File

@ -0,0 +1 @@
<EFBFBD>ƶ<EFBFBD><19><><EFBFBD><16><><EFBFBD>f<EFBFBD>i<EFBFBD>:<3A>bb<62><62>f<EFBFBD>:<3A>߶<EFBFBD><DFB6><EFBFBD>G

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgiN1Z0HqaMHo8VPPt
2267O46l2yZ1r411HjSr9rOPXeOhRANCAAR/vnxyLUrmMJJxh1nGAk+YidN8RL0X
Kl8gjzNa2SuEHfaROUhBVU3r06rDuJoNn+P3tcIwFsgndJmkvLrCBcQD
-----END PRIVATE KEY-----

View File

@ -0,0 +1,5 @@
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEWdv1PmR2LLHqufi+l8aYtxnRvnJBwHop
mSWv/TJgomLUWfPd2jBSWZEhY0FpkAPSDSJQNRIG8wMVqbWRcL3uYIyqj3PMO6yt
LdTu49HIFPocwCLg3KNyA4xpcS8zUjc4
-----END PUBLIC KEY-----

View File

@ -0,0 +1,132 @@
version: 1.3.0
port: 7054
debug: false
crlsizelimit: 512000
tls:
enabled: false
certfile: null
keyfile: null
clientauth:
type: noclientcert
certfiles: null
ca:
name: tlsca.org1.example.com
keyfile: tlsca.org1.example.com_sk
certfile: tlsca.org1.example.com-cert.pem
chainfile: null
crl:
expiry: 24h
registry:
maxenrollments: -1
identities:
- name: admin-default
pass: pass-default
type: client
affiliation: ""
attrs:
hf.Registrar.Roles: '*'
hf.Registrar.DelegateRoles: '*'
hf.Revoker: true
hf.IntermediateCA: true
hf.GenCRL: true
hf.Registrar.Attributes: '*'
hf.AffiliationMgr: true
db:
type: sqlite3
datasource: fabric-ca-server.db
tls:
enabled: false
certfiles: null
client:
certfile: null
keyfile: null
ldap:
enabled: false
url: ldap://<adminDN>:<adminPassword>@<host>:<port>/<base>
tls:
certfiles: null
client:
certfile: null
keyfile: null
attribute:
names:
- uid
- member
converters:
- name: null
value: null
maps:
groups:
- name: null
value: null
affiliations:
org1:
- department1
- department2
org2:
- department1
signing:
default:
usage:
- digital signature
expiry: 8760h
profiles:
ca:
usage:
- cert sign
- crl sign
expiry: 43800h
caconstraint:
isca: true
maxpathlen: 0
tls:
usage:
- signing
- key encipherment
- server auth
- client auth
- key agreement
expiry: 8760h
csr:
cn: tlsca.org1.example.com
keyrequest:
algo: ecdsa
size: 256
names:
- C: US
ST: North Carolina
L: null
O: org1.example.com
OU: tlsca
hosts:
- tlsca.org1.example.com
- localhost
ca:
expiry: 131400h
pathlength: 1
idemix:
rhpoolsize: 1000
nonceexpiration: 15s
noncesweepinterval: 15m
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
keystore: msp/keystore
cacount: null
cafiles: null
intermediate:
parentserver:
url: null
caname: null
enrollment:
hosts: null
profile: null
label: null
tls:
certfiles: null
client:
certfile: null
keyfile: null

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgIBJvF5e9l85ObbFs
duRrWd2ZPgc/vmaR231EQhsibl6hRANCAAR+EOYSg7O1tuEvYiXkWlNtg06RjTzv
sz9aASDbkjLfaIDf+mOjUzESXAlXqma+hy/6EJT+Bt7fVq0mdvVTlec6
-----END PRIVATE KEY-----

View File

@ -0,0 +1,6 @@
-----BEGIN PRIVATE KEY-----
MIGkAgEBBDAOZeFX1SIKBZaYMr4mlObgPA+nf9HPxUpPn6LnwuJin86W0OlRpBcf
m52W/svE6cegBwYFK4EEACKhZANiAARZ2/U+ZHYsseq5+L6Xxpi3GdG+ckHAeimZ
Ja/9MmCiYtRZ893aMFJZkSFjQWmQA9INIlA1EgbzAxWptZFwve5gjKqPc8w7rK0t
1O7j0cgU+hzAIuDco3IDjGlxLzNSNzg=
-----END PRIVATE KEY-----

View File

@ -0,0 +1 @@
<EFBFBD>Fm'<27>Mo<4D>v<EFBFBD>k4x<34>E%<25><><EFBFBD> {5<>*B<>Mql<71><6C>

View File

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICKjCCAdGgAwIBAgIUYILtTrGFkEL2QHDFj1jvfBAPZYQwCgYIKoZIzj0EAwIw
cjELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRkwFwYDVQQK
ExBvcmcxLmV4YW1wbGUuY29tMQ4wDAYDVQQLEwV0bHNjYTEfMB0GA1UEAxMWdGxz
Y2Eub3JnMS5leGFtcGxlLmNvbTAeFw0xODEwMTAwOTI2MDBaFw0zMzEwMDYwOTI2
MDBaMHIxCzAJBgNVBAYTAlVTMRcwFQYDVQQIEw5Ob3J0aCBDYXJvbGluYTEZMBcG
A1UEChMQb3JnMS5leGFtcGxlLmNvbTEOMAwGA1UECxMFdGxzY2ExHzAdBgNVBAMT
FnRsc2NhLm9yZzEuZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC
AAR+EOYSg7O1tuEvYiXkWlNtg06RjTzvsz9aASDbkjLfaIDf+mOjUzESXAlXqma+
hy/6EJT+Bt7fVq0mdvVTlec6o0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/
BAgwBgEB/wIBATAdBgNVHQ4EFgQU8TyFJWYtXTJDpEvvaA8vwVFCT2IwCgYIKoZI
zj0EAwIDRwAwRAIgAmyCF1D7mXAjHZpBwQsF2pOXS2V/LQ+j3Wg0hvjixZgCICEh
X7C57zvM+RKPMYjWdlzXvt1JU+8l6nw9CGsWCPnY
-----END CERTIFICATE-----

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgIBJvF5e9l85ObbFs
duRrWd2ZPgc/vmaR231EQhsibl6hRANCAAR+EOYSg7O1tuEvYiXkWlNtg06RjTzv
sz9aASDbkjLfaIDf+mOjUzESXAlXqma+hy/6EJT+Bt7fVq0mdvVTlec6
-----END PRIVATE KEY-----

View File

@ -0,0 +1,162 @@
#############################################################################
# This is a configuration file for the fabric-ca-client command.
#
# COMMAND LINE ARGUMENTS AND ENVIRONMENT VARIABLES
# ------------------------------------------------
# Each configuration element can be overridden via command line
# arguments or environment variables. The precedence for determining
# the value of each element is as follows:
# 1) command line argument
# Examples:
# a) --url https://localhost:7054
# To set the fabric-ca server url
# b) --tls.client.certfile certfile.pem
# To set the client certificate for TLS
# 2) environment variable
# Examples:
# a) FABRIC_CA_CLIENT_URL=https://localhost:7054
# To set the fabric-ca server url
# b) FABRIC_CA_CLIENT_TLS_CLIENT_CERTFILE=certfile.pem
# To set the client certificate for TLS
# 3) configuration file
# 4) default value (if there is one)
# All default values are shown beside each element below.
#
# FILE NAME ELEMENTS
# ------------------
# The value of all fields whose name ends with "file" or "files" are
# name or names of other files.
# For example, see "tls.certfiles" and "tls.client.certfile".
# The value of each of these fields can be a simple filename, a
# relative path, or an absolute path. If the value is not an
# absolute path, it is interpretted as being relative to the location
# of this configuration file.
#
#############################################################################
#############################################################################
# Client Configuration
#############################################################################
# URL of the Fabric-ca-server (default: http://localhost:7054)
url: http://ca.org1.example.com:7054
# Membership Service Provider (MSP) directory
# This is useful when the client is used to enroll a peer or orderer, so
# that the enrollment artifacts are stored in the format expected by MSP.
mspdir: msp
#############################################################################
# TLS section for secure socket connection
#
# certfiles - PEM-encoded list of trusted root certificate files
# client:
# certfile - PEM-encoded certificate file for when client authentication
# is enabled on server
# keyfile - PEM-encoded key file for when client authentication
# is enabled on server
#############################################################################
tls:
# TLS section for secure socket connection
certfiles:
client:
certfile:
keyfile:
#############################################################################
# Certificate Signing Request section for generating the CSR for an
# enrollment certificate (ECert)
#
# cn - Used by CAs to determine which domain the certificate is to be generated for
#
# serialnumber - The serialnumber field, if specified, becomes part of the issued
# certificate's DN (Distinguished Name). For example, one use case for this is
# a company with its own CA (Certificate Authority) which issues certificates
# to its employees and wants to include the employee's serial number in the DN
# of its issued certificates.
# WARNING: The serialnumber field should not be confused with the certificate's
# serial number which is set by the CA but is not a component of the
# certificate's DN.
#
# names - A list of name objects. Each name object should contain at least one
# "C", "L", "O", or "ST" value (or any combination of these) where these
# are abbreviations for the following:
# "C": country
# "L": locality or municipality (such as city or town name)
# "O": organization
# "OU": organizational unit, such as the department responsible for owning the key;
# it can also be used for a "Doing Business As" (DBS) name
# "ST": the state or province
#
# Note that the "OU" or organizational units of an ECert are always set according
# to the values of the identities type and affiliation. OUs are calculated for an enroll
# as OU=<type>, OU=<affiliationRoot>, ..., OU=<affiliationLeaf>. For example, an identity
# of type "client" with an affiliation of "org1.dept2.team3" would have the following
# organizational units: OU=client, OU=org1, OU=dept2, OU=team3
#
# hosts - A list of host names for which the certificate should be valid
#
#############################################################################
csr:
cn: admin-default
keyrequest:
algo: ecdsa
size: 256
serialnumber:
names:
- C: US
ST: North Carolina
L:
O: Hyperledger
OU: Fabric
hosts:
- ca-client
#############################################################################
# Registration section used to register a new identity with fabric-ca server
#
# name - Unique name of the identity
# type - Type of identity being registered (e.g. 'peer, app, user')
# affiliation - The identity's affiliation
# maxenrollments - The maximum number of times the secret can be reused to enroll.
# Specially, -1 means unlimited; 0 means to use CA's max enrollment
# value.
# attributes - List of name/value pairs of attribute for identity
#############################################################################
id:
name:
type:
affiliation:
maxenrollments: 0
attributes:
# - name:
# value:
#############################################################################
# Enrollment section used to enroll an identity with fabric-ca server
#
# profile - Name of the signing profile to use in issuing the certificate
# label - Label to use in HSM operations
#############################################################################
enrollment:
profile:
label:
#############################################################################
# Name of the CA to connect to within the fabric-ca server
#############################################################################
caname:
#############################################################################
# BCCSP (BlockChain Crypto Service Provider) section allows to select which
# crypto implementation library to use
#############################################################################
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
# The directory used for the software file-based keystore
keystore: msp/keystore

View File

@ -0,0 +1,18 @@
OU
Role
EnrollmentID
RevocationHandleD
/KÙ—\TMÖ°NÉ®ðc[½ó_­Óš €»?8þñr´-<2D>`—S¸Á!*1WØø~þ¿þöD
Ò!ÐÂR"$“ºDþeR¢œoö{Ù%‡{„ú¾ c†Û¾ CO?wê=Û¦(\Ó¹Z<C2B9>üEª§ï«\Ût‡"D
÷s€“@É´O<C2B4>ojRA£hÙ¬ùn¥
Á3ÀRUEÇy¯> FÆ0mpPr»è{ÚV㥟¦æpö¡ÀM¨ù gèn"D
ÀKV¨Q£Ì•OÐÄ|ß!š°R*!å¹îàW<1B>àdˆ tT@w.ÛáŸù' mùüp¶"Qã2t[ñ<>#™Ñ„"D
¹ppŸ²¨•ž9J8wÎœú <™è× [™,>˜OÀH€
Ïô?[®‰ztýP_Á-gto+«4Ô³æ?$"D
<20>º¡)T¦p3o<sÆ6MŽý ~Ñx×]x È 笴.)ûºÿäKÌ!_IÒá=åD•î*•îÜú*ˆ
€G£e—Ã÷†xùh”X±MHY¬Ï±½h±£PB„½ ^Ï„/„aÔÃù`Æ™ï\áJHay¨
Ùñ`­BäyÑÐÓ OëŠÊõGf‰ôͨKÞXåEËð|~°:<16>¾ " <20>Sr{ȼtÕ³D•¶ƒþ²º?¹—WNèlOùÓˆ'2D
K¨û<C2A8>öâ0VÊÄEì”BV†êûª$ßxâj¡†ö "~AŠJ9<4A>Ù`mü<À^Ž_9 óz$Q¬÷:D
8°QÂÈ*´ú½ÕDhïñ<C3AF>Lù26µOÀxN Äû «>MX>õÛ¿e£ MxõB) IÜTô¾E<C2BE>%öÍB I“°lÌ0„hŸõ@Q ¨³§ ƒ«Ë‰Û¡µJJ ]œA½ëò0³¨(Ð<>O ëx]<5D>QGÏ-«Š1R ¥šÌeÈëC†Á•`>`£Fû
¢l=Á‰f0øô

View File

@ -0,0 +1,5 @@
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEDSMDdZOsmA1SpSm9GK1mKkTPBPVKjeYo
mEZMM/kqHNiXQErz6y77zu+kaxVwMM2I+jipDuYHzFxJA9m27hpFODNHApg5WEla
Ak5Fo+Ak9cw5WUydukL1FjBg3UICNOgi
-----END PUBLIC KEY-----

View File

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICHjCCAcWgAwIBAgIUFBjX17iaFQ0kRSLN1YQIdlBIdM0wCgYIKoZIzj0EAwIw
bDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRkwFwYDVQQK
ExBvcmcxLmV4YW1wbGUuY29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2Eub3Jn
MS5leGFtcGxlLmNvbTAeFw0xODEwMTAwOTI2MDBaFw0xOTEwMTAwOTMxMDBaMH4x
CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4g
RnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMQ8wDQYDVQQLEwZj
bGllbnQxFjAUBgNVBAMTDWFkbWluLWRlZmF1bHQwWTATBgcqhkjOPQIBBggqhkjO
PQMBBwNCAATHx4bqLxk/6+AuPl3fp+usYmv36sGRgDXNwOJNj8FFvKbc972Q4e+O
UoGjD3OWY9QVOXktTJu7XIgUjNzdUTteo3YwdDAOBgNVHQ8BAf8EBAMCB4AwDAYD
VR0TAQH/BAIwADAdBgNVHQ4EFgQUN2YlpmPSJriIdIkwnMw6nZicUIkwHwYDVR0j
BBgwFoAUu79ukG5b4N19gYSYYALk+wY91SYwFAYDVR0RBA0wC4IJY2EtY2xpZW50
MAoGCCqGSM49BAMCA0cAMEQCIFdPCkKVb8kKnL6AEMH3DVwuvcuImivs7HKkqEH3
U4QcAiBINUX3yyYVlFHII+wbEpBrilgNvak+4/gG+oWemh/iLw==
-----END CERTIFICATE-----

View File

@ -0,0 +1,162 @@
#############################################################################
# This is a configuration file for the fabric-ca-client command.
#
# COMMAND LINE ARGUMENTS AND ENVIRONMENT VARIABLES
# ------------------------------------------------
# Each configuration element can be overridden via command line
# arguments or environment variables. The precedence for determining
# the value of each element is as follows:
# 1) command line argument
# Examples:
# a) --url https://localhost:7054
# To set the fabric-ca server url
# b) --tls.client.certfile certfile.pem
# To set the client certificate for TLS
# 2) environment variable
# Examples:
# a) FABRIC_CA_CLIENT_URL=https://localhost:7054
# To set the fabric-ca server url
# b) FABRIC_CA_CLIENT_TLS_CLIENT_CERTFILE=certfile.pem
# To set the client certificate for TLS
# 3) configuration file
# 4) default value (if there is one)
# All default values are shown beside each element below.
#
# FILE NAME ELEMENTS
# ------------------
# The value of all fields whose name ends with "file" or "files" are
# name or names of other files.
# For example, see "tls.certfiles" and "tls.client.certfile".
# The value of each of these fields can be a simple filename, a
# relative path, or an absolute path. If the value is not an
# absolute path, it is interpretted as being relative to the location
# of this configuration file.
#
#############################################################################
#############################################################################
# Client Configuration
#############################################################################
# URL of the Fabric-ca-server (default: http://localhost:7054)
url: http://tlsca.org1.example.com:7054
# Membership Service Provider (MSP) directory
# This is useful when the client is used to enroll a peer or orderer, so
# that the enrollment artifacts are stored in the format expected by MSP.
mspdir: msp
#############################################################################
# TLS section for secure socket connection
#
# certfiles - PEM-encoded list of trusted root certificate files
# client:
# certfile - PEM-encoded certificate file for when client authentication
# is enabled on server
# keyfile - PEM-encoded key file for when client authentication
# is enabled on server
#############################################################################
tls:
# TLS section for secure socket connection
certfiles:
client:
certfile:
keyfile:
#############################################################################
# Certificate Signing Request section for generating the CSR for an
# enrollment certificate (ECert)
#
# cn - Used by CAs to determine which domain the certificate is to be generated for
#
# serialnumber - The serialnumber field, if specified, becomes part of the issued
# certificate's DN (Distinguished Name). For example, one use case for this is
# a company with its own CA (Certificate Authority) which issues certificates
# to its employees and wants to include the employee's serial number in the DN
# of its issued certificates.
# WARNING: The serialnumber field should not be confused with the certificate's
# serial number which is set by the CA but is not a component of the
# certificate's DN.
#
# names - A list of name objects. Each name object should contain at least one
# "C", "L", "O", or "ST" value (or any combination of these) where these
# are abbreviations for the following:
# "C": country
# "L": locality or municipality (such as city or town name)
# "O": organization
# "OU": organizational unit, such as the department responsible for owning the key;
# it can also be used for a "Doing Business As" (DBS) name
# "ST": the state or province
#
# Note that the "OU" or organizational units of an ECert are always set according
# to the values of the identities type and affiliation. OUs are calculated for an enroll
# as OU=<type>, OU=<affiliationRoot>, ..., OU=<affiliationLeaf>. For example, an identity
# of type "client" with an affiliation of "org1.dept2.team3" would have the following
# organizational units: OU=client, OU=org1, OU=dept2, OU=team3
#
# hosts - A list of host names for which the certificate should be valid
#
#############################################################################
csr:
cn: admin-default
keyrequest:
algo: ecdsa
size: 256
serialnumber:
names:
- C: US
ST: North Carolina
L:
O: Hyperledger
OU: Fabric
hosts:
- ca-client
#############################################################################
# Registration section used to register a new identity with fabric-ca server
#
# name - Unique name of the identity
# type - Type of identity being registered (e.g. 'peer, app, user')
# affiliation - The identity's affiliation
# maxenrollments - The maximum number of times the secret can be reused to enroll.
# Specially, -1 means unlimited; 0 means to use CA's max enrollment
# value.
# attributes - List of name/value pairs of attribute for identity
#############################################################################
id:
name:
type:
affiliation:
maxenrollments: 0
attributes:
# - name:
# value:
#############################################################################
# Enrollment section used to enroll an identity with fabric-ca server
#
# profile - Name of the signing profile to use in issuing the certificate
# label - Label to use in HSM operations
#############################################################################
enrollment:
profile:
label:
#############################################################################
# Name of the CA to connect to within the fabric-ca server
#############################################################################
caname:
#############################################################################
# BCCSP (BlockChain Crypto Service Provider) section allows to select which
# crypto implementation library to use
#############################################################################
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
# The directory used for the software file-based keystore
keystore: msp/keystore

View File

@ -0,0 +1,5 @@
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEWdv1PmR2LLHqufi+l8aYtxnRvnJBwHop
mSWv/TJgomLUWfPd2jBSWZEhY0FpkAPSDSJQNRIG8wMVqbWRcL3uYIyqj3PMO6yt
LdTu49HIFPocwCLg3KNyA4xpcS8zUjc4
-----END PUBLIC KEY-----

View File

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICKjCCAdGgAwIBAgIUYILtTrGFkEL2QHDFj1jvfBAPZYQwCgYIKoZIzj0EAwIw
cjELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRkwFwYDVQQK
ExBvcmcxLmV4YW1wbGUuY29tMQ4wDAYDVQQLEwV0bHNjYTEfMB0GA1UEAxMWdGxz
Y2Eub3JnMS5leGFtcGxlLmNvbTAeFw0xODEwMTAwOTI2MDBaFw0zMzEwMDYwOTI2
MD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H4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH
Ew1TYW4gRnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMQ8wDQYD
VQQLEwZjbGllbnQxFjAUBgNVBAMTDWFkbWluLWRlZmF1bHQwWTATBgcqhkjOPQIB
BggqhkjOPQMBBwNCAAS+eWBQdlHoVLDGhuh2uUlFBJb/UAUmUMjJtdS4G4GmzpLd
rxk6DJGK9gKbv80IyHju6f0GQloiuJIYTnDeUobmo3YwdDAOBgNVHQ8BAf8EBAMC
B4AwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUJ+5d0xZP4TCm3qU9IjfYTllxd3kw
HwYDVR0jBBgwFoAU8TyFJWYtXTJDpEvvaA8vwVFCT2IwFAYDVR0RBA0wC4IJY2Et
Y2xpZW50MAoGCCqGSM49BAMCA0cAMEQCIGjT2hSvBeVkXuE96qRzKSTzejRptVr8
pKkfaX2WXZkJAiBRppl8nlWoeoi0py6omQtt5bgRByQI1GmEvJ5+B9oMyA==
-----END CERTIFICATE-----

View File

@ -111,8 +111,9 @@ GetCert() {
}
ORGS=( org1.example.com org2.example.com )
ORGS=(org1.example.com org2.example.com )
PEERS=( peer0 peer1 )
ORDERERS=( orderer )
USERS=( Admin User1 )
# Generates peer orgs
@ -135,6 +136,14 @@ do
fi
done
cd ../peers
# Register all peers at ca and tlsca
for peer in "${PEERS[@]}"
do
RegisterUser ca.${org} ${peer}@${org} ${org} ${peer} ${peer} "peer" "hf.Registrar.Roles=peer,hf.Registrar.Attributes=*,hf.Revoker=true,hf.GenCRL=true,admin=false:ecert,abac.init=true:ecert"
RegisterUser tlsca.${org} ${user}@${org} ${org} ${user} ${user} "user" "hf.Registrar.Roles=client,hf.Registrar.Attributes=*,hf.Revoker=true,hf.GenCRL=true,admin=false:ecert,abac.init=true:ecert"
done
exit 0

View File

@ -0,0 +1,162 @@
#############################################################################
# This is a configuration file for the fabric-ca-client command.
#
# COMMAND LINE ARGUMENTS AND ENVIRONMENT VARIABLES
# ------------------------------------------------
# Each configuration element can be overridden via command line
# arguments or environment variables. The precedence for determining
# the value of each element is as follows:
# 1) command line argument
# Examples:
# a) --url https://localhost:7054
# To set the fabric-ca server url
# b) --tls.client.certfile certfile.pem
# To set the client certificate for TLS
# 2) environment variable
# Examples:
# a) FABRIC_CA_CLIENT_URL=https://localhost:7054
# To set the fabric-ca server url
# b) FABRIC_CA_CLIENT_TLS_CLIENT_CERTFILE=certfile.pem
# To set the client certificate for TLS
# 3) configuration file
# 4) default value (if there is one)
# All default values are shown beside each element below.
#
# FILE NAME ELEMENTS
# ------------------
# The value of all fields whose name ends with "file" or "files" are
# name or names of other files.
# For example, see "tls.certfiles" and "tls.client.certfile".
# The value of each of these fields can be a simple filename, a
# relative path, or an absolute path. If the value is not an
# absolute path, it is interpretted as being relative to the location
# of this configuration file.
#
#############################################################################
#############################################################################
# Client Configuration
#############################################################################
# URL of the Fabric-ca-server (default: http://localhost:7054)
url: http://ca.example.com:7054
# Membership Service Provider (MSP) directory
# This is useful when the client is used to enroll a peer or orderer, so
# that the enrollment artifacts are stored in the format expected by MSP.
mspdir: msp
#############################################################################
# TLS section for secure socket connection
#
# certfiles - PEM-encoded list of trusted root certificate files
# client:
# certfile - PEM-encoded certificate file for when client authentication
# is enabled on server
# keyfile - PEM-encoded key file for when client authentication
# is enabled on server
#############################################################################
tls:
# TLS section for secure socket connection
certfiles:
client:
certfile:
keyfile:
#############################################################################
# Certificate Signing Request section for generating the CSR for an
# enrollment certificate (ECert)
#
# cn - Used by CAs to determine which domain the certificate is to be generated for
#
# serialnumber - The serialnumber field, if specified, becomes part of the issued
# certificate's DN (Distinguished Name). For example, one use case for this is
# a company with its own CA (Certificate Authority) which issues certificates
# to its employees and wants to include the employee's serial number in the DN
# of its issued certificates.
# WARNING: The serialnumber field should not be confused with the certificate's
# serial number which is set by the CA but is not a component of the
# certificate's DN.
#
# names - A list of name objects. Each name object should contain at least one
# "C", "L", "O", or "ST" value (or any combination of these) where these
# are abbreviations for the following:
# "C": country
# "L": locality or municipality (such as city or town name)
# "O": organization
# "OU": organizational unit, such as the department responsible for owning the key;
# it can also be used for a "Doing Business As" (DBS) name
# "ST": the state or province
#
# Note that the "OU" or organizational units of an ECert are always set according
# to the values of the identities type and affiliation. OUs are calculated for an enroll
# as OU=<type>, OU=<affiliationRoot>, ..., OU=<affiliationLeaf>. For example, an identity
# of type "client" with an affiliation of "org1.dept2.team3" would have the following
# organizational units: OU=client, OU=org1, OU=dept2, OU=team3
#
# hosts - A list of host names for which the certificate should be valid
#
#############################################################################
csr:
cn: admin-default
keyrequest:
algo: ecdsa
size: 256
serialnumber:
names:
- C: US
ST: North Carolina
L:
O: Hyperledger
OU: Fabric
hosts:
- ca-client
#############################################################################
# Registration section used to register a new identity with fabric-ca server
#
# name - Unique name of the identity
# type - Type of identity being registered (e.g. 'peer, app, user')
# affiliation - The identity's affiliation
# maxenrollments - The maximum number of times the secret can be reused to enroll.
# Specially, -1 means unlimited; 0 means to use CA's max enrollment
# value.
# attributes - List of name/value pairs of attribute for identity
#############################################################################
id:
name:
type:
affiliation:
maxenrollments: 0
attributes:
# - name:
# value:
#############################################################################
# Enrollment section used to enroll an identity with fabric-ca server
#
# profile - Name of the signing profile to use in issuing the certificate
# label - Label to use in HSM operations
#############################################################################
enrollment:
profile:
label:
#############################################################################
# Name of the CA to connect to within the fabric-ca server
#############################################################################
caname:
#############################################################################
# BCCSP (BlockChain Crypto Service Provider) section allows to select which
# crypto implementation library to use
#############################################################################
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
# The directory used for the software file-based keystore
keystore: msp/keystore

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgAW49uUwglOMGLe6g
H6BYJMB37/8zpTg/iI3ebXR/xsWhRANCAAQVK3wbfCGHDJf42qv4Bf4OGvhYuhZE
hNRwyomzUtfJ/dtWYabp87CbThq/rilR3g3df72hZZw0ZIaHNLpYRIGW
-----END PRIVATE KEY-----

View File

@ -0,0 +1,162 @@
#############################################################################
# This is a configuration file for the fabric-ca-client command.
#
# COMMAND LINE ARGUMENTS AND ENVIRONMENT VARIABLES
# ------------------------------------------------
# Each configuration element can be overridden via command line
# arguments or environment variables. The precedence for determining
# the value of each element is as follows:
# 1) command line argument
# Examples:
# a) --url https://localhost:7054
# To set the fabric-ca server url
# b) --tls.client.certfile certfile.pem
# To set the client certificate for TLS
# 2) environment variable
# Examples:
# a) FABRIC_CA_CLIENT_URL=https://localhost:7054
# To set the fabric-ca server url
# b) FABRIC_CA_CLIENT_TLS_CLIENT_CERTFILE=certfile.pem
# To set the client certificate for TLS
# 3) configuration file
# 4) default value (if there is one)
# All default values are shown beside each element below.
#
# FILE NAME ELEMENTS
# ------------------
# The value of all fields whose name ends with "file" or "files" are
# name or names of other files.
# For example, see "tls.certfiles" and "tls.client.certfile".
# The value of each of these fields can be a simple filename, a
# relative path, or an absolute path. If the value is not an
# absolute path, it is interpretted as being relative to the location
# of this configuration file.
#
#############################################################################
#############################################################################
# Client Configuration
#############################################################################
# URL of the Fabric-ca-server (default: http://localhost:7054)
url: http://tlsca.example.com:7054
# Membership Service Provider (MSP) directory
# This is useful when the client is used to enroll a peer or orderer, so
# that the enrollment artifacts are stored in the format expected by MSP.
mspdir: msp
#############################################################################
# TLS section for secure socket connection
#
# certfiles - PEM-encoded list of trusted root certificate files
# client:
# certfile - PEM-encoded certificate file for when client authentication
# is enabled on server
# keyfile - PEM-encoded key file for when client authentication
# is enabled on server
#############################################################################
tls:
# TLS section for secure socket connection
certfiles:
client:
certfile:
keyfile:
#############################################################################
# Certificate Signing Request section for generating the CSR for an
# enrollment certificate (ECert)
#
# cn - Used by CAs to determine which domain the certificate is to be generated for
#
# serialnumber - The serialnumber field, if specified, becomes part of the issued
# certificate's DN (Distinguished Name). For example, one use case for this is
# a company with its own CA (Certificate Authority) which issues certificates
# to its employees and wants to include the employee's serial number in the DN
# of its issued certificates.
# WARNING: The serialnumber field should not be confused with the certificate's
# serial number which is set by the CA but is not a component of the
# certificate's DN.
#
# names - A list of name objects. Each name object should contain at least one
# "C", "L", "O", or "ST" value (or any combination of these) where these
# are abbreviations for the following:
# "C": country
# "L": locality or municipality (such as city or town name)
# "O": organization
# "OU": organizational unit, such as the department responsible for owning the key;
# it can also be used for a "Doing Business As" (DBS) name
# "ST": the state or province
#
# Note that the "OU" or organizational units of an ECert are always set according
# to the values of the identities type and affiliation. OUs are calculated for an enroll
# as OU=<type>, OU=<affiliationRoot>, ..., OU=<affiliationLeaf>. For example, an identity
# of type "client" with an affiliation of "org1.dept2.team3" would have the following
# organizational units: OU=client, OU=org1, OU=dept2, OU=team3
#
# hosts - A list of host names for which the certificate should be valid
#
#############################################################################
csr:
cn: admin-default
keyrequest:
algo: ecdsa
size: 256
serialnumber:
names:
- C: US
ST: North Carolina
L:
O: Hyperledger
OU: Fabric
hosts:
- ca-client
#############################################################################
# Registration section used to register a new identity with fabric-ca server
#
# name - Unique name of the identity
# type - Type of identity being registered (e.g. 'peer, app, user')
# affiliation - The identity's affiliation
# maxenrollments - The maximum number of times the secret can be reused to enroll.
# Specially, -1 means unlimited; 0 means to use CA's max enrollment
# value.
# attributes - List of name/value pairs of attribute for identity
#############################################################################
id:
name:
type:
affiliation:
maxenrollments: 0
attributes:
# - name:
# value:
#############################################################################
# Enrollment section used to enroll an identity with fabric-ca server
#
# profile - Name of the signing profile to use in issuing the certificate
# label - Label to use in HSM operations
#############################################################################
enrollment:
profile:
label:
#############################################################################
# Name of the CA to connect to within the fabric-ca server
#############################################################################
caname:
#############################################################################
# BCCSP (BlockChain Crypto Service Provider) section allows to select which
# crypto implementation library to use
#############################################################################
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
# The directory used for the software file-based keystore
keystore: msp/keystore

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgrD+JxECpHZAV4wdS
uVPfoTFCD/ixfaVSsW8onQm+m2yhRANCAATJJMk88HeZPD6eT0Azi9m4CEw+A5od
vNW/N7vLNw0O4tBj1RX7j/iGVNlmYnjluhkHI6WyyaTxElePnr6+9AMC
-----END PRIVATE KEY-----

View File

@ -43,14 +43,11 @@ done
# docker pull yeasy/hyperledger-fabric
echo "=== Pulling fabric images ${FABRIC_IMG_TAG} from fabric repo... ==="
for IMG in peer tools orderer ca ccenv tools couchdb kafka zookeeper; do
for IMG in peer tools orderer ca ccenv tools; do
HLF_IMG=hyperledger/fabric-${IMG}:$ARCH-$FABRIC_IMG_TAG
pull_image $HLF_IMG
done
#pull_image hyperledger/fabric-ccenv:x86_64-1.1.0 # no latest tag for ccenv
#docker tag hyperledger/fabric-ccenv:x86_64-1.1.0 hyperledger/fabric-ccenv:$ARCH-$PROJECT_VERSION
echo "Image pulling done, now can startup the network using docker-compose..."
exit 0

View File

@ -24,3 +24,7 @@ command -v "docker" >/dev/null 2>&1 && echo "Docker already installed" || instal
command -v "docker-compose" >/dev/null 2>&1 && echo "Docker-Compose already installed" || install_docker_compose
command -v "jq" >/dev/null 2>&1 && echo "jq already installed" || sudo apt-get install jq
echo "Create default docker network for usage"
docker network create hlf_net

View File

@ -227,7 +227,7 @@ channelGetInfo () {
peer channel getinfo -c ${channel} >&log.txt
rc=$?
cat log.txt
[ $rc -ne 0 ] && cat log.txt
if [ $rc -ne 0 ]; then
echo "=== Fail to get channel info of ${channel} with id of org${org}/peer${peer} === "
else
@ -509,8 +509,6 @@ chaincodeQuery () {
let rc=1
echo_b "$VALUE != ${expected_result}, will retry"
fi
else
cat log.txt
fi
if [ $rc -ne 0 ]; then
cat log.txt

View File

@ -11,8 +11,6 @@ fi
echo_g "=== Testing eventsclient in a loop ==="
set -x
CORE_PEER_LOCALMSPID=${ORG1MSP} \
CORE_PEER_MSPCONFIGPATH=${ORG1_ADMIN_MSP} \
eventsclient \

View File

@ -12,7 +12,7 @@ CC_INVOKE_ARGS=${CC_INVOKE_ARGS:-$CC_02_INVOKE_ARGS}
CC_QUERY_ARGS=${CC_QUERY_ARGS:-$CC_02_QUERY_ARGS}
#Query on chaincode on Peer0/Org1
echo_g "=== Testing Chaincode invoke/query ==="
echo_b "=== Testing Chaincode invoke/query ==="
# Non-side-DB testing
echo_b "Query chaincode ${CC_NAME} on peer org2/peer0..."
@ -34,4 +34,4 @@ chaincodeInvoke ${APP_CHANNEL} 2 1 ${CC_NAME} ${CC_INVOKE_ARGS}
echo_b "Query chaincode on org1/peer0 4peers..."
chaincodeQuery ${APP_CHANNEL} 1 0 ${CC_NAME} ${CC_QUERY_ARGS} 80
echo_g "=== Chaincode invoke/query completed ==="
echo_g "=== Chaincode invoke/query done ==="

View File

@ -22,7 +22,6 @@ pushd $MODE/${CHANNEL_ARTIFACTS}
# Must run `make gen_config` to generate config files first
echo_b "Clean potential existing container $CTL_CONTAINER"
[ "$(docker ps -a | grep $CTL_CONTAINER)" ] && docker rm -f $CTL_CONTAINER

View File

@ -2,6 +2,16 @@
# Before running `make`, config this files
# Define some global variables for usage. Will be included by func.sh.
ARCH=amd64
# for the base images, including baseimage, baseos, couchdb, kafka, zookeeper
BASE_IMG_TAG=0.4.13
# For fabric images, including peer, orderer, ca
FABRIC_IMG_TAG=latest
PROJECT_VERSION=1.3.0
# Name of app channel, need to align with the gen_artifacts.sh
SYS_CHANNEL="testchainid"
APP_CHANNEL="businesschannel"
@ -86,7 +96,7 @@ CC_INVOKE_ARGS=${CC_02_INVOKE_ARGS}
CC_QUERY_ARGS=${CC_02_QUERY_ARGS}
# Generate configs
GEN_IMG=yeasy/hyperledger-fabric:latest # working dir is `/go/src/github.com/hyperledger/fabric`
GEN_IMG=yeasy/hyperledger-fabric:${FABRIC_IMG_TAG} # working dir is `/go/src/github.com/hyperledger/fabric`
GEN_CONTAINER=generator
FABRIC_CFG_PATH=/etc/hyperledger/fabric
CHANNEL_ARTIFACTS=channel-artifacts
@ -99,7 +109,7 @@ UPDATE_ANCHOR_ORG1_TX=Org1MSPanchors.tx
UPDATE_ANCHOR_ORG2_TX=Org2MSPanchors.tx
# CONFIGTXLATOR
CTL_IMG=yeasy/hyperledger-fabric:latest
CTL_IMG=yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
CTL_CONTAINER=configtxlator
CTL_BASE_URL=http://127.0.0.1:7059
CTL_ENCODE_URL=${CTL_BASE_URL}/protolator/encode
@ -123,14 +133,3 @@ CFG_DELTA_JSON=config_delta.json
CFG_DELTA_PB=config_delta.pb
CFG_DELTA_ENV_JSON=config_delta_env.json
CFG_DELTA_ENV_PB=config_delta_env.pb
#ARCH=x86_64
ARCH=amd64
# for the base images, including baseimage, baseos, couchdb, kafka, zookeeper
BASE_IMG_TAG=0.4.13
# For fabric images, including peer, orderer, ca
FABRIC_IMG_TAG=latest
PROJECT_VERSION=1.3.0

View File

@ -823,13 +823,13 @@
},
"signatures": [
{
"signature": "MEQCIH25X495i3oWeGSXEC4zu3BWxCpLTlexj94+L6D78Z4zAiAccALO54Pfj7xkSFeRBfcRg5tDUlYnqvyAFKHDHBTEsQ==",
"signature": "MEQCIHZ4ADCAF1m/RkEcyoXnac68SNTH7wB4MSObkmCkSicdAiBCal+0HRvrUxqetAGlS3SAe7szatMtvRmjmpB4+Pvu7Q==",
"signature_header": {
"creator": {
"id_bytes": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNLVENDQWRDZ0F3SUJBZ0lRY29vYWgxTnpEU0JSTFg4Z203QTA0akFLQmdncWhrak9QUVFEQWpCek1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTWk1bGVHRnRjR3hsTG1OdmJURWNNQm9HQTFVRUF4TVRZMkV1CmIzSm5NaTVsZUdGdGNHeGxMbU52YlRBZUZ3MHhPREE1TVRBd05qQXlNek5hRncweU9EQTVNRGN3TmpBeU16TmEKTUd3eEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUlFd3BEWVd4cFptOXlibWxoTVJZd0ZBWURWUVFIRXcxVApZVzRnUm5KaGJtTnBjMk52TVE4d0RRWURWUVFMRXdaamJHbGxiblF4SHpBZEJnTlZCQU1NRmtGa2JXbHVRRzl5Clp6SXVaWGhoYlhCc1pTNWpiMjB3V1RBVEJnY3Foa2pPUFFJQkJnZ3Foa2pPUFFNQkJ3TkNBQVFHcXFuUTNIeEMKeEhSY2NkaEZrTmNwd0ltaHdpRHVaUUkwbnd6d1FaT2Z3cnhOYmU4clh3OWdOWFhjVnpoWWFydnFLa3hBbjkySQpHM3dnOVRPSk9VdTFvMDB3U3pBT0JnTlZIUThCQWY4RUJBTUNCNEF3REFZRFZSMFRBUUgvQkFJd0FEQXJCZ05WCkhTTUVKREFpZ0NES0V0ditTU3h4aW1yL2w1MEdESFZzK0Zva3VheG9hNFAvc0J1eXQra3k2VEFLQmdncWhrak8KUFFRREFnTkhBREJFQWlBYW5xR1M3dHQwSDVRWW9MMW5vaHcxRTQvSEpSVkY0Mk5kVngrQkpnN1J1d0lnS1lyNApYeXdUMVMwWGt6Z3V3L2dpY2ttNGN5WDZxVEFLK0hQRDBpM3U2MG89Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K",
"mspid": "Org2MSP"
},
"nonce": "4z0YaSTOH6B7XvRx9M63MVXVI9Wg4oew"
"nonce": "ZU3hWBPUGSvi5nbc5YenNVv/qPOu0cgv"
}
}
]
@ -839,7 +839,7 @@
"channel_id": "businesschannel",
"epoch": "0",
"extension": null,
"timestamp": "2018-09-25T07:37:27Z",
"timestamp": "2018-10-11T04:25:14Z",
"tls_cert_hash": null,
"tx_id": "",
"type": 2,
@ -850,11 +850,11 @@
"id_bytes": "LS0tLS1CRUdJTiBDRVJUSUZJQ0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"mspid": "Org2MSP"
},
"nonce": "5juEXldHvnZGXK16AiDERQgm7me5eR5N"
"nonce": "JxWqfnIKFGN6HJ1qNBnBue8f4NcM0oah"
}
}
},
"signature": "MEQCIDcnGn0lWIV2hB/CI8MqMPbyzi2PEGNtjXhsPSjgHxj6AiAZiJkfQHcUGvazH/MIaxRFrptAIifz/PWqCcgs0qbBpw=="
"signature": "MEQCIEElZig4c2GOexU4d+tqPUn3A/JJUxoaHcS1OSu/TdwMAiA/zxAzfp7rFb3ms/vUM1haMVouyGXNMR4LKqJagCPERA=="
}
},
"header": {
@ -862,7 +862,7 @@
"channel_id": "businesschannel",
"epoch": "0",
"extension": null,
"timestamp": "2018-09-25T07:37:27Z",
"timestamp": "2018-10-11T04:25:14Z",
"tls_cert_hash": null,
"tx_id": "",
"type": 1,
@ -873,23 +873,23 @@
"id_bytes": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNERENDQWJPZ0F3SUJBZ0lSQUpySTNpeFBaNS9uOUw3dE4zc2hZSnd3Q2dZSUtvWkl6ajBFQXdJd2FURUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhGREFTQmdOVkJBb1RDMlY0WVcxd2JHVXVZMjl0TVJjd0ZRWURWUVFERXc1allTNWxlR0Z0CmNHeGxMbU52YlRBZUZ3MHhPREE1TVRBd05qQXlNek5hRncweU9EQTVNRGN3TmpBeU16TmFNRmd4Q3pBSkJnTlYKQkFZVEFsVlRNUk13RVFZRFZRUUlFd3BEWVd4cFptOXlibWxoTVJZd0ZBWURWUVFIRXcxVFlXNGdSbkpoYm1OcApjMk52TVJ3d0dnWURWUVFERXhOdmNtUmxjbVZ5TG1WNFlXMXdiR1V1WTI5dE1Ga3dFd1lIS29aSXpqMENBUVlJCktvWkl6ajBEQVFjRFFnQUVza0kvelNpWDE1NUM5ODIrd3RBU2xvQTh0YzRXWEJJYmlPckc4Z3lCSEIrYWtBZXAKUnR2RzdobFZFZmNrRDg4bi95NjJmckljSjJJTzBxWVNYUXlzK3FOTk1Fc3dEZ1lEVlIwUEFRSC9CQVFEQWdlQQpNQXdHQTFVZEV3RUIvd1FDTUFBd0t3WURWUjBqQkNRd0lvQWdoUUNCRkRhVk5oSVptN0ZoR2pJblJib3o0SWVZCjFGVThtWFh4UGR2UDF0RXdDZ1lJS29aSXpqMEVBd0lEUndBd1JBSWdmdXpaWm1QYVRVNmNKeEJMcTJFeEhsVzgKeFZqbVE5ejFCUzJCYTVvbVBKWUNJQzNUK0N1dWNVbmx3c0dZNGFUSGVoQkxuYmtHZmx4Rkwwdjk3OXMwSTlVTAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==",
"mspid": "OrdererMSP"
},
"nonce": "Xwb0yKW8QOh4TBgkqzQcq9CVWRGE/PTR"
"nonce": "Xst4YqAIH7enft22ni7v1aMGmmwK0NN0"
}
}
},
"signature": "MEQCICMfQQI7kpil7gsvICtL+CKlIL/W4K0yHzfxRle/niS4AiBAaaM7UaEVKvX04nQN/W7q057WvPFZDM6uIvDzrfPAzQ=="
"signature": "MEQCIQDojbHsB1okJ6DUP6w4DD+Q+zH7MhDcxDv3UlRzqKHYOwIffAHa0jBwaQrXP/fwrt8vG5vcGgLxDQa7C8/uIwpaKw=="
}
]
},
"header": {
"data_hash": "mWWg7ZMWOg0wdQA0jgA8AHQUBOn9Pkd6X0PuVjr8iy4=",
"data_hash": "TSkRdq0pRQbGLMRuAq/gSBNoOhCmnOF4i05kFqAu44A=",
"number": "2",
"previous_hash": "qDYAIY7Xr8zf5Pl8r9X/SSHZnRgO6IlgjqgGvUio0OI="
"previous_hash": "CxAf2Z4KeAQVnP+2+A/HZlyhn9JaRSN+GCTnCIgdGe0="
},
"metadata": {
"metadata": [
"EvgGCq0GCpAGCgpPcmRlcmVyTVNQEoEGLS0tLS1CRUdJTiBDRVJUSUZJQ0FUR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4veTYyZnJJY0oySU8wcVlTWFF5cytxTk5NRXN3RGdZRFZSMFBBUUgvQkFRREFnZUEKTUF3R0ExVWRFd0VCL3dRQ01BQXdLd1lEVlIwakJDUXdJb0FnaFFDQkZEYVZOaElabTdGaEdqSW5SYm96NEllWQoxRlU4bVhYeFBkdlAxdEV3Q2dZSUtvWkl6ajBFQXdJRFJ3QXdSQUlnZnV6WlptUGFUVTZjSnhCTHEyRXhIbFc4CnhWam1ROXoxQlMyQmE1b21QSllDSUMzVCtDdXVjVW5sd3NHWTRhVEhlaEJMbmJrR2ZseEZMMHY5NzlzMEk5VUwKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQoSGNU4BCnOGrLPWY26nrGBSjDVBWeotvXANhJGMEQCIBFpz9wZAbmgQi90meYBcR9g0Ddb6/y1dFpRrXcNkI0qAiALmfpA9y+Q4WF0Ud98kR9VR5RVg4SX1cPGhFO/LyYffg==",
"",
""
]

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -47,7 +47,8 @@ ready: # create/join channel, install/instantiate cc
make start
if [ "$(HLF_MODE)" = "dev" ]; then \
#if [ "$(HLF_MODE)" = "dev" ]; then \
if [ "$(HLF_MODE)" = "kafka" -o "$(HLF_MODE)" = "dev" ]; then \
sleep ${CODE_BUILD_WAIT}; \
else \
sleep ${NETWORK_INIT_WAIT}; \
@ -225,6 +226,7 @@ logs: # show logs
logs_check: logs_save logs_view
logs_save: # save logs
@echo "All tests done, saving logs locally"
[ -d $(LOG_PATH) ] || mkdir -p $(LOG_PATH)
docker logs peer0.org1.example.com >& $(LOG_PATH)/dev_peer0.log
docker logs orderer.example.com >& $(LOG_PATH)/dev_orderer.log
@ -236,6 +238,7 @@ logs_view: # view logs
elk: # insert logs into elk
# curl -XDELETE http://localhost:9200/logstash-\*
nc localhost 5000 < $(LOG_PATH)/dev_all.log
gen_config: # generate config artifacts
if [ "$(HLF_MODE)" = "kafka" ]; then \
bash scripts/gen_config.sh kafka; \

View File

@ -227,7 +227,7 @@ channelGetInfo () {
peer channel getinfo -c ${channel} >&log.txt
rc=$?
[ $rc -ne 0 ] && cat log.txt
cat log.txt
if [ $rc -ne 0 ]; then
echo "=== Fail to get channel info of ${channel} with id of org${org}/peer${peer} === "
else
@ -386,7 +386,7 @@ chaincodeInstall () {
# chaincodeInstantiate channel org peer name version args
chaincodeInstantiate () {
if [ "$#" -gt 8 -a "$#" -lt 6 ]; then
echo "Wrong param number for chaincode instantaite"
echo_r "Wrong param number for chaincode instantaite"
exit -1
fi
local channel=$1

View File

@ -38,7 +38,7 @@ configtxgen \
-configPath ${FABRIC_CFG_PATH} \
-profile ${APP_CHANNEL_PROFILE} \
-channelID ${APP_CHANNEL} \
-outputCreateChannelTx ${APP_CHANNEL_TX} \
-outputCreateChannelTx ${APP_CHANNEL_TX}
configtxgen \
-inspectChannelCreateTx ${APP_CHANNEL_TX} > ${APP_CHANNEL_TX}.json

View File

@ -25,7 +25,8 @@ echo_b "Clean existing container $GEN_CONTAINER"
echo_b "Make sure crypto-config dir exists already"
if [ ! -d ${CRYPTO_CONFIG} ]; then # already exist, no need to re-gen crypto
echo_g "${CRYPTO_CONFIG} not exists, generating it."
echo_g "Path ${CRYPTO_CONFIG} not exists, re-generating it."
echo_b "Path org3/crypto-config will keep unchanged by default if exists."
mkdir -p ${CRYPTO_CONFIG}
docker run \
@ -45,7 +46,7 @@ fi
echo_b "Make sure channel-artifacts dir exists already"
if [ ! -d ${MODE}/${CHANNEL_ARTIFACTS} ]; then
echo_g "${CHANNEL_ARTIFACTS} not exists, generating it."
echo_g "Path ${CHANNEL_ARTIFACTS} not exists, generating it."
mkdir -p ${MODE}/${CHANNEL_ARTIFACTS}
docker run \

View File

@ -36,7 +36,7 @@ docker run \
sleep 1
echo_b "Convert all config block files into json"
echo_b "Convert all block files into json"
for BLOCK_FILE in *.block; do
[ -f ${BLOCK_FILE}.json ] || configtxlatorDecode "common.Block" ${BLOCK_FILE} ${BLOCK_FILE}.json
decode_result=$?

View File

@ -13,6 +13,8 @@ CC_NAME=${CC_MARBLES_NAME}
CC_PATH=${CC_MARBLES_PATH}
CC_INIT_ARGS=${CC_MARBLES_INIT_ARGS}
echo_b "=== Testing the private data feature ==="
echo_b "=== Installing chaincode ${CC_NAME} on all 4 peers... ==="
for org in "${ORGS[@]}"
@ -46,7 +48,7 @@ echo_b "Query chaincode with collection collectionMarblePrivateDetails on org1/p
chaincodeQuery ${APP_CHANNEL} 1 1 ${CC_MARBLES_NAME} ${CC_MARBLES_QUERY_READPVTDETAILS_ARGS}
echo_g "=== Query read details chaincode done ==="
echo_b "Update chaincode with new collection config"
echo_b "Install chaincode with new collection config"
for org in "${ORGS[@]}"
do
for peer in "${PEERS[@]}"

View File

@ -8,7 +8,7 @@ APP_CHANNEL="businesschannel"
# Client cmd execute timeout and retry times
TIMEOUT="60"
MAX_RETRY=5
MAX_RETRY=10
# Organization and peers
ORGS=( 1 2 )
@ -84,7 +84,7 @@ CC_INVOKE_ARGS=${CC_02_INVOKE_ARGS}
CC_QUERY_ARGS=${CC_02_QUERY_ARGS}
# Generate configs
GEN_IMG=yeasy/hyperledger-fabric:1.2.0 # working dir is `/go/src/github.com/hyperledger/fabric`
GEN_IMG=yeasy/hyperledger-fabric:${FABRIC_IMG_TAG} # working dir is `/go/src/github.com/hyperledger/fabric`
GEN_CONTAINER=generator
FABRIC_CFG_PATH=/etc/hyperledger/fabric
CHANNEL_ARTIFACTS=channel-artifacts
@ -97,7 +97,7 @@ UPDATE_ANCHOR_ORG1_TX=Org1MSPanchors.tx
UPDATE_ANCHOR_ORG2_TX=Org2MSPanchors.tx
# CONFIGTXLATOR
CTL_IMG=yeasy/hyperledger-fabric:1.2.0
CTL_IMG=yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
CTL_CONTAINER=configtxlator
CTL_BASE_URL=http://127.0.0.1:7059
CTL_ENCODE_URL=${CTL_BASE_URL}/protolator/encode

View File

@ -0,0 +1,3 @@
FABRIC_IMG_TAG=1.3.0
EXT_IMG_TAG=amd64-0.4.13
NETWORK=hlf_net

View File

@ -0,0 +1,95 @@
---
version: '2.0'
services:
orderer.example.com: # orderer in solo mode
extends:
file: base.yaml
service: orderer-base
container_name: orderer.example.com
hostname: orderer.example.com
expose:
- '7050'
volumes:
- ./solo/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./solo/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
- ./solo/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls:/var/hyperledger/orderer/tls
peer0.org1.example.com: # peer node
extends:
file: base.yaml
service: peer-base
container_name: peer0.org1.example.com # will generated automatically
hostname: peer0.org1.example.com # will generated automatically
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_ENABLED=true
volumes:
- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
expose:
- 7051
- 7052
- 7053
peer1.org1.example.com: # peer node
extends:
file: base.yaml
service: peer-base
container_name: peer1.org1.example.com # will generated automatically
hostname: peer1.org1.example.com # will generated automatically
environment:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_ENABLED=true
volumes:
- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls
expose:
- 7051
- 7052
- 7053
peer0.org2.example.com: # peer node
extends:
file: base.yaml
service: peer-base
container_name: peer0.org2.example.com # will generated automatically
hostname: peer0.org2.example.com # will generated automatically
environment:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org2.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_TLS_ENABLED=true
volumes:
- ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls
expose:
- 7051
- 7052
- 7053
peer1.org2.example.com: # peer node
extends:
file: base.yaml
service: peer-base
container_name: peer1.org2.example.com # will generated automatically
hostname: peer1.org2.example.com # will generated automatically
environment:
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org2.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_TLS_ENABLED=true
volumes:
- ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls
expose:
- 7051
- 7052
- 7053

View File

@ -0,0 +1,273 @@
# Makefile to bootup the network, and do testing with channel, chaincode
# Run `make test` will pass all testing cases, and delete the network
# Run `make ready` will create a network, pass testing cases, and stand there for manual test, e.g., make test_channel_list
# support advanced bash grammar
SHELL:=/bin/bash
# mode of the network: solo, kafka, couchdb, event, dev
HLF_MODE ?= solo
CODE_BUILD_WAIT=40 # time to wait to build peer/orderer from local code
NETWORK_INIT_WAIT=2 # time to wait the fabric network finish initialization
COMPOSE_FILE ?= "docker-compose-2orgs-4peers-solo.yaml"
LOG_PATH ?= solo/logs
ifeq ($(HLF_MODE),kafka)
COMPOSE_FILE="docker-compose-2orgs-4peers-kafka.yaml"
LOG_PATH=kafka/logs
else ifeq ($(HLF_MODE),couchdb)
COMPOSE_FILE="docker-compose-2orgs-4peers-couchdb.yaml"
else ifeq ($(HLF_MODE),event)
COMPOSE_FILE="docker-compose-2orgs-4peers-event.yaml"
else ifeq ($(HLF_MODE),be)
COMPOSE_FILE="docker-compose-2orgs-4peers-solo-be.yaml"
else ifeq ($(HLF_MODE),dev)
COMPOSE_FILE="docker-compose-1orgs-1peers-dev.yaml"
endif
all: test
test:
@echo "Run test with $(COMPOSE_FILE)"
@echo "Please make sure u have setup Docker and pulled images by 'make setup download'."
make ready # Run all testing till ready
make stop clean
ready: # create/join channel, install/instantiate cc
make stop
# make clean_config # Remove existing crypto-config and channel artifacts.
make gen_config # Will ignore if local config path exists
make start
#if [ "$(HLF_MODE)" = "dev" ]; then \
if [ "$(HLF_MODE)" = "kafka" -o "$(HLF_MODE)" = "dev" ]; then \
sleep ${CODE_BUILD_WAIT}; \
else \
sleep ${NETWORK_INIT_WAIT}; \
fi
make channel_test
make update_anchors
make cc_test
make test_lscc # test lscc operations
make test_qscc # test qscc operations
make test_fetch_blocks # fetch block files
make test_config_update
make test_channel_update
make test_fetch_blocks # fetch block files again
make test_configtxlator
make test_channel_list
make test_channel_getinfo
make logs_save
@echo "Now the fabric network is ready to play"
@echo "* run 'make cli' to enter into the fabric-cli container."
@echo "* run 'make stop' when done."
# channel related operations
channel_test: test_channel_create test_channel_join test_channel_list test_channel_getinfo
# chaincode related operations
cc_test: test_cc_install test_cc_instantiate test_cc_invoke_query
restart: stop start
start: # bootup the fabric network
@echo "Start a fabric network with ${COMPOSE_FILE}..."
@make clean
@docker-compose -f ${COMPOSE_FILE} up -d # Start a fabric network
stop: # stop the fabric network
@echo "Stop the fabric network with ${COMPOSE_FILE}..."
@docker-compose -f ${COMPOSE_FILE} down >& /tmp/docker-compose.log
chaincode_dev: restart chaincode_init test_cc_peer0 stop
################## Channel testing operations ################
test_channel_list: # List the channel that peer joined
@echo "List the joined channels"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_channel_list.sh"
test_channel_getinfo: # Get info of a channel
@echo "Get info of the app channel"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_channel_getinfo.sh"
test_channel_create: # Init the channel
@echo "Create channel on the fabric network"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_channel_create.sh"
test_channel_join: # Init the channel
@echo "Join channel"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_channel_join.sh"
update_anchors: # Update the anchor peer
@echo "Update anchors on the fabric network"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_update_anchors.sh"
test_channel_update: # send the channel update transaction
@echo "Test channel update with adding new org"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_channel_update.sh"
################## Configtxlator testing operations ################
test_configtxlator: # Test change config using configtxlator
if [ "$(HLF_MODE)" = "kafka" ]; then \
bash scripts/test_configtxlator.sh kafka; \
else \
bash scripts/test_configtxlator.sh solo; \
fi
test_config_update: # Test change config to add new org
if [ "$(HLF_MODE)" = "kafka" ]; then \
bash scripts/test_config_update.sh kafka; \
else \
bash scripts/test_config_update.sh solo; \
fi
################## Chaincode testing operations ################
test_cc: # test chaincode, deprecated
if [ "$(HLF_MODE)" = "dev" ]; then \
make test_cc_peer0; \
else \
make test_cc_invoke_query; \
fi
test_cc_install: # Install the chaincode
@echo "Install chaincode on the fabric network"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_install.sh"
test_cc_instantiate: # Instantiate the chaincode
@echo "Instantiate chaincode on the fabric network"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_instantiate.sh"
test_cc_upgrade: # Upgrade the chaincode
@echo "Upgrade chaincode on the fabric network"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_upgrade.sh"
test_cc_list: # List the chaincode
@echo "List chaincode information (installed and instantited)"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_list.sh"
test_cc_invoke_query: # test user chaincode on all peers
@echo "Invoke and query cc example02 on all peers"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_invoke_query.sh"
test_qscc: # test qscc queries
@echo "Test QSCC query"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_qscc.sh"
test_lscc: # test lscc quries
@echo "Test LSCC query"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_lscc.sh"
# FIXME: docker doesn't support wildcard in cp right now
test_fetch_blocks: # test fetching channel blocks fetch
@echo "Test fetching block files"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_fetch_blocks.sh"
test_eventsclient: # test get event notification in a loop
@echo "Test fetching event notification"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/start_eventsclient.sh"
test_sidedb: # test sideDB/private data feature
@echo "Test sideDB"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_sideDB.sh"
temp: # test temp instructions, used for experiment
@echo "Test experimental instructions"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_temp.sh"
################## Env setup related, no need to see usually ################
setup: # setup the environment
bash scripts/env_setup.sh # Installing Docker and Docker-Compose
check: # Check shell scripts grammar
@echo "Check shell scripts grammar"
[ `which shellcheck` ] && shellcheck scripts/*.sh
clean: # clean up containers
@echo "Clean all HLF containers and chaincode images"
@-docker ps -a | awk '{ print $$1,$$2 }' | grep "hyperledger/fabric" | awk '{ print $$1 }' | xargs -r -I {} docker rm -f {}
@-docker ps -a | awk '$$2 ~ /dev-peer/ { print $$1 }' | xargs -r -I {} docker rm -f {}
@-docker images | awk '$$1 ~ /dev-peer/ { print $$3 }' | xargs -r -I {} docker rmi -f {}
echo "May manually clean the crypto-config and $(MODE)/channel-artifacts"
clean_config: clean_channel_artifacts clean_crypto_config
env_clean: # clean up environment
@echo "Clean all images and containers"
bash scripts/env_clean.sh
cli: # enter the cli container
docker exec -it fabric-cli bash
orderer: # enter the orderer container
docker exec -it orderer.example.com bash
peer: # enter the peer container
docker exec -it peer0.org1.example.com bash
ps: # show existing docker images
docker ps -a
logs: # show logs
docker-compose -f ${COMPOSE_FILE} logs -f --tail 200
logs_check: logs_save logs_view
logs_save: # save logs
@echo "All tests done, saving logs locally"
[ -d $(LOG_PATH) ] || mkdir -p $(LOG_PATH)
docker logs peer0.org1.example.com >& $(LOG_PATH)/dev_peer0.log
docker logs orderer.example.com >& $(LOG_PATH)/dev_orderer.log
docker-compose -f ${COMPOSE_FILE} logs >& $(LOG_PATH)/dev_all.log
logs_view: # view logs
less $(LOG_PATH)/dev_peer.log
elk: # insert logs into elk
# curl -XDELETE http://localhost:9200/logstash-\*
nc localhost 5000 < $(LOG_PATH)/dev_all.log
gen_config: # generate config artifacts
if [ "$(HLF_MODE)" = "kafka" ]; then \
bash scripts/gen_config.sh kafka; \
else \
bash scripts/gen_config.sh solo; \
fi
clean_channel_artifacts: # clean channel related artifacts
if [ "$(HLF_MODE)" = "kafka" ]; then \
rm -rf kafka/channel-artifacts; \
else \
rm -rf solo/channel-artifacts; \
fi
clean_crypto_config: # clean config artifacts
rm -rf crypto-config
rm -rf org3/crypto-config
download: # download required images
@echo "Download Docker images"
bash scripts/download_images.sh
################## chaincode dev mode ################
chaincode_init: # start chaincode in dev mode and do install/instantiate
@echo "Install and instantiate cc example02 on the fabric dev network"
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/init_chaincode_dev.sh"

View File

@ -0,0 +1,97 @@
# This is the development compose file to config env and command
# Notice that chaincode is executed inside docker in default net mode
# https://github.com/yeasy/docker-compose-files
# Depends on the yeasy/hyperledger-fabric image.
version: '2'
services:
orderer.example.com: # There can be multiple orderers
extends:
file: base.yaml
service: orderer-base
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
container_name: orderer.example.com
hostname: orderer.example.com
ports:
- "7050:7050"
environment:
# Kafka related configurations
- ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
- ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
- ORDERER_KAFKA_VERBOSE=true
volumes:
- $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric
# for solo case
#- ./solo/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block
#- ./solo/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
#- ./solo/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
# for kafka case
- ./kafka/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./kafka/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
- ./kafka/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
command: bash -c 'bash /tmp/orderer_build.sh; orderer start' # use this if to debug orderer
#command: bash -c 'orderer start'
peer0.org1.example.com:
extends:
file: base.yaml
service: peer-base
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
container_name: peer0.org1.example.com
hostname: peer0.org1.example.com
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric
# solo mode configuration
#- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
#- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
# kafka mode configuration
- ./kafka/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./kafka/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7051:7051
- 7052:7052
- 7053:7053
#command: bash -c 'bash /tmp/peer_build.sh; peer node start'
command: bash -c 'peer node start'
#command: bash -c 'peer node start --peer-chaincodedev=true' # DEV mode
cli:
extends:
file: base.yaml
service: cli-base
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
container_name: fabric-cli
hostname: fabric-cli
tty: true
environment:
- CORE_PEER_ID=fabric-cli
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051 # default to operate on peer0.org1
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
volumes:
- $GOPATH/src/github.com/hyperledger/fabric:/opt/gopath/src/github.com/hyperledger/fabric
#- /tmp/:/tmp/
- ./scripts:/tmp/scripts
# solo mode configuration
#- ./solo/channel-artifacts:/tmp/channel-artifacts
#- ./solo/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml
#- ./solo/crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml
#- ./solo/crypto-config:/etc/hyperledger/fabric/crypto-config
#- ./examples:/opt/gopath/src/github.com/hyperledger/fabric/examples
# kafka mode configuration
- ./kafka/channel-artifacts:/tmp/channel-artifacts
- ./kafka/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml
- ./kafka/crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml
- ./kafka/crypto-config:/etc/hyperledger/fabric/crypto-config
- ./examples:/opt/gopath/src/github.com/hyperledger/fabric/examples

View File

@ -0,0 +1,78 @@
# All elements in this file should depend on the base-solo.yaml
# Provided solo-base fabric network with:
# ca.org1.example.com
# ca.org2.example.com
# orderer.example.com
# peer0.org1.example.com
# peer1.org1.example.com
# peer0.org2.example.com
# peer1.org2.example.com
# cli
version: '2' # v3 does not support 'extends' yet
services:
ca.org1.example.com: # ca node for org1
extends:
file: base-solo.yaml
service: ca.org1.example.com
environment:
- FABRIC_CA_SERVER_TLS_ENABLED=false
ca.org2.example.com: # ca node for org1
extends:
file: base-solo.yaml
service: ca.org2.example.com
environment:
- FABRIC_CA_SERVER_TLS_ENABLED=false
orderer.example.com: # orderer node for example org
extends:
file: base-solo.yaml
service: orderer.example.com
environment:
- ORDERER_GENERAL_TLS_ENABLED=false
cli: # client node
extends:
file: base-solo.yaml
service: cli
environment:
#- GOPATH=/opt/gopath
- CORE_PEER_TLS_ENABLED=false # to enable TLS, change to false
## following are peer nodes ##
peer0.org1.example.com:
extends:
file: base-solo.yaml
service: peer0.org1.example.com
environment:
- CORE_PEER_TLS_ENABLED=false
peer1.org1.example.com:
extends:
file: base-solo.yaml
service: peer1.org1.example.com
environment:
- CORE_PEER_TLS_ENABLED=false
peer0.org2.example.com:
extends:
file: base-solo.yaml
service: peer0.org2.example.com
environment:
- CORE_PEER_TLS_ENABLED=false
peer1.org2.example.com:
extends:
file: base-solo.yaml
service: peer1.org2.example.com
environment:
- CORE_PEER_TLS_ENABLED=false
event-listener:
extends:
file: base-solo.yaml
service: event-listener

View File

@ -0,0 +1,256 @@
# All elements in this file should depend on the base.yaml
# Provided a Kafka enabled fabric network with:
# ca.org1.example.com
# ca.org2.example.com
# orderer.example.com
# peer0.org1.example.com
# peer1.org1.example.com
# peer0.org2.example.com
# peer1.org2.example.com
# 3 zookeeper nodes
# 4 kafka nodes
# cli
version: '2' # v3 does not support 'extends' yet
services:
ca.org1.example.com:
extends:
file: base.yaml
service: ca-base
container_name: ca.org1.example.com
hostname: ca.org1.example.com
environment:
- FABRIC_CA_SERVER_CA_NAME=ca-org1
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk
ports:
- "7054:7054"
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk -b admin:adminpw -d'
ca.org2.example.com:
extends:
file: base.yaml
service: ca-base
container_name: ca.org2.example.com
hostname: ca.org2.example.com
environment:
- FABRIC_CA_SERVER_CA_NAME=ca-org2
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk
ports:
- "8054:7054"
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk -b admin:adminpw -d'
orderer.example.com: # There can be multiple orderers
extends:
file: base.yaml
service: orderer-base
container_name: orderer.example.com
hostname: orderer.example.com
ports:
- "7050:7050"
environment:
# Kafka related configurations
- ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
- ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
- ORDERER_KAFKA_VERBOSE=true
volumes:
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
- ./kafka/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block
command: orderer start
cli:
extends:
file: base.yaml
service: cli-base
container_name: fabric-cli
hostname: fabric-cli
tty: true
environment:
- CORE_PEER_ID=fabric-cli
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051 # default to operate on peer0.org1
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
volumes:
- ./scripts:/tmp/scripts
- ./crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml
- ./crypto-config:/etc/hyperledger/fabric/crypto-config
- ./kafka/channel-artifacts:/tmp/channel-artifacts
- ./kafka/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml
- ./examples:/opt/gopath/src/examples
## following are peer nodes ##
peer0.org1.example.com:
extends:
file: base.yaml
service: peer-base
container_name: peer0.org1.example.com
hostname: peer0.org1.example.com
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7051:7051
- 7052:7052
- 7053:7053
peer1.org1.example.com:
extends:
file: base.yaml
service: peer-base
container_name: peer1.org1.example.com
hostname: peer1.org1.example.com
environment:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org1.example.com:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 8051:7051
- 8052:7052
- 8053:7053
peer0.org2.example.com:
extends:
file: base.yaml
service: peer-base
container_name: peer0.org2.example.com
hostname: peer0.org2.example.com
environment:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org2.example.com:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 9051:7051
- 9052:7052
- 9053:7053
peer1.org2.example.com:
extends:
file: base.yaml
service: peer-base
container_name: peer1.org2.example.com
hostname: peer1.org2.example.com
environment:
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org2.example.com:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 10051:7051
- 10052:7052
- 10053:7053
# ZooKeeper services, at least 3 nodes
zookeeper0:
extends:
file: base.yaml
service: zookeeper-base
container_name: zookeeper0
hostname: zookeeper0
environment:
- ZOO_MY_ID=1
- ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888
zookeeper1:
extends:
file: base.yaml
service: zookeeper-base
container_name: zookeeper1
hostname: zookeeper1
environment:
- ZOO_MY_ID=2
- ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888
zookeeper2:
extends:
file: base.yaml
service: zookeeper-base
container_name: zookeeper2
hostname: zookeeper2
environment:
- ZOO_MY_ID=3
- ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888
# Kafka services, at least 4 node to tolerant work with 1 node failure
kafka0:
extends:
file: base.yaml
service: kafka-base
container_name: kafka0
hostname: kafka0
environment:
- KAFKA_BROKER_ID=0
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
kafka1:
extends:
file: base.yaml
service: kafka-base
container_name: kafka1
hostname: kafka1
environment:
- KAFKA_BROKER_ID=1
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
kafka2:
extends:
file: base.yaml
service: kafka-base
container_name: kafka2
hostname: kafka2
environment:
- KAFKA_BROKER_ID=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
kafka3:
extends:
file: base.yaml
service: kafka-base
container_name: kafka3
hostname: kafka3
environment:
- KAFKA_BROKER_ID=3
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181

View File

@ -0,0 +1,203 @@
# All elements in this file should depend on the base.yaml
# Provided solo-base fabric network with:
# ca.org1.example.com
# ca.org2.example.com
# orderer.example.com
# peer0.org1.example.com
# peer1.org1.example.com
# peer0.org2.example.com
# peer1.org2.example.com
# cli
version: '2' # v3 does not support 'extends' yet
services:
ca.org1.example.com: # ca node for org1
extends:
file: base.yaml
service: ca-base
container_name: ca.org1.example.com
hostname: ca.org1.example.com
environment:
- FABRIC_CA_SERVER_CA_NAME=ca-org1
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk
ports:
- "7054:7054"
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk -b admin:adminpw -d'
ca.org2.example.com: # ca node for org2
extends:
file: base.yaml
service: ca-base
container_name: ca.org2.example.com
hostname: ca.org2.example.com
environment:
- FABRIC_CA_SERVER_CA_NAME=ca-org2
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk
ports:
- "8054:7054"
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk -b admin:adminpw -d'
orderer.example.com: # orderer in solo mode
extends:
file: base.yaml
service: orderer-base
container_name: orderer.example.com
hostname: orderer.example.com
ports:
- "7050:7050"
volumes:
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
- ./solo/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block
## following are peer nodes ##
peer0.org1.example.com:
extends:
file: peer.yaml
service: peer-solo
container_name: peer0.org1.example.com
hostname: peer0.org1.example.com
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7051:7051
- 7052:7052
- 7053:7053
peer1.org1.example.com:
extends:
file: peer.yaml
service: peer-solo
container_name: peer1.org1.example.com
hostname: peer1.org1.example.com
environment:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 8051:7051
- 8052:7052
- 8053:7053
peer0.org2.example.com:
extends:
file: peer.yaml
service: peer-solo
container_name: peer0.org2.example.com
hostname: peer0.org2.example.com
environment:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org2.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 9051:7051
- 9052:7052
- 9053:7053
peer1.org2.example.com:
extends:
file: peer.yaml
service: peer-solo
container_name: peer1.org2.example.com
hostname: peer1.org2.example.com
environment:
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org2.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 10051:7051
- 10052:7052
- 10053:7053
peer0.org3.example.com:
extends:
file: peer.yaml
service: peer-solo
container_name: peer0.org3.example.com
hostname: peer0.org3.example.com
environment:
- CORE_PEER_ID=peer0.org3.example.com
- CORE_PEER_ADDRESS=peer0.org3.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org3.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.example.com:7051
- CORE_PEER_LOCALMSPID=Org3MSP
volumes:
- ./crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 11051:7051
- 11052:7052
- 11053:7053
cli: # client node
extends:
file: base.yaml
service: cli-base
container_name: fabric-cli
hostname: fabric-cli
volumes:
- ./scripts:/tmp/scripts
- ./crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml
- ./crypto-config:/etc/hyperledger/fabric/crypto-config
- ./solo/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml
- ./solo/channel-artifacts:/tmp/channel-artifacts
- ./examples:/opt/gopath/src/examples
#deprecated
event-listener:
extends:
file: base.yaml
service: event-listener-base
container_name: fabric-event-listener
hostname: fabric-event-listener
environment:
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051 # default to operate on peer0.org1
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.Org1.example.com/msp
volumes:
- ./scripts:/tmp/scripts
- ./crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml
- ./crypto-config:/etc/hyperledger/fabric/crypto-config
- ./solo/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml
- ./solo/channel-artifacts:/tmp/channel-artifacts
- ./examples:/opt/gopath/src/examples
command: bash -c 'while true; do sleep 1; block-listener -events-address=peer0.org1.example.com:7053 -events-mspdir=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/ -events-mspid=Org1MSP; done'
#command: bash -c 'while true; do sleep 20170504; done'

View File

@ -0,0 +1,164 @@
# Contains the base template for all Hyperledger Fabric services
# Never directly use services in this template, but inherent
# All services are abstract without any names, config or port mapping
# https://github.com/yeasy/docker-compose-files
#
# * ca-base: base for fabric-ca
# * orderer-base: base for fabric-orderer
# * peer-base: base for fabric-peer
# * cli-base: base for fabric peer client
# * event-listener-base: base for fabric eventhub listener
# * kafka-base: base for kafka
# * zookeeper-base: base for fabric-zookeeper
# * couchdb-base: base for couchdb
# * explorer-base: base for Hyperledger blockchain-explorer
# * mysql-base: base for MySQL
version: '2' # compose v3 still doesn't support `extends`, shame!
services:
ca-base:
image: yeasy/hyperledger-fabric-ca:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_TLS_ENABLED=true # change to false to disable TLS
orderer-base:
image: yeasy/hyperledger-fabric-orderer:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
# Default config can be found at https://github.com/hyperledger/fabric/blob/master/orderer/common/localconfig/config.go
environment:
- ORDERER_GENERAL_LOGLEVEL=DEBUG # default: INFO
- ORDERER_GENERAL_LOGFORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 # default: 127.0.0.1
- ORDERER_GENERAL_GENESISMETHOD=file # default: provisional
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP # default: DEFAULT
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
- ORDERER_GENERAL_LEDGERTYPE=file
#- ORDERER_GENERAL_LEDGERTYPE=json # default: file
- ORDERER_GENERAL_BATCHTIMEOUT=1s
- ORDERER_GENERAL_MAXMESSAGECOUNT=10
- ORDERER_GENERAL_MAXWINDOWSIZE=1000
- ORDERER_GENERAL_LISTENPORT=7050
#- ORDERER_RAMLEDGER_HISTORY_SIZE=100 #only useful when use ram ledger
# enabled TLS
- ORDERER_GENERAL_TLS_ENABLED=true # default: false
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
volumes:
- $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric
expose:
- "7050" #
#command: bash -c 'bash /tmp/orderer_build.sh; orderer start' # use this if to debug orderer
command: orderer start
peer-base: # abstract base for fabric-peer, will be used in peer.yaml
image: yeasy/hyperledger-fabric-peer:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
environment:
- CORE_PEER_ADDRESSAUTODETECT=false
- CORE_LOGGING_LEVEL=DEBUG
- CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${NETWORK} # uncomment this to use specific network
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false # whether this node is the org leader, default to false
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=0.0.0.0:7051 # external addr for peers in other orgs
- CORE_PEER_PROFILE_ENABLED=false
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
- CORE_CHIANCODE_LOGGING_LEVEL=DEBUG
- CORE_CHIANCODE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
volumes:
- $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric
# docker.sock is mapped as the default CORE_VM_ENDPOINT
- /var/run/docker.sock:/var/run/docker.sock
expose:
- "7051" # Grpc
- "7052" # Peer CLI
- "7053" # Peer Event
#command: bash -c 'bash /tmp/peer_build.sh; peer node start'
command: peer node start
cli-base:
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
environment:
- CORE_LOGGING_LEVEL=DEBUG
- CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
- CORE_PEER_TLS_ENABLED=true # to enable TLS, change to true
- ORDERER_CA=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: bash -c 'cd /tmp; source scripts/func.sh; while true; do sleep 20170504; done'
#deprecated
event-listener-base:
image: yeasy/hyperledger-fabric:${FABRIC_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
environment:
- CORE_PEER_ID=fabric-event-listener
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_TLS_ENABLED=false # event-listener doesn't support TLS
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
#command: bash -c 'block-listener -events-address=peer0.org1.example.com:7053 -events-mspdir=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/ -events-mspid=Org1MSP'
command: bash -c 'while true; do sleep 20170504; done'
zookeeper-base:
image: hyperledger/fabric-zookeeper:${EXT_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
expose:
- '2181'
- '2888'
- '3888'
kafka-base:
# official repo doesn't have 1.1.0-alpha tag, however, kafka changes version recently
#image: yeasy/hyperledger-fabric-kafka:0.10.2.0
image: hyperledger/fabric-kafka:${EXT_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
environment:
- KAFKA_MESSAGE_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
- KAFKA_REPLICA_FETCH_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
- KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
- KAFKA_LOG_RETENTION_MS=-1
expose:
- '9092'
couchdb-base:
image: hyperledger/fabric-couchdb:${EXT_IMG_TAG}
restart: always
network_mode: ${NETWORK}
tty: true
explorer-base:
image: yeasy/blockchain-explorer:0.1.0-preview # Till we have official image
expose:
- "8080" # HTTP port
command: bash -c 'sleep 10; node main.js'
mysql-base: # mysql service
image: mysql:8.0
restart: always
network_mode: ${NETWORK}
expose:
- "3306"
networks:
default:
external:
name: ${NETWORK}

View File

@ -0,0 +1,18 @@
OU
Role
EnrollmentID
RevocationHandleD
/KÙ—\TMÖ°NÉ®ðc[½ó_­Óš €»?8þñr´-<2D>`—S¸Á!*1WØø~þ¿þöD
Ò!ÐÂR"$“ºDþeR¢œoö{Ù%‡{„ú¾ c†Û¾ CO?wê=Û¦(\Ó¹Z<C2B9>üEª§ï«\Ût‡"D
÷s€“@É´O<C2B4>ojRA£hÙ¬ùn¥
Á3ÀRUEÇy¯> FÆ0mpPr»è{ÚV㥟¦æpö¡ÀM¨ù gèn"D
ÀKV¨Q£Ì•OÐÄ|ß!š°R*!å¹îàW<1B>àdˆ tT@w.ÛáŸù' mùüp¶"Qã2t[ñ<>#™Ñ„"D
¹ppŸ²¨•ž9J8wÎœú <™è× [™,>˜OÀH€
Ïô?[®‰ztýP_Á-gto+«4Ô³æ?$"D
<20>º¡)T¦p3o<sÆ6MŽý ~Ñx×]x È 笴.)ûºÿäKÌ!_IÒá=åD•î*•îÜú*ˆ
€G£e—Ã÷†xùh”X±MHY¬Ï±½h±£PB„½ ^Ï„/„aÔÃù`Æ™ï\áJHay¨
Ùñ`­BäyÑÐÓ OëŠÊõGf‰ôͨKÞXåEËð|~°:<16>¾ " <20>Sr{ȼtÕ³D•¶ƒþ²º?¹—WNèlOùÓˆ'2D
K¨û<C2A8>öâ0VÊÄEì”BV†êûª$ßxâj¡†ö "~AŠJ9<4A>Ù`mü<À^Ž_9 óz$Q¬÷:D
8°QÂÈ*´ú½ÕDhïñ<C3AF>Lù26µOÀxN Äû «>MX>õÛ¿e£ MxõB) IÜTô¾E<C2BE>%öÍB I“°lÌ0„hŸõ@Q ¨³§ ƒ«Ë‰Û¡µJJ ]œA½ëò0³¨(Ð<>O ëx]<5D>QGÏ-«Š1R ¥šÌeÈëC†Á•`>`£Fû
¢l=Á‰f0øô

View File

@ -0,0 +1,5 @@
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEDSMDdZOsmA1SpSm9GK1mKkTPBPVKjeYo
mEZMM/kqHNiXQErz6y77zu+kaxVwMM2I+jipDuYHzFxJA9m27hpFODNHApg5WEla
Ak5Fo+Ak9cw5WUydukL1FjBg3UICNOgi
-----END PUBLIC KEY-----

View File

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICHjCCAcWgAwIBAgIUFBjX17iaFQ0kRSLN1YQIdlBIdM0wCgYIKoZIzj0EAwIw
bDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRkwFwYDVQQK
ExBvcmcxLmV4YW1wbGUuY29tMQswCQYDVQQLEwJjYTEcMBoGA1UEAxMTY2Eub3Jn
MS5leGFtcGxlLmNvbTAeFw0xODEwMTAwOTI2MDBaFw0zMzEwMDYwOTI2MDBaMGwx
CzAJBgNVBAYTAlVTMRcwFQYDVQQIEw5Ob3J0aCBDYXJvbGluYTEZMBcGA1UEChMQ
b3JnMS5leGFtcGxlLmNvbTELMAkGA1UECxMCY2ExHDAaBgNVBAMTE2NhLm9yZzEu
ZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR/vnxyLUrmMJJx
h1nGAk+YidN8RL0XKl8gjzNa2SuEHfaROUhBVU3r06rDuJoNn+P3tcIwFsgndJmk
vLrCBcQDo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd
BgNVHQ4EFgQUu79ukG5b4N19gYSYYALk+wY91SYwCgYIKoZIzj0EAwIDRwAwRAIg
THDvbxlsa/Xw0gEAXlSfNS5XIthdULlQmsWzA0WEz1ACICXifW6iWfl4fibYwqR5
L/XiIQ/2UQ9nHnPbZm3ISVvN
-----END CERTIFICATE-----

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgiN1Z0HqaMHo8VPPt
2267O46l2yZ1r411HjSr9rOPXeOhRANCAAR/vnxyLUrmMJJxh1nGAk+YidN8RL0X
Kl8gjzNa2SuEHfaROUhBVU3r06rDuJoNn+P3tcIwFsgndJmkvLrCBcQD
-----END PRIVATE KEY-----

View File

@ -0,0 +1,132 @@
version: 1.3.0
port: 7054
debug: false
crlsizelimit: 512000
tls:
enabled: false
certfile: null
keyfile: null
clientauth:
type: noclientcert
certfiles: null
ca:
name: ca.org1.example.com
keyfile: ca.org1.example.com_sk
certfile: ca.org1.example.com-cert.pem
chainfile: null
crl:
expiry: 24h
registry:
maxenrollments: -1
identities:
- name: admin-default
pass: pass-default
type: client
affiliation: ""
attrs:
hf.Registrar.Roles: '*'
hf.Registrar.DelegateRoles: '*'
hf.Revoker: true
hf.IntermediateCA: true
hf.GenCRL: true
hf.Registrar.Attributes: '*'
hf.AffiliationMgr: true
db:
type: sqlite3
datasource: fabric-ca-server.db
tls:
enabled: false
certfiles: null
client:
certfile: null
keyfile: null
ldap:
enabled: false
url: ldap://<adminDN>:<adminPassword>@<host>:<port>/<base>
tls:
certfiles: null
client:
certfile: null
keyfile: null
attribute:
names:
- uid
- member
converters:
- name: null
value: null
maps:
groups:
- name: null
value: null
affiliations:
org1:
- department1
- department2
org2:
- department1
signing:
default:
usage:
- digital signature
expiry: 8760h
profiles:
ca:
usage:
- cert sign
- crl sign
expiry: 43800h
caconstraint:
isca: true
maxpathlen: 0
tls:
usage:
- signing
- key encipherment
- server auth
- client auth
- key agreement
expiry: 8760h
csr:
cn: ca.org1.example.com
keyrequest:
algo: ecdsa
size: 256
names:
- C: US
ST: North Carolina
L: null
O: org1.example.com
OU: ca
hosts:
- ca.org1.example.com
- localhost
ca:
expiry: 131400h
pathlength: 1
idemix:
rhpoolsize: 1000
nonceexpiration: 15s
noncesweepinterval: 15m
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
keystore: msp/keystore
cacount: null
cafiles: null
intermediate:
parentserver:
url: null
caname: null
enrollment:
hosts: null
profile: null
label: null
tls:
certfiles: null
client:
certfile: null
keyfile: null

View File

@ -0,0 +1,6 @@
-----BEGIN PRIVATE KEY-----
MIGkAgEBBDB9kCD1CUKnFFo6ks3Mo2qS/X+GFNPPT0SZkeR4iHswUzsZIV7bTwN9
0RDjlfS2Ix+gBwYFK4EEACKhZANiAAQNIwN1k6yYDVKlKb0YrWYqRM8E9UqN5iiY
Rkwz+Soc2JdASvPrLvvO76RrFXAwzYj6OKkO5gfMXEkD2bbuGkU4M0cCmDlYSVoC
TkWj4CT1zDlZTJ26QvUWMGDdQgI06CI=
-----END PRIVATE KEY-----

View File

@ -0,0 +1 @@
<EFBFBD>ƶ<EFBFBD><19><><EFBFBD><16><><EFBFBD>f<EFBFBD>i<EFBFBD>:<3A>bb<62><62>f<EFBFBD>:<3A>߶<EFBFBD><DFB6><EFBFBD>G

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgiN1Z0HqaMHo8VPPt
2267O46l2yZ1r411HjSr9rOPXeOhRANCAAR/vnxyLUrmMJJxh1nGAk+YidN8RL0X
Kl8gjzNa2SuEHfaROUhBVU3r06rDuJoNn+P3tcIwFsgndJmkvLrCBcQD
-----END PRIVATE KEY-----

View File

@ -0,0 +1,5 @@
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEWdv1PmR2LLHqufi+l8aYtxnRvnJBwHop
mSWv/TJgomLUWfPd2jBSWZEhY0FpkAPSDSJQNRIG8wMVqbWRcL3uYIyqj3PMO6yt
LdTu49HIFPocwCLg3KNyA4xpcS8zUjc4
-----END PUBLIC KEY-----

View File

@ -0,0 +1,132 @@
version: 1.3.0
port: 7054
debug: false
crlsizelimit: 512000
tls:
enabled: false
certfile: null
keyfile: null
clientauth:
type: noclientcert
certfiles: null
ca:
name: tlsca.org1.example.com
keyfile: tlsca.org1.example.com_sk
certfile: tlsca.org1.example.com-cert.pem
chainfile: null
crl:
expiry: 24h
registry:
maxenrollments: -1
identities:
- name: admin-default
pass: pass-default
type: client
affiliation: ""
attrs:
hf.Registrar.Roles: '*'
hf.Registrar.DelegateRoles: '*'
hf.Revoker: true
hf.IntermediateCA: true
hf.GenCRL: true
hf.Registrar.Attributes: '*'
hf.AffiliationMgr: true
db:
type: sqlite3
datasource: fabric-ca-server.db
tls:
enabled: false
certfiles: null
client:
certfile: null
keyfile: null
ldap:
enabled: false
url: ldap://<adminDN>:<adminPassword>@<host>:<port>/<base>
tls:
certfiles: null
client:
certfile: null
keyfile: null
attribute:
names:
- uid
- member
converters:
- name: null
value: null
maps:
groups:
- name: null
value: null
affiliations:
org1:
- department1
- department2
org2:
- department1
signing:
default:
usage:
- digital signature
expiry: 8760h
profiles:
ca:
usage:
- cert sign
- crl sign
expiry: 43800h
caconstraint:
isca: true
maxpathlen: 0
tls:
usage:
- signing
- key encipherment
- server auth
- client auth
- key agreement
expiry: 8760h
csr:
cn: tlsca.org1.example.com
keyrequest:
algo: ecdsa
size: 256
names:
- C: US
ST: North Carolina
L: null
O: org1.example.com
OU: tlsca
hosts:
- tlsca.org1.example.com
- localhost
ca:
expiry: 131400h
pathlength: 1
idemix:
rhpoolsize: 1000
nonceexpiration: 15s
noncesweepinterval: 15m
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
keystore: msp/keystore
cacount: null
cafiles: null
intermediate:
parentserver:
url: null
caname: null
enrollment:
hosts: null
profile: null
label: null
tls:
certfiles: null
client:
certfile: null
keyfile: null

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgIBJvF5e9l85ObbFs
duRrWd2ZPgc/vmaR231EQhsibl6hRANCAAR+EOYSg7O1tuEvYiXkWlNtg06RjTzv
sz9aASDbkjLfaIDf+mOjUzESXAlXqma+hy/6EJT+Bt7fVq0mdvVTlec6
-----END PRIVATE KEY-----

View File

@ -0,0 +1,6 @@
-----BEGIN PRIVATE KEY-----
MIGkAgEBBDAOZeFX1SIKBZaYMr4mlObgPA+nf9HPxUpPn6LnwuJin86W0OlRpBcf
m52W/svE6cegBwYFK4EEACKhZANiAARZ2/U+ZHYsseq5+L6Xxpi3GdG+ckHAeimZ
Ja/9MmCiYtRZ893aMFJZkSFjQWmQA9INIlA1EgbzAxWptZFwve5gjKqPc8w7rK0t
1O7j0cgU+hzAIuDco3IDjGlxLzNSNzg=
-----END PRIVATE KEY-----

View File

@ -0,0 +1 @@
<EFBFBD>Fm'<27>Mo<4D>v<EFBFBD>k4x<34>E%<25><><EFBFBD> {5<>*B<>Mql<71><6C>

View File

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICKjCCAdGgAwIBAgIUYILtTrGFkEL2QHDFj1jvfBAPZYQwCgYIKoZIzj0EAwIw
cjELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRkwFwYDVQQK
ExBvcmcxLmV4YW1wbGUuY29tMQ4wDAYDVQQLEwV0bHNjYTEfMB0GA1UEAxMWdGxz
Y2Eub3JnMS5leGFtcGxlLmNvbTAeFw0xODEwMTAwOTI2MDBaFw0zMzEwMDYwOTI2
MDBaMHIxCzAJBgNVBAYTAlVTMRcwFQYDVQQIEw5Ob3J0aCBDYXJvbGluYTEZMBcG
A1UEChMQb3JnMS5leGFtcGxlLmNvbTEOMAwGA1UECxMFdGxzY2ExHzAdBgNVBAMT
FnRsc2NhLm9yZzEuZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC
AAR+EOYSg7O1tuEvYiXkWlNtg06RjTzvsz9aASDbkjLfaIDf+mOjUzESXAlXqma+
hy/6EJT+Bt7fVq0mdvVTlec6o0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/
BAgwBgEB/wIBATAdBgNVHQ4EFgQU8TyFJWYtXTJDpEvvaA8vwVFCT2IwCgYIKoZI
zj0EAwIDRwAwRAIgAmyCF1D7mXAjHZpBwQsF2pOXS2V/LQ+j3Wg0hvjixZgCICEh
X7C57zvM+RKPMYjWdlzXvt1JU+8l6nw9CGsWCPnY
-----END CERTIFICATE-----

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgIBJvF5e9l85ObbFs
duRrWd2ZPgc/vmaR231EQhsibl6hRANCAAR+EOYSg7O1tuEvYiXkWlNtg06RjTzv
sz9aASDbkjLfaIDf+mOjUzESXAlXqma+hy/6EJT+Bt7fVq0mdvVTlec6
-----END PRIVATE KEY-----

View File

@ -0,0 +1,162 @@
#############################################################################
# This is a configuration file for the fabric-ca-client command.
#
# COMMAND LINE ARGUMENTS AND ENVIRONMENT VARIABLES
# ------------------------------------------------
# Each configuration element can be overridden via command line
# arguments or environment variables. The precedence for determining
# the value of each element is as follows:
# 1) command line argument
# Examples:
# a) --url https://localhost:7054
# To set the fabric-ca server url
# b) --tls.client.certfile certfile.pem
# To set the client certificate for TLS
# 2) environment variable
# Examples:
# a) FABRIC_CA_CLIENT_URL=https://localhost:7054
# To set the fabric-ca server url
# b) FABRIC_CA_CLIENT_TLS_CLIENT_CERTFILE=certfile.pem
# To set the client certificate for TLS
# 3) configuration file
# 4) default value (if there is one)
# All default values are shown beside each element below.
#
# FILE NAME ELEMENTS
# ------------------
# The value of all fields whose name ends with "file" or "files" are
# name or names of other files.
# For example, see "tls.certfiles" and "tls.client.certfile".
# The value of each of these fields can be a simple filename, a
# relative path, or an absolute path. If the value is not an
# absolute path, it is interpretted as being relative to the location
# of this configuration file.
#
#############################################################################
#############################################################################
# Client Configuration
#############################################################################
# URL of the Fabric-ca-server (default: http://localhost:7054)
url: http://ca.org1.example.com:7054
# Membership Service Provider (MSP) directory
# This is useful when the client is used to enroll a peer or orderer, so
# that the enrollment artifacts are stored in the format expected by MSP.
mspdir: msp
#############################################################################
# TLS section for secure socket connection
#
# certfiles - PEM-encoded list of trusted root certificate files
# client:
# certfile - PEM-encoded certificate file for when client authentication
# is enabled on server
# keyfile - PEM-encoded key file for when client authentication
# is enabled on server
#############################################################################
tls:
# TLS section for secure socket connection
certfiles:
client:
certfile:
keyfile:
#############################################################################
# Certificate Signing Request section for generating the CSR for an
# enrollment certificate (ECert)
#
# cn - Used by CAs to determine which domain the certificate is to be generated for
#
# serialnumber - The serialnumber field, if specified, becomes part of the issued
# certificate's DN (Distinguished Name). For example, one use case for this is
# a company with its own CA (Certificate Authority) which issues certificates
# to its employees and wants to include the employee's serial number in the DN
# of its issued certificates.
# WARNING: The serialnumber field should not be confused with the certificate's
# serial number which is set by the CA but is not a component of the
# certificate's DN.
#
# names - A list of name objects. Each name object should contain at least one
# "C", "L", "O", or "ST" value (or any combination of these) where these
# are abbreviations for the following:
# "C": country
# "L": locality or municipality (such as city or town name)
# "O": organization
# "OU": organizational unit, such as the department responsible for owning the key;
# it can also be used for a "Doing Business As" (DBS) name
# "ST": the state or province
#
# Note that the "OU" or organizational units of an ECert are always set according
# to the values of the identities type and affiliation. OUs are calculated for an enroll
# as OU=<type>, OU=<affiliationRoot>, ..., OU=<affiliationLeaf>. For example, an identity
# of type "client" with an affiliation of "org1.dept2.team3" would have the following
# organizational units: OU=client, OU=org1, OU=dept2, OU=team3
#
# hosts - A list of host names for which the certificate should be valid
#
#############################################################################
csr:
cn: admin-default
keyrequest:
algo: ecdsa
size: 256
serialnumber:
names:
- C: US
ST: North Carolina
L:
O: Hyperledger
OU: Fabric
hosts:
- ca-client
#############################################################################
# Registration section used to register a new identity with fabric-ca server
#
# name - Unique name of the identity
# type - Type of identity being registered (e.g. 'peer, app, user')
# affiliation - The identity's affiliation
# maxenrollments - The maximum number of times the secret can be reused to enroll.
# Specially, -1 means unlimited; 0 means to use CA's max enrollment
# value.
# attributes - List of name/value pairs of attribute for identity
#############################################################################
id:
name:
type:
affiliation:
maxenrollments: 0
attributes:
# - name:
# value:
#############################################################################
# Enrollment section used to enroll an identity with fabric-ca server
#
# profile - Name of the signing profile to use in issuing the certificate
# label - Label to use in HSM operations
#############################################################################
enrollment:
profile:
label:
#############################################################################
# Name of the CA to connect to within the fabric-ca server
#############################################################################
caname:
#############################################################################
# BCCSP (BlockChain Crypto Service Provider) section allows to select which
# crypto implementation library to use
#############################################################################
bccsp:
default: SW
sw:
hash: SHA2
security: 256
filekeystore:
# The directory used for the software file-based keystore
keystore: msp/keystore

View File

@ -0,0 +1,18 @@
OU
Role
EnrollmentID
RevocationHandleD
/KÙ—\TMÖ°NÉ®ðc[½ó_­Óš €»?8þñr´-<2D>`—S¸Á!*1WØø~þ¿þöD
Ò!ÐÂR"$“ºDþeR¢œoö{Ù%‡{„ú¾ c†Û¾ CO?wê=Û¦(\Ó¹Z<C2B9>üEª§ï«\Ût‡"D
÷s€“@É´O<C2B4>ojRA£hÙ¬ùn¥
Á3ÀRUEÇy¯> FÆ0mpPr»è{ÚV㥟¦æpö¡ÀM¨ù gèn"D
ÀKV¨Q£Ì•OÐÄ|ß!š°R*!å¹îàW<1B>àdˆ tT@w.ÛáŸù' mùüp¶"Qã2t[ñ<>#™Ñ„"D
¹ppŸ²¨•ž9J8wÎœú <™è× [™,>˜OÀH€
Ïô?[®‰ztýP_Á-gto+«4Ô³æ?$"D
<20>º¡)T¦p3o<sÆ6MŽý ~Ñx×]x È 笴.)ûºÿäKÌ!_IÒá=åD•î*•îÜú*ˆ
€G£e—Ã÷†xùh”X±MHY¬Ï±½h±£PB„½ ^Ï„/„aÔÃù`Æ™ï\áJHay¨
Ùñ`­BäyÑÐÓ OëŠÊõGf‰ôͨKÞXåEËð|~°:<16>¾ " <20>Sr{ȼtÕ³D•¶ƒþ²º?¹—WNèlOùÓˆ'2D
K¨û<C2A8>öâ0VÊÄEì”BV†êûª$ßxâj¡†ö "~AŠJ9<4A>Ù`mü<À^Ž_9 óz$Q¬÷:D
8°QÂÈ*´ú½ÕDhïñ<C3AF>Lù26µOÀxN Äû «>MX>õÛ¿e£ MxõB) IÜTô¾E<C2BE>%öÍB I“°lÌ0„hŸõ@Q ¨³§ ƒ«Ë‰Û¡µJJ ]œA½ëò0³¨(Ð<>O ëx]<5D>QGÏ-«Š1R ¥šÌeÈëC†Á•`>`£Fû
¢l=Á‰f0øô

View File

@ -0,0 +1,5 @@
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEDSMDdZOsmA1SpSm9GK1mKkTPBPVKjeYo
mEZMM/kqHNiXQErz6y77zu+kaxVwMM2I+jipDuYHzFxJA9m27hpFODNHApg5WEla
Ak5Fo+Ak9cw5WUydukL1FjBg3UICNOgi
-----END PUBLIC KEY-----

Some files were not shown because too many files have changed in this diff Show More