Skip to content

The pack of practical examples of work with Cross Contract Calls on Near Protocol

Notifications You must be signed in to change notification settings

nearuaguild/near-rust-cross-contract-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Near Protocol | Pack of examples for Cross Contract Call feature

The repository that contains real code examples of work with Cross Contract Calls in Near Protocol Rust SDK

Explore other projects · Report a bug

About The Project

The repository provides practical use cases that showcase Cross Contract Calls in action

This pack of examples covers everything from simple implementation to managing parallel and sequential requests with callbacks

Examples

Basic

Sequence

Parallel

State rollback

Built With


Getting Started

💡 Before starting, please ensure that you have all the necessary installations completed

Installation

Follow these simple instructions to set up a local development environment

  1. Clone the repo
 git clone https://github.com/nearuaguild/near-rust-cross-contract-examples.git
  1. Open root folder
cd near-rust-cross-contract-examples
  1. Move to a folder of the example you're interesting in (e.g. state_rollback)
cd state_rollback

Build

Each example has script that performs compiling of the project

Make sure you've added wasm32-unknown-unknown target for rustc compiler

If not, run this command

rustup target add wasm32-unknown-unknown

Finally, run ./build.sh inside the example folder to compile to WASM

Keep in mind that compiled WASM file would be located in `target/wasm32-unknown-unknown/release/{EXAMPLE_NAME}.wasm

Usage

Please note that the provided examples are not intended to be run locally, and because of it there's no deployment guide

You can use them to improve your coding skills/understanding of Near Protocol architecture or directly incorporate them into your project

Bonus+

Also, consider reading this beautiful post that outlines common solutions for Exceeded Gas problems that can arise when working with Cross Contract Calls


Developed by

Guild cover

Near Ukraine Guild is a fast-growing guild based in Ukraine, aimed at providing high-quality educational content and assistance to grow a strong community of developers/entrepreneurs/enthusiasts within the Near Protocol ecosystem

Community Validator Node

Community Validator cover

Our validator has been active for a few months now, and the funds it generates are being put towards sponsoring community activities

Join us now to stake and earn 10% APY

Click below to get started 👇

Socials

Twitter Youtube Telegram Chat Telegram Channel Medium Github

License

See LICENSE.txt for more information

About

The pack of practical examples of work with Cross Contract Calls on Near Protocol

Topics

Resources

Stars

Watchers

Forks