You can configure the 'topology' that microfab creates, and also some limited configuration of the Fabric components.
Microfab can be configured by specifying the MICROFAB_CONFIG environment variable. For example, to start Microfab with different organizations using Docker, run the following commands:
export MICROFAB_CONFIG='{
"endorsing_organizations":[
{
"name": "SampleOrg"
}
],
"channels":[
{
"name": "mychannel",
"endorsing_organizations":[
"SampleOrg"
]
}
]
}'
docker run -p 8080:8080 -e MICROFAB_CONFIG ibmcom/ibp-microfab
The configuration is a JSON object with the following keys:
-
domainThe domain name to use. The domain name must be resolvable both outside and inside the container, and it must resolve to an IP address of that container (or the system hosting the container).
Default value:
"127-0-0-1.nip.io" -
portThe port to use. The port must be accessible both outside and inside the container.
Default value:
8080 -
directoryThe directory to store data in within the container.
Default value:
"/home/microfab/data"It is possible to map this externally as a volume mount; however often you can run into issues with the user inside the docker container having a different
idto the host user. It is suggested that do not volume mount this. -
ordering_organizationThe ordering organization.
Default value:
{ "name": "Orderer" // The name of the organization. } -
endorsing_organizationsThe list of endorsing organizations.
Default value:
[ { "name": "Org1" // The name of the organization. } ] -
channelsThe list of channels.
Default value:
[ { "name": "channel1", // The name of the channel. "endorsing_organizations": [ // The list of endorsing organizations that are members of the channel. "Org1" ], "capability_level": "V2_5" // Optional: the application capability level of the channel. } ] -
capability_levelThe application capability level of all channels. Can be overriden on a per-channel basis.
Default value:
"V2_5" -
couchdbWhether or not to use CouchDB as the world state database.
Default value:
true -
certificate_authoritiesWhether or not to create certificate authorities for all endorsing organizations.
Default value:
true -
timeoutThe time to wait for all components to start.
Default value:
"30s" -
tlsThe TLS configuration.
Default value:
{ "enabled": false, // Set to true to enable TLS. "certificate": null, // Optional: the TLS certificate to be used. "private_key": null, // Optional: the TLS private key to be used. "ca": null // Optional: the TLS CA certificate to be used. }
Configuration example for enabling TLS:
export MICROFAB_CONFIG='{
"port": 8443,
"tls": {
"enabled": true
}
}'
docker run -p 8443:8443 -e MICROFAB_CONFIG ibmcom/ibp-microfab
To alter the logging level of the Fabric Components, add -e FABRIC_LOGGING_SPEC=info to the docker run command. Any other environment variables set will be inheritted by the Fabric Components.