Closed tran-the-lam closed 12 months ago
How did you invoke your Init transaction function after deploying the smart contract?
I think Init fuction auto call when smart contract deployed.
Using Fabric v2 chaincode lifecycle deployment, the Init function is not called automatically. You can approve chaincode as requiring an initialization transaction function to be called before general use, but you need to invoke that initialization transaction function explicitly. See the chaincode deployment documentation (particularly Step Three: Approve a chaincode definition for your organization) for more details.
Init
is a special function name required by the low-level chaincode API but has no special meaning when using the higher-level Contract API. You can use whatever transaction function name you want as an initialization function. You still need to invoke it explicitly.
It is generally recommended to embed initialization logic into your chaincode rather than require invocation of a special initialization function.
Thanks a lot
I have one smart-contract and init function to save data, but smc was deployed then I get value from key, data return "".
Please help me!