Setting up the development environment
info
The environment will be setup for you automatically if you use Fluence CLI
To build Marine modules you need to install a CLI tool called marine
that uses the Rust wasm32-wasi
target and Marine environment to compile Wasm modules.
First, install Rust and supplementary tools:
sh
# install the Rust compiler and tools to `~/.cargo/bin`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh# add Rust tools to the current PATHsource $HOME/.cargo/env# install the nightly toolchainrustup install nightly-2023-12-06
sh
# install the Rust compiler and tools to `~/.cargo/bin`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh# add Rust tools to the current PATHsource $HOME/.cargo/env# install the nightly toolchainrustup install nightly-2023-12-06
To be able to compile Rust in Wasm, install the wasm32-wasi
compilation target:
sh
# install wasm32-wasi target for WebAssemblyrustup +nightly-2023-12-06 target add wasm32-wasi
sh
# install wasm32-wasi target for WebAssemblyrustup +nightly-2023-12-06 target add wasm32-wasi
To be able to use generate
subcommand of marine, install the cargo-generate
tool:
sh
# install cargo-generate target for the marine toolcargo install cargo-generate
sh
# install cargo-generate target for the marine toolcargo install cargo-generate
Then, install marine
and mrepl
:
sh
# install marinecargo +nightly-2023-12-06 install marine# install mrepl, it requires nightly toolchaincargo +nightly-2023-12-06 install mrepl
sh
# install marinecargo +nightly-2023-12-06 install marine# install mrepl, it requires nightly toolchaincargo +nightly-2023-12-06 install mrepl