Help with Motoko WASM files for a JavaScript Electron App

Dear IC Developers, we are building a Note App that runs on Electron, and will be able to save data to the IC.

We are now on the IC Saving feature and are glad to have made it work with our local replica by using a great Motoko code piece by @cyberowl.

However, we based our Electron - JavaScript code on an unusual pattern that @cyberowl used, instead of doing the usual dfx deploy, he uses a pre-compiled WASM file that corresponds mainly to two Motoko programs:

  • FileStorage.mo
  • FileScalingManager.mo

Which become

However, in order to grow the application we need to expand those two Motoko programs with new functionality, it is easy to do it in Motoko itself, but we do not know how to create those updated WASM files, does anyone know how we can go from the Motoko files to a WASM file as shown on the screenshot, and


the Github link?

Your help would be most appreciated, since it is urgent for us to continue with our development effort.

P.S. I did contact @cyberowl as well, but wanted to reach out the larger IC Dev Community too. Thanks.

Hey to get generated wasm’s of motoko canisters, you will have to deploy them using IC dfx sdk.
This will help : Internet Computer Loading
After that you just need to deploy both above motoko canisters using dfx deploy command and it will automatically generate latest wasm files of those canisters inside .dfx folder.

2 Likes

replied to the other thread.

1 Like

Thanks @cyberowl I also replied there.

@h1teshtr1path1 Thanks, first I did not understood what you said, but later it became clear, so after we ran the:

dfx deploy file_storage --argument=‘(false)’
// The command to compile the Motoko file

I followed your advice, and noticed that the above command creates a hidden .dfx directory, and inside of it we can find the WASM file!

I leave a screenshot for those that may be interested and are looking for that .wasm file too.

Thanks a lot!

P.S @cyberowl the issue is solved, we now see how to find the wasm file.

1 Like