Before working with the Validator Reward Contract, ensure your development environment meets the following requirements:
-
Rust & C++ Compiler:
In addition to Rust, installation requires a C++ compiler that supports C++17. Modern releases of gcc and clang, as well as Visual Studio 2019+, should work.
Installation Steps:
-
Install Rust Source:
rustup component add rust-src
-
Install
cargo-contract
:cargo install --force --locked cargo-contract
-
Build and Deploy:
-
Clone the
ink-contract-pocs
repository containing the validator reward contract code.git clone https://github.com/auguth/ink-contracts-pocs.git
-
Run the setup script if applicable:
chmod +x setup.sh && ./setup.sh
-
Open
validator_reward_contract
foldercd validator_reward_contract
-
Build the contract in release mode using cargo-contract:
cargo contract build --release
-
Deploy the contract to your local or test network using the Polkadot-JS-App or Contracts UI:
- Upload the WASM binary.
- Initialize the contract by providing the required constructor parameter (owner).
-
-
To Run Test:
cargo test