镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

4 watching

Forks

Latest commit

 

History

145 Commits

Folders and files

Repository files navigation

Rust Storage Examples

Runnable examples of persistent collections in near_sdk::store:

  • Vector
  • LookupMap and IterableMap
  • LookupSet and IterableSet
  • Nested collections with distinct storage prefixes and explicit cleanup

The contract is in collections-rs/store. Collection modules include unit tests, and the integration suite uses near-sandbox and near-api to deploy the contract to a local Sandbox and checks each collection across calls. See the collections guide for explanations of storage prefixes and collection selection.

Requirements

Install rustup. The repository pins Rust 1.97.1 and uses NEAR SDK 5.29.1. Install the contract build tool:

cargo install cargo-near --version 0.21.1 --locked --no-default-features

Build

cd collections-rs/store
cargo near build non-reproducible-wasm --locked

The build command prints the path to the generated Wasm artifact.

Test

cd collections-rs
cargo test --locked

Tests build the contract from source and use local Sandbox accounts. They do not require a funded public-network account or a frontend.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages