This is the preferred development environment.
- Install NIX : https://nixos.org/download.html
- Start a nix development environment (From the repo Root):
nix develop
~~ NOT RECOMMENDED ~~
- Install LLVM
- Install NPM
- Install the typescript package:
- globally by running:
npm install typescript@latest -g
- or use the npx command with the --package flag, e.g.
npx --package typescript tsc --init
- Make sure it works:
tsc --version
- If it doesn't run:
npm config get prefix
- And make sure that path is in your
$PATH
.
- globally by running:
- Install webpack:
npm install --global webpack
npm install --global webpack-cli
- Install msgpack & bs58 libraries:
npm install @msgpack/msgpack
npm install bs58
This only needs to be done once when the development environment is created.
cargo install cargo-make
: see https://github.com/sagiegurari/cargo-makecargo make install-prereqs
Locutus is still under heavy development, so for now we include a locutus fork as a submodule. This will allow us to easily contribute any necessary patches upstream, until the locutus project stabilises.
To checkout, and initialize with the upstream locutus fork:
git clone --recurse-submodules git://github.com/...TODO...
If you forgot to add --recurse-submodules, then after checkout just run:
git submodule update --init
Make sure you are in a Nix dev shell: nix develop
- Build the Locutus Tools:
cargo make build-locutus
- Build the latest
ldt
tool:make build-tool
$ cd locutus/docker
$ docker compose build
...
$ cd ../..
$ CONTRACT_SRC_DIR=./contracts/posts/ ./locutus/docker/ldt.sh build
$ ./locutus/docker/ldt.sh publish --code contracts/posts/build/locutus/poc_proposal_assessment_posts.wasm --state contracts/posts/build/locutus/contract-state
PROJECT_SRC_DIR=/home/<something>/poc_pa_system <- Root of the Project being build
CONTRACT_SRC_DIR=/home/<something>/poc_pa_system <- Relative DIR under PROJECT_SRC_DIR to the Contract to build
Putting contract FwiG1DsyEHbvtsQaE6qrT5jbSD8vhwaQqSWCSchdWha2
$ CONTRACT_SRC_DIR=./web ./locutus/docker/ldt.sh build
$ cd locutus/docker
$ docker compose up