In Hyperledger Fabric samples, what happens when magnetocorp.sh file is executed ? From official documentation, magnetocorp.sh is ran for setting admin environment variables. For setting admin in production system, do we have to follow the same procedures which would set up environment variables?
1 Answers
Of course you don't have to follow exactly. It really depends on how you design your system. The magnetocorp.sh requires to set the admin environment variables is because there is no docker setup with admin environment variables which is needed to execute admin CLI. The idea here is, the environment variable you set decide your identity. Therefore, to use admin command, you need to set those environment variables to point to admin cert and key etc.
2 solutions in production:
Setup a docker with admin environment variable, then use the docker for admin command. Example:
docker exec admin_container peer lifecycle chaincode install
Write a script begin with setting all the required environment variable, then execute the admin command in the script.

- 142
- 7
-
Thanks @Christopher. that was really help full – alex devassy Jan 12 '22 at 04:16