Skip to content

Latest commit

 

History

History

contract-simple-rs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Cross-Contract Hello Contract

The smart contract implements the simplest form of cross-contract calls: it calls the Hello NEAR example to get and set a greeting.

How to Build Locally?

Install cargo-near and run:

cargo near build

How to Test Locally?

cargo test

How to Deploy?

To deploy manually, install cargo-near and run:

# Create a new account
cargo near create-dev-account

# Deploy the contract on it
cargo near deploy <account-id>

CLI: Interacting with the Contract

To interact with the contract through the console, you can use the following commands

# Get message from the hello-near contract
# Replace <account-id> with your account ID
near call <account-id> query_greeting --accountId <account-id>

# Set a new message for the hello-near contract
# Replace <account-id> with your account ID
near call <account-id> change_greeting '{"new_greeting":"XCC Hi"}' --accountId <account-id>

Useful Links