ZNG NFT Marketplace using NEAR-Rust SDK
NFT Marketplace using Near-Rust
[near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local node_modules
folder when you ran yarn install
, but for best ergonomics you may want to install it globally:
yarn install --global near-cli
Or, if you'd rather use the locally-installed version, you can prefix all near
commands with npx
Ensure that it's installed with near --version
(or npx near --version
)
Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as your-name.testnet
, you can deploy your contract to todo-app.your-name.testnet
. Assuming you've already created an account on [NEAR Wallet], here's how to create todo-app.your-name.testnet
:
-
Authorize NEAR CLI, following the commands it gives you:
near login
-
Create a subaccount (replace
YOUR-NAME
below with your actual account name):near create-account todo-app.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet
A smart contract written in Rust for an app initialized with create-near-app
Before you compile this code, you will need to install Rust with correct target
- The main smart contract code lives in
src/lib.rs
. You can compile it with the./compile
script. - Tests: You can run smart contract tests with the
./test
script. This runs standard Rust tests using cargo with a--nocapture
flag so that you can see any debug info you print to the console.