README setup instructions not working on Ubuntu
Expected Behavior
Following the install instructions in the README results in a working environment where yarn setup and yarn start work.
Current Behavior
Numerous issues encountered including confusion over what version of wasm-bindgen-cli should be installed. The README says 0.2.86; however, on one machine (clean Ubuntu 22.04 VM), it won't build without using 0.2.99.
Possible Solution
Steps to Reproduce (for bugs)
- Follow steps in README for initial setup
- Encounter issues during
yarn setupand/oryarn start
Context
Your Environment
- Version used: 1.7.1
- Environment name and version (e.g. Chrome 39, node.js 5.4): Node 20.10, Docker 27.4
- Operating System and version (desktop, server, or mobile): Ubuntu 22.04
On the machine where I did get yarn setup to work, here is the error encountered when running yarn start:
[DATA] #62 [dashmate_helper build-js 3/5] RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=/root/.cargo/registry/index --mount=type=cache,sharing=shared,id=cargo_registry_cache,target=/root/.cargo/registry/cache --mount=type=cache,sharing=shared,id=cargo_git,target=/root/.cargo/git/db --mount=type=secret,id=AWS source /root/env && cargo chef cook --recipe-path recipe.json --profile "dev" --package wasm-dpp --target wasm32-unknown-unknown --locked && if [[ -x /usr/bin/sccache ]]; then sccache --show-stats; fi
[DATA] #62 0.328 warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
[DATA] #62 0.328 package: /platform/packages/wasm-dpp/Cargo.toml
[DATA] #62 0.328 workspace: /platform/Cargo.toml
[DATA] #62 0.328 warning: /platform/packages/rs-dpp/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/feature-flags-contract/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/withdrawals-contract/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/dapi-grpc/Cargo.toml: unused manifest key: example.0.plugin
[DATA] #62 0.328 warning: /platform/packages/dapi-grpc/Cargo.toml: unused manifest key: example.1.plugin
[DATA] #62 0.328 warning: /platform/packages/dapi-grpc/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-json-schema-compatibility-validator/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-platform-serialization-derive/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-platform-value/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/dpns-contract/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/wallet-utils-contract/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-platform-version/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-platform-versioning/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-platform-value-convertible/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/strategy-tests/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/dashpay-contract/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/wasm-dpp/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/masternode-reward-shares-contract/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-drive-proof-verifier/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/data-contracts/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-platform-serialization/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-dapi-client/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-drive/Cargo.toml: unused manifest key: bench.0.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-drive/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-sdk/Cargo.toml: unused manifest key: example.0.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-sdk/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/simple-signer/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-dapi-grpc-macros/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.328 warning: /platform/packages/check-features/Cargo.toml: unused manifest key: bin.0.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-drive-abci/Cargo.toml: unused manifest key: bin.0.plugin
[DATA] #62 0.328 warning: /platform/packages/rs-drive-abci/Cargo.toml: unused manifest key: lib.plugin
[DATA] #62 0.393 Updating git repository https://github.com/QuantumExplorer/tower
[DATA]
[DATA] #62 1.022 Updating crates.io index
[DATA] #62 1.022 Updating git repository https://github.com/dashpay/rs-tenderdash-abci
[DATA]
[DATA] #62 1.563 Updating git repository https://github.com/dashpay/versioned-feature-core
[DATA]
[DATA] #62 1.814 Updating git repository https://github.com/qrayven/ciborium
[DATA]
[DATA] #62 2.268 Updating git repository https://github.com/dashpay/rust-dashcore
[DATA]
[DATA] #62 4.090 Updating git repository https://github.com/dashpay/jsonschema-rs
[DATA]
[DATA] #62 5.107 error: failed to get jsonschema as a dependency of package dpp v0.0.1 (/platform/packages/rs-dpp)
[DATA] #62 5.107
[DATA] #62 5.107 Caused by:
[DATA] #62 5.107 failed to load source for dependency jsonschema
[DATA] #62 5.107
[DATA] #62 5.107 Caused by:
[DATA] #62 5.107 Unable to update https://github.com/dashpay/jsonschema-rs?branch=configure_regexp#7b00a244
[DATA] #62 5.107
[DATA] #62 5.107 Caused by:
[DATA] #62 5.107 failed to clone into: /root/.cargo/git/db/jsonschema-rs-c12f580e0c2be399
[DATA] #62 5.107
[DATA] #62 5.107 Caused by:
[DATA] #62 5.107 no error
[DATA]
[DATA] #62 5.109 thread 'main' panicked at src/recipe.rs:218:27:
[DATA] #62 5.109 Exited with status code: 101
[DATA] #62 5.109 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[DATA]
[DATA] #62 ERROR: process "/bin/sh -c source /root/env && cargo chef cook --recipe-path recipe.json --profile "$CARGO_BUILD_PROFILE" --package wasm-dpp --target wasm32-unknown-unknown --locked && if [[ -x /usr/bin/sccache ]]; then sccache --show-stats; fi" did not complete successfully: exit code: 101
[DATA]
[DATA] #61 [drive_abci build-drive-abci 3/6] RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=/root/.cargo/registry/index --mount=type=cache,sharing=shared,id=cargo_registry_cache,target=/root/.cargo/registry/cache --mount=type=cache,sharing=shared,id=cargo_git,target=/root/.cargo/git/db --mount=type=secret,id=AWS set -ex; source /root/env && if [[ "dev" == "release" ]] ; then mv .cargo/config-release.toml .cargo/config.toml; else export FEATURES_FLAG="--features=console,grovedbg" ; fi && cargo chef cook --recipe-path recipe.json --profile "dev" --package drive-abci ${FEATURES_FLAG} --locked && if [[ -x /usr/bin/sccache ]]; then sccache --show-stats; fi
[DATA] #61 1.029 Updating crates.io index
[DATA] #61 1.209 Updating git repository https://github.com/dashpay/rs-tenderdash-abci
[DATA] #61 1.676 Updating git repository https://github.com/dashpay/versioned-feature-core
[DATA] #61 2.012 Updating git repository https://github.com/qrayven/ciborium
[DATA] #61 2.457 Updating git repository https://github.com/dashpay/rust-dashcore
[DATA] #61 4.701 Updating git repository https://github.com/dashpay/jsonschema-rs
[DATA]
[DATA] #61 CANCELED
[DATA]
[DATA] ------
[DATA] > [dashmate_helper build-js 3/5] RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=/root/.cargo/registry/index --mount=type=cache,sharing=shared,id=cargo_registry_cache,target=/root/.cargo/registry/cache --mount=type=cache,sharing=shared,id=cargo_git,target=/root/.cargo/git/db --mount=type=secret,id=AWS source /root/env && cargo chef cook --recipe-path recipe.json --profile "dev" --package wasm-dpp --target wasm32-unknown-unknown --locked && if [[ -x /usr/bin/sccache ]]; then sccache --show-stats; fi:
[DATA] 5.107 Unable to update https://github.com/dashpay/jsonschema-rs?branch=configure_regexp#7b00a244
[DATA] 5.107
[DATA] 5.107 Caused by:
[DATA] 5.107 failed to clone into: /root/.cargo/git/db/jsonschema-rs-c12f580e0c2be399
[DATA] 5.107
[DATA] 5.107 Caused by:
[DATA] 5.107 no error
[DATA] 5.109 thread 'main' panicked at src/recipe.rs:218:27:
[DATA] 5.109 Exited with status code: 101
[DATA] 5.109 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[DATA] ------
[DATA]
[DATA] failed to solve: process "/bin/sh -c source /root/env && cargo chef cook --recipe-path recipe.json --profile "$CARGO_BUILD_PROFILE" --package wasm-dpp --target wasm32-unknown-unknown --locked && if [[ -x /usr/bin/sccache ]]; then sccache --show-stats; fi" did not complete successfully: exit code: 101
[DATA]
node:internal/process/promises:389
new UnhandledPromiseRejection(reason);
^
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>". at throwUnhandledRejectionsMode (node:internal/process/promises:389:7) at processPromiseRejections (node:internal/process/promises:470:17) at process.processTicksAndRejections (node:internal/process/task_queues:96:32) { code: 'ERR_UNHANDLED_REJECTION' }
On the machine where yarn setup fails, it happens when running this part of the setup script: https://github.com/dashpay/platform/blob/v1.7.1/scripts/setup_local_network.sh#L12-L15.
EDIT: tracked this back further and the error happens due to this line being set to true (https://github.com/dashpay/platform/blob/v1.7.1/scripts/configure_dashmate.sh#L18):
yarn dashmate config set --config=${CONFIG_NAME} dashmate.helper.docker.build.enabled true
Looks like that value then links to this file which contains the unset vars mentioned in the error message: https://github.com/dashpay/platform/blob/v1.7.1/packages/dashmate/docker-compose.build.dashmate_helper.yml
This is the error:
platform.drive.abci.docker.build.enabled set to true
platform.dapi.api.docker.build.enabled set to true
dashmate.helper.docker.build.enabled set to true
platform.drive.tenderdash.consensus.createEmptyBlocksInterval set to 10s
platform.drive.abci.logs.stdout.level set to trace
[STARTED] Configuration preset
[DATA] local
[SUCCESS] Configuration preset [0.0s]
[STARTED] Task without title.
[STARTED] System requirements
[SUCCESS] System requirements [0.0s]
[STARTED] Create local group configs
[STARTED] Create local_1 config
[SUCCESS] Create local_1 config [0.0s]
[STARTED] Create local_2 config
[SUCCESS] Create local_2 config [0.0s]
[STARTED] Create local_3 config
[SUCCESS] Create local_3 config [0.0s]
[STARTED] Create local_seed config
[SUCCESS] Create local_seed config [0.0s]
[SUCCESS] Create local group configs [0.9s]
[STARTED] Configure Core nodes
[STARTED] Task without title.
[STARTED] Starting seed node as a wallet
[FAILED] Docker Compose error: time="2025-01-08T14:49:21-05:00" level=warning msg="The \"ACTIONS_RUNTIME_TOKEN\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_BUCKET\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_REGION\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_S3_KEY_PREFIX\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"RUSTC_WRAPPER\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_MEMCACHED\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_GHA_ENABLED\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"ACTIONS_CACHE_URL\" variable is not set. Defaulting to a blank string."
[FAILED] no such service: core
[FAILED]
[FAILED] Docker Compose error: time="2025-01-08T14:49:21-05:00" level=warning msg="The \"ACTIONS_RUNTIME_TOKEN\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_BUCKET\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_REGION\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_S3_KEY_PREFIX\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"RUSTC_WRAPPER\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_MEMCACHED\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_GHA_ENABLED\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"ACTIONS_CACHE_URL\" variable is not set. Defaulting to a blank string."
[FAILED] no such service: core
[FAILED]
[FAILED] Docker Compose error: time="2025-01-08T14:49:21-05:00" level=warning msg="The \"ACTIONS_RUNTIME_TOKEN\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_BUCKET\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_REGION\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_S3_KEY_PREFIX\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"RUSTC_WRAPPER\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_MEMCACHED\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_GHA_ENABLED\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"ACTIONS_CACHE_URL\" variable is not set. Defaulting to a blank string."
[FAILED] no such service: core
[FAILED]
[FAILED] Docker Compose error: time="2025-01-08T14:49:21-05:00" level=warning msg="The \"ACTIONS_RUNTIME_TOKEN\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_BUCKET\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_REGION\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_S3_KEY_PREFIX\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"RUSTC_WRAPPER\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_MEMCACHED\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"SCCACHE_GHA_ENABLED\" variable is not set. Defaulting to a blank string."
[FAILED] time="2025-01-08T14:49:21-05:00" level=warning msg="The \"ACTIONS_CACHE_URL\" variable is not set. Defaulting to a blank string."
[FAILED] no such service: core
[FAILED]
ConfigIsNotPresentError: Config with name 'local_seed' is not present
And here is how I set up the VM:
sudo apt install -y build-essential libssl-dev pkg-config clang cmake llvm unzip jq
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm
nvm install 20
node --version
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
exit
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
exit
rustc --version
wget https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-linux-x86_64.zip
sudo unzip protoc-*-linux-x86_64.zip -d /usr/local
protoc --version
cargo install [email protected]
git clone https://github.com/dashpay/platform.git
cd platform/
corepack enable
yarn --version
yarn setup
yarn start