Skip to content

frol/near-contract-minimal-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  5. and run cargo test

Example one-liner:

env NEAR_SANDBOX_BIN_PATH=/home/frol/nearcore/target/debug/neard NEAR_ENABLE_SANDBOX_LOG=1 cargo test

About

Test bed for arbitrary Wasm contract file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages