I'm in the process of deploying the Solana helloworld example smart contract on Ubuntu 20.04. When running npm run build:program-rust
, the package.json
in the root of the repository states that this corresponds with cargo build-bpf --manifest-path=./src/program-rust/Cargo.toml --bpf-out-dir=dist/program
. However, when running this command compilation is stuck without any indicators, even when appending the verbosity tag to the cargo build command.
I have a fresh installation of Ubuntu 20.04 and only took the following steps:
sudo apt update && sudo apt upgrade
- Install NodeJS v14.x and build-essential
- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Install Solana CLI:
sh -c "$(curl -sSfL https://release.solana.com/v1.8.6/install)"
git clone https://github.com/solana-labs/example-helloworld.git
When running which cargo-build-bpf
, Ubuntu points towards the directory ~/.local/share/solana/install/releases/1.8.6/solana-release/bin/cargo-build-bpf
, indicating that the PATH variable has been updated correctly.
The Cargo.toml file looks as follows:
[package]
name = "solana-bpf-helloworld"
version = "0.0.1"
description = "Example template program written in Rust"
authors = ["Solana Maintainers <[email protected]>"]
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
edition = "2018"
[features]
no-entrypoint = []
[dependencies]
borsh = "0.9.3"
borsh-derive = "0.9.1"
solana-program = "~1.10.35"
[dev-dependencies]
solana-program-test = "~1.10.35"
solana-sdk = "~1.10.35"
[lib]
name = "helloworld"
crate-type = ["cdylib", "lib"]
Yesterday, I tried deleting the Cargo.lock file and run cargo update
. It got stuck in trying to retrieve the Borsh
crate which is also specified in the Cargo.toml file. I don't exactly know the relevance of this, but it seems worth pointing out.