Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Deploying smart contract from browser #546

Open
dominic-healid opened this issue May 8, 2019 · 5 comments
Open

Deploying smart contract from browser #546

dominic-healid opened this issue May 8, 2019 · 5 comments
Assignees
Labels
documentation Requires attention of documentation team. e.g. documentation is expected to be generated.

Comments

@dominic-healid
Copy link

Is it possible to deploy smart contract from browser?

Looks like the setcode function is expecting buffer data which is I believe not available in browser.

Please help if anyone knows how to solve this issue.

uncaught exception: {"code":500,"message":"Internal Service Error","error":{"code":3070003,"name":"wasm_serialization_error","what":"Serialization Error Processing WASM","details":[{"message":"magic number: loaded 926493744 but was expecting 1836278016","file":"wasm_interface.cpp","line_number":40,"method":"validate"},{"message":"pending console output: ","file":"apply_context.cpp","line_number":72,"method":"exec_one"}]}}
@tbfleming
Copy link
Contributor

If you're using eosjs 20, then put the wasm content in a Uint8Array.

@dominic-healid
Copy link
Author

@tbfleming do you have sample or test code for deploying smart contract? I've been using v16 and looks like it is now changed for v20.

@tbfleming
Copy link
Contributor

I don't have any current samples. Look at the system contract's or bios contract's abi for setcode.

@dominic-healid
Copy link
Author

I was able to make the setcode work but for the setabi, I'm still having issue. I'm trying to put the abi content to Uint8Array but no luck.

Thanks for the response @tbfleming

@tbfleming tbfleming added the docs label May 14, 2019
@tbfleming
Copy link
Contributor

Added to docs label: this probably needs to go in the docs. Please keep open until then.

@lparisc lparisc added documentation Requires attention of documentation team. e.g. documentation is expected to be generated. and removed docs labels Mar 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Requires attention of documentation team. e.g. documentation is expected to be generated.
Projects
None yet
Development

No branches or pull requests

4 participants