Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature Request] Support Issue a Token on webpage #4

Closed
jolestar opened this issue Mar 15, 2022 · 11 comments · Fixed by #12
Closed

[Feature Request] Support Issue a Token on webpage #4

jolestar opened this issue Mar 15, 2022 · 11 comments · Fixed by #12
Assignees
Labels
help wanted Extra attention is needed

Comments

@jolestar
Copy link
Contributor

Issue a Token on the webpage, and support some customization options, such as total issue amount, etc.

The most difficult part to achieve this requirement is: How to compile Move code on the webpage?

There are two possible approaches:

  1. Compile the move compiler to WASM, and call it in javascript.
  2. Support a compiler backend, the best way to do this is to provide a lambda function on AWS, for compiling Move source code to Move bytecode and Package.
@jolestar jolestar added the help wanted Extra attention is needed label Mar 15, 2022
@yubing744
Copy link
Collaborator

pick!

@yubing744
Copy link
Collaborator

yubing744 commented Apr 23, 2022

@yubing744
Copy link
Collaborator

yubing744 commented Apr 23, 2022

Playground compiles dove into wasm to support web builds
mpm is required to support this issue starcoinorg/starcoin#3363

@yubing744
Copy link
Collaborator

@jolestar I found rust target wasm32-unknown-emscripten support FS

https://emscripten.org/docs/api_reference/Filesystem-API.html
https://www.hellorust.com/setup/emscripten/

@yubing744
Copy link
Collaborator

@jolestar I tried to compile move-compiler with target wasm32-unknown-emscripten , but I have two problems:

  • undefined symbol: __gxx_personality_v0
    image
    I found a solution at Emscripten wasm32 compilation broken rust-lang/rust#85821, set the environment variable before build: EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0"

  • error[E0428]: the name inner is defined multiple times
    image
    No good solution for now

@yubing744
Copy link
Collaborator

@jolestar I found a new solution, using this wasmer-js library, and I'm verifying the feasibility.

@yubing744
Copy link
Collaborator

yubing744 commented May 21, 2022

@jolestar I have verified that it works, and I have written an example to demonstrate how to use wasmer-js to compile the move module in the browser.

image

@yubing744
Copy link
Collaborator

yubing744 commented Jun 1, 2022

@jolestar Now, I have implemented Compile the move compiler to WASM, and call it in javascript. Is it possible to create a new project move-js based on https://github.com/yubing744/move-js at https://github.com/starcoinorg. Then, I will use move-js to Issue a Token on webpage.

image

@jolestar
Copy link
Contributor Author

jolestar commented Jun 1, 2022

@jolestar Now, I have implemented Compile the move compiler to WASM, and call it in javascript. Is it possible to create a new project move-js based on https://github.com/yubing744/move-js at https://github.com/starcoinorg. Then, I will use move-js to Issue a Token on webpage.

image

Great! Give me permission, I transfer the project to starcoinorg.

@yubing744
Copy link
Collaborator

@jolestar Now, I have implemented Compile the move compiler to WASM, and call it in javascript. Is it possible to create a new project move-js based on https://github.com/yubing744/move-js at https://github.com/starcoinorg. Then, I will use move-js to Issue a Token on webpage.
image

Great! Give me permission, I transfer the project to starcoinorg.

I transferred the ownership of move-js to you.

@yubing744
Copy link
Collaborator

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants