## Change Add a guard to the `disparate_dir` cleanup in `sync_instance` to prevent accidental deletion of the contract state directory when `DISPARATE_DIR` is not set. ## Background The `disparate` directory feature was introduced in the beta devkit image to support multisig deployments. The cluster script assumes `DISPARATE_DIR` is always set, however older NPM packages (below v0.6.8) do not pass this environment variable, leaving `$disparate_dir` as an empty string. With an empty `$disparate_dir` this line: ```bash [ -d $contract_dir/contract_fs/seed/state/$disparate_dir ] && rm -r $contract_dir/contract_fs/seed/state/$disparate_dir ``` Evaluates to: ```bash [ -d $contract_dir/contract_fs/seed/state/ ] && rm -r $contract_dir/contract_fs/seed/state/ ``` Deleting the entire state directory immediately after the contract bundle is copied in. ## Change Add a guard so the deletion only runs when `$disparate_dir` is actually set: ```bash # Before [ -d $contract_dir/contract_fs/seed/state/$disparate_dir ] && rm -r $contract_dir/contract_fs/seed/state/$disparate_dir # After [ -n "$disparate_dir" ] && [ -d $contract_dir/contract_fs/seed/state/$disparate_dir ] && rm -r $contract_dir/contract_fs/seed/state/$disparate_dir ``` ## Notes - NPM v0.6.8 correctly passes `DISPARATE_DIR=disparate` and is required for full beta devkit compatibility - This guard is defensive programming to protect against the state directory being accidentally deleted if an older NPM package is used with the beta image - For non-multisig deployments the disparate directory cleanup is skipped entirely which is the correct behaviour
HotPocket developer kit
This is the source repository of developer kit for HotPocket smart contract development. This toolkit makes use of Docker and NodeJS to provide a cross-platform HotPocket development tool for developers. Using the HotPocket developer kit, developers can spin-up local HotPocket clusters on their development machines and test HotPocket smart contracts.
We use Docker containers to run HotPocket and smart contracts in a Linux environment. We also use Docker containers and NodeJS for tooling so developers can use the tools on any platform as long as they install Docker and NodeJS.
Public documentation
https://github.com/EvernodeXRPL/evernode-sdk/blob/main/hpdevkit/index.md
Prerequisites
Docker build
Docker image containing cluster management shell scripts.
cd docker
docker build -t evernode/hpdevkit .
docker push evernode/hpdevkit
Run
docker run -it --rm --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock evernode/hpdevkit cluster create 2
hpdevkit npm build
hpdevkit is a cross-platform CLI tool distributed via NPM.
# local build
cd npm
npm install
npm run build
# publish to npm
npm login
npm run publish