Skip to content

Commit

Permalink
Merge branch '1299_NFT_tutorial' of https://github.com/ipopescu/docs
Browse files Browse the repository at this point in the history
…into 1299_NFT_tutorial
  • Loading branch information
ipopescu committed Mar 11, 2024
2 parents 9e9d52f + 80427ca commit 2d1cad8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Information on the modalities used throughout this installation process can be f
- [Building the Contract and Tests](#building-the-contract-and-tests)
2. [Reviewing the Contract Implementation](#reviewing-the-contract-implementation)
- [Required Crates](#required-crates)
- [Initialization Flow](#Initialization-flow)
- [Initialization Flow](#initialization-flow)
- [Contract Entrypoints](#contract-entrypoints)
3. [Installing the Contract](#installing-the-contract)
- [Querying Global State](#querying-global-state)
Expand All @@ -29,12 +29,12 @@ Information on the modalities used throughout this installation process can be f

Before using this guide, ensure you meet the following requirements:

- Set up the [development prerequisites](https://docs.casper.network/developers/prerequisites/), including the [Casper client](https://docs.casper.network/developers/prerequisites/#install-casper-client)
- Get a valid [node address](https://docs.casper.network/developers/prerequisites/#acquire-node-address-from-network-peers) from the network
- Know how to install a [smart contract](https://docs.casper.network/developers/cli/sending-deploys/) on a Casper network
- Set up the [development prerequisites](../../../../developers/prerequisites.md), including the [Casper client](../../../../developers/prerequisites.md#install-casper-client)
- Get a valid [node address](../../../../developers/prerequisites.md#acquire-node-address-from-network-peers) from the network
- Know how to install a [smart contract](../../../../developers/cli/sending-deploys.md) on a Casper network
- Hold enough CSPR tokens to pay for transactions

The [Writing Rust Contracts on Casper](https://docs.casper.network/developers/writing-onchain-code/simple-contract/) document outlines many aspects of this tutorial and should be read as a prerequisite.
The [Writing Rust Contracts on Casper](../../../../developers/writing-onchain-code/simple-contract.md) document outlines many aspects of this tutorial and should be read as a prerequisite.

### Building the Contract and Tests

Expand All @@ -57,7 +57,7 @@ rustup target add wasm32-unknown-unknown
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
```

If you do not see this message, check the [Getting Started Guide](https://docs.casper.network/developers/writing-onchain-code/getting-started/).
If you do not see this message, check the [Getting Started Guide](../../../../developers/writing-onchain-code/getting-started.md).

The contract code can be compiled to Wasm by running the `make build-contract` command provided in the Makefile at the top level. The Wasm will be found in the `contract/target/wasm32-unknown-unknown/release` directory as `contract.wasm`.

Expand Down Expand Up @@ -147,11 +147,11 @@ There is also the [**migrate**](https://github.com/casper-ecosystem/cep-78-enhan

## Installing the Contract

Installing the enhanced NFT contract to global state requires using a [Deploy](../../../../developers/dapps/sending-deploys/). But before proceeding with the installation, verify the network state and the status of the account that will send the installation deploy.
Installing the enhanced NFT contract to global state requires using a [Deploy](../../../../developers/cli/sending-deploys.md). But before proceeding with the installation, verify the network state and the status of the account that will send the installation deploy.

### Querying Global State

This step queries information about the network state given the latest state root hash. You will also need the [IP address](../../../../developers/prerequisites/#acquire-node-address-from-network-peers) from a Testnet peer node.
This step queries information about the network state given the latest state root hash. You will also need the [IP address](../../../../developers/prerequisites.md#acquire-node-address-from-network-peers) from a Testnet peer node.

```bash
casper-client get-state-root-hash --node-address http://localhost:11101/rpc/
Expand Down Expand Up @@ -218,7 +218,7 @@ casper-client query-global-state --node-address http://localhost:11101/rpc/ \

Below is an example of a `casper-client` command that provides all required session arguments to install a valid instance of the CEP-78 contract on global state.

Use the Testnet to understand the exact gas amount required for installation. Refer to the [note about gas prices](../../../../developers/cli/sending-deploys/#a-note-about-gas-price) to understand payment amounts and gas price adjustments.
Use the Testnet to understand the exact gas amount required for installation. Refer to the [note about gas prices](../../../../developers/cli/sending-deploys.md#a-note-about-gas-price) to understand payment amounts and gas price adjustments.

- `casper-client put-deploy -n http://localhost:11101/rpc/ --chain-name "casper-net-1" --payment-amount 500000000000 -k ~/casper/casper-node/utils/nctl/assets/net-1/nodes/node-2/keys/secret_key.pem --session-path contract/target/wasm32-unknown-unknown/release/contract.wasm`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ casper-client put-deploy --node-address http://localhost:11101/rpc/ \
## Minting NFTs
Below is an example of a `casper-client` command that uses the `mint` entrypoint of the contract to mint an NFT for the user associated with `node-1` in an [NCTL environment](../../../../developers/dapps/nctl-test/).
Below is an example of a `casper-client` command that uses the `mint` entrypoint of the contract to mint an NFT for the user associated with `node-1` in an [NCTL environment](../../../../developers/dapps/nctl-test.md).
- `casper-client put-deploy -n http://localhost:11101/rpc --chain-name "casper-net-1" --payment-amount 5000000000 -k ~/casper/casper-node/utils/nctl/assets/net-1/nodes/node-1/keys/secret_key.pem --session-entry-point "mint"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ title: Quick Installation

This quick installation guide introduces you to the Casper client commands and Wasm files necessary to deploy a CEP-78 Casper Enhanced NFT contract to the [Casper Testnet](https://testnet.cspr.live/). For greater detail into the creation and mechanics of the Casper NFT contract, see the complete [Casper NFT Tutorial](./full-installation-tutorial.md).

To execute transactions on a Casper network involving NFTs, you will need some CSPR tokens to pay for the transactions. The Testnet provides test tokens using a [faucet](https://docs.casper.network/users/testnet-faucet/).
To execute transactions on a Casper network involving NFTs, you will need some CSPR tokens to pay for the transactions. The Testnet provides test tokens using a [faucet](../../../../users/csprlive/testnet-faucet.md).

## Prerequisites

Before using this guide, ensure you meet the following requirements:

- Set up the [development prerequisites](../../../../developers/prerequisites/), including the [Casper client](../../../../developers/prerequisites/#install-casper-client)
- Get a valid [node address](../../../../developers/prerequisites/#acquire-node-address-from-network-peers) from the network
- Know how to install a [smart contract](../../../../developers/cli/sending-deploys/) on a Casper network
- Set up the [development prerequisites](../../../../developers/prerequisites.md), including the [Casper client](../../../../developers/prerequisites.md#install-casper-client)
- Get a valid [node address](../../../../developers/prerequisites.md#acquire-node-address-from-network-peers) from the network
- Know how to install a [smart contract](../../../../developers/cli/sending-deploys.md) on a Casper network
- Hold enough CSPR tokens to pay for transactions

## Setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The testing framework in this tutorial uses the [Casper engine test support](htt

The [tests](https://github.com/casper-ecosystem/cep-78-enhanced-nft/tree/dev/tests/src) source folder contains over 150 tests covering a variety of scenarios, including contract installation, minting and burning tokens, sending transfers, upgrading the contract, and listening to events.

For more details about the test framework and how each test is set up, visit the [Testing Smart Contracts](../../../../developers/writing-onchain-code/testing-contracts/) documentation page.
For more details about the test framework and how each test is set up, visit the [Testing Smart Contracts](../../../../developers/writing-onchain-code/testing-contracts.md) documentation page.

## Running the Tests

Expand Down

0 comments on commit 2d1cad8

Please sign in to comment.