You can compile the actor class to suitable wasm just by passing it as the root file to the moc compiler (or making it the main file of a dfx actor).
You’re main difficulty will then be quoting the code (and its serialized argument) as a couple of blobs in Motoko to pass to IC.install_code We don’t currently expose an official way for users to to serialize shared types to blobs.
(FTR: the way the compiler currently compiles an actor that imports an actor class is to recursively invoke the compiler on the actor class, embed the binary of the class as a blob in the importer, and compile a helper function for the class constructor that serializes the argument to a blob, creates and installs a new actor with the new blob and then casts the principal to the expected interface.)
Hi, Claudio. Thanks. The problem was adding cycles, but I solved it. I realized that it is better to use standard methods. Apparently, if you update the wasm code with install_code (wash_module), the built-in logic of the actor’s work ( functions, properties)it will be unavailable for calls from outside it.
I tried to convert wasm to blob format, but because the program was too large, the blob data reached 1.2m and the program could not be executed.
I want to use the motoko code method to perform code update and installation operations