-1

I'm writing a chaincode where i need to read file in order to process the transaction but when my code tries to read a file from system it the error "no such file or directory". Even though that path is defined in the docker volumes.

But if i try to run a script file to read a file i'm able read a file outside of docker environment. And the I have provide in the chaincode is docker path it self. Attached error image : 1

Thanks

Volker
  • 40,468
  • 7
  • 81
  • 87

1 Answers1

0

The chaincode container does not have access to the host file system as there is no way (by design) for the chaincode container to mount an external volume. If you need to pass some type of configuration data to the chaincode at runtime, you should create a function to accept your config information and persist it to the state store. If you need this config state for other functions, then simply check to see if the state key exists in your other functions.

Gari Singh
  • 11,418
  • 2
  • 18
  • 41