https://github.com/frol/near-contract-minimal-test
Test bed for arbitrary Wasm contract file
https://github.com/frol/near-contract-minimal-test
Last synced: 4 months ago
JSON representation
Test bed for arbitrary Wasm contract file
- Host: GitHub
- URL: https://github.com/frol/near-contract-minimal-test
- Owner: frol
- Created: 2025-01-11T08:53:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-08T02:11:13.000Z (over 1 year ago)
- Last Synced: 2025-06-07T16:11:06.569Z (about 1 year ago)
- Language: Rust
- Size: 120 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minimal project to test hello-world app (contract) on NEAR Protocol
It is a good starting point for checking an existing Wasm file on NEAR Protocol.
## Prerequisites
Install Rust and Cargo: https://www.rust-lang.org/tools/install
## Basic Usage
1. Put the Wasm file you want to test into the root of this project and name it `contract.wasm`
2. Run `cargo test`
## Advanced Usage
If you want to test the contract with the latest version of NEAR Protocol, you can build the NEAR Protocol from the source code.
1. Clone nearcore from `debug/wasm-logs` branch: https://github.com/near/nearcore/compare/debug/wasm-logs
2. `make neard-debug`
3. Set the `NEAR_SANDBOX_BIN_PATH` env variable to a full path pointing to the `neard` in `./target/debug` folder
4. Set the `NEAR_ENABLE_SANDBOX_LOG=1`
4. and run `cargo test`
Example one-liner:
```shell
env NEAR_SANDBOX_BIN_PATH=/home/frol/nearcore/target/debug/neard NEAR_ENABLE_SANDBOX_LOG=1 cargo test
```