kleash
kleash

Reputation: 1321

Chaincode instantiate error /usr/bin/ld: cannot find -lxxx

My chaincode have a go dependency which needs C library.

I used vendor command to package dependencies and I can my vendor folder contains all the required .so files.

Chaincode installation goes fine without any problem.

But at chaincode instantiation, I am getting error:

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 2 "# github.com/chaincode/awesomeProject/vendor/github.com/wasmerio/go-ext-wasm/wasmer
/usr/bin/ld: cannot find -lwasmer_runtime_c_api
collect2: error: ld returned 1 exit status

This means it's unable to find the required dependencies at chaincode instantiation.

Any pointers on how it can be resolved?

Thanks

Upvotes: 0

Views: 200

Answers (1)

Gari Singh
Gari Singh

Reputation: 12013

If you used the CLI to package/install the chain code (peer chaincode install ...), then this won't work since as the command filters out all file extensions other than

var includeFileTypes = map[string]bool{
".c":    true,
".h":    true,
".s":    true,
".go":   true,
".yaml": true,
".json": true,

}

You can probably get this to work if you use the Node.js or Java SDK to package and install the chaincode.

Upvotes: 1

Related Questions