From 3662eac0ceb4db066496ba5da3b41ab0fd6a34d5 Mon Sep 17 00:00:00 2001 From: Eguo Wang Date: Wed, 10 Jan 2024 23:32:36 +0800 Subject: [PATCH] Update the README.md and specifying the rust toolchain --- README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++ rust-toolchain.toml | 3 +++ 2 files changed, 64 insertions(+) create mode 100644 rust-toolchain.toml diff --git a/README.md b/README.md index 43389b63..675801fc 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,64 @@ const startDisassembleTask = async (app: HTMLDivElement) => { const app = document.querySelector('#app')! startDisassembleTask(app) ``` + +## Supported Rust Versions + +`@aptos/move-js` supports the version of Rust (toolchain and targets) specified +in [`rust-toolchain.toml`](rust-toolchain.toml). At the time of writing, we are +using version 1.77.0. However, this can change at any time if one of our +dependencies changes MSRV or through a new patch version. + +## Building from source + +Note: You will need rust installed also for this. https://www.rust-lang.org/tools/install or + +``` +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +Then get `@aptos/move-js` source: + +``` +git clone https://github.com/movefuns/move-js +cd move-js +git checkout aptos +``` + +Build the source + +``` +yarn install +yarn build +``` + +## Testing + +### Build and test the example program + +[my-counter](/examples/my-counter/) (Compiling move package into blob) + +``` +cd example/my-counter/ +yarn install +yarn dev +``` + +[disassemble](/examples/disassemble/) (Disassemble contract from bytecode) + +``` +cd example/disassemble +yarn install +yarn dev +``` + +### Unit test + +``` +yarn test +``` + +## License + +Licensed under the Apache License, Version 2.0, +see the [LICENSE](LICENSE) file for more information. diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..17c9ba22 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "nightly-2024-01-10" +targets = ["wasm32-wasi"]