Introduction Web3, NFTs, and smart contracts are . In fact, has shown that over 18,000 developers are regularly contributing to open source crypto and Web3 projects on a monthly basis. Some of the keys to this growth are blockchains like NEAR and developer platforms like Infura. growing in popularity a recent analysis of public code repositories In this article, we’ll look at the NEAR blockchain, its benefits, and how to build on NEAR using Infura. Then we’ll use the NEAR Rust SDK to mint an NFT in three steps and then interact with that NFT from Infura. You’ll need , , and some to get up and running quickly. a NEAR account an Infura account Rust skills and tools What is NEAR? NEAR is a blockchain with an active developer community of thousands of builders, backed by a foundation that provides stability for DeFi, NFT, and DAO-related projects. NEAR focuses on providing low transaction fees and fast transaction throughput, as well as the most cutting edge sharding mechanisms in Web3 known as . Nightshade NEAR has , including human-readable account names, a focus on , and the use of general-purpose languages for writing contracts. Compared to Ethereum, NEAR is significantly faster and has a more progressive user experience. They aren’t seeking to replace the Web3 giant, however. With their Aurora layer and easy bridging between multiple blockchains, NEAR aims to improve interoperability in the ecosystem. many other benefits carbon-neutrality What is Infura? allows developers to build smart contracts using an intuitive JSON-RPC API for interacting with multiple blockchains. While Infura was the first-ever API solution built for Ethereum, the platform also provides support for the decentralized storage network, IPFS, layer two chains Polygon, Arbitrum, and Optimism, and now NEAR as part of their plans to expand across multi-chains and protocols to advance Web3. Infura makes it easier for beginners and veterans alike to get started with blockchain development. Infura Since Infura serves as the connection point to the blockchain, there’s no need to spin up and run your own node to access the above blockchains. This significantly reduces startup time since you don’t need to spend hours syncing your nodes with multi-networks. Infura is an Infrastructure-as-a-Service (IaaS), so they provide everything a developer needs to build on blockchains and scale. Step 1: Minting an NFT At this point, it might sound intimidating to dive right into this technology. To make your job easy, we’ll follow NEAR’s , plugging in Infura to make this process even smoother. guide to minting an NFT 1a: Create a NEAR account The first thing you will need to do is create your NEAR account. Since we’re doing this for learning purposes, you can create your wallet on NEAR’s , providing your account with some NEAR tokens to build with for free. Once you’re ready to take your solution into production, you’ll need real NEAR tokens on the NEAR , but for now, we’ll use test tokens. Creating an account is pretty straightforward, and will walk you through creating a account. testnet mainnet this documentation testnet Notice the human-readable account address you generated? This address is much easier to keep track of and share compared to other blockchains. Additionally, if you set up your account using email, you will receive an account recovery link, something most other chains don’t even offer. Once you have your account and have logged in, go to the Collectibles tab, which lists all of your NFTs. testnet Since I’m working from a new account, I don’t have any listed right now. So let’s see how easy it is to get our very first NFT minted with NEAR, the (IPFS), and Infura. InterPlanetary File System 1b: Create an Infura account and upload to IPFS Our next step is to (give your email address and a password) and in that account. Be sure to select IPFS as the product when creating the project instead of Ethereum. Infura will require credit card information to get this going, but as long as you don’t use over 5GB of space or bandwidth on IPFS, you won’t be charged. create an Infura account create an IPFS project Once you have an Infura account, find something to turn into an NFT. Make sure you pick something you’re okay with being public. I chose that is licensed CC-3.0 Attribution-Share Alike, but you can use whatever you want. a simple smiley face I grabbed from Wikipedia Infura offers a useful tool for uploading files onto IPFS. If you have a Golang build chain on your computer, you can build it locally or install a pre-built binary from . Whichever way you install the , you’re one command away from putting your file for NFT greatness on the IPFS. the Github repo ipfs-upload-client ipfs-upload-client --id <project_id> --secret <project_secret> </path/to/data> Obviously, you need to use your actual project id and secret, as well as the location of your file on your machine. However, as long as you run this command somewhere that has the in the path, you should be able to see your file’s content identifier (CID) pinned in your Infura Dashboard Explorer. ipfs-upload-client Alternatively, you can upload your image to IPFS using a cURL command: curl -X POST -F file=@myfile -u "PROJECT_ID:PROJECT_SECRET" "https://ipfs.infura.io:5001/api/v0/add" You can view your file on dweb.link by taking the CID and putting it at the end of the URL . You’ll need to do that for the next step so you have the case-insensitive CID anyway, so go ahead and verify. Once you have your CID, let’s move to the next step. https://dweb.link/ipfs 1c: Build an example NFT contract NEAR provides for getting started with NFTs that follows the . Clone that repo and poke around in it. The real meat of this example is in the file, but feel free to look around more. If you have the repository cloned with the proper Rust toolchain installed, as described in the README, then simply run the file in the root of the repository to get going. an excellent example repository NEAR Enhancement Proposal standard nft/src/lib.rs build.sh Once you’ve built your smart contract locally, you can . If you’ve never installed the NEAR CLI before, do so with and then run these steps from the directory where you built your contract: deploy it to NEAR and mint your first token using the near-cli npm $ near login $ export ID=YOUR_NEAR_TESTNET_ID # replace this with your actual ID $ near deploy --wasmFile res/non_fungible_token.wasm --accountId $ID $ near call $ID new_default_meta '{"owner_id": "'$ID'"}' --accountId $ID $ near call $ID nft_mint '{"token_id": "0", "receiver_id": "'$ID'", "token_metadata": { "title": "Example NEAR non-fungible token", "description": "Smile", "media": "https://bafybeifehwew2sq7m7ofwuzg65mft3hgy7y7ml53r2q46cbcfhl4yqpsiy.ipfs.dweb.link/", "copies": 1}}' --accountId $ID --deposit 0.1 # make sure to use your CID If everything went well, you should have your NFT showing in the collectibles area of your NEAR wallet. While this is admittedly more than trivial, it’s pretty amazing how much quicker and cheaper you can mint an NFT, compared to most blockchains. Minting an NFT is just the start, however. Let’s see how we can use Infura to interact with it. Step 2: Inspecting blockchain details from Infura Infura has robust support for multiple different blockchains and IPFS projects to provide a smooth JSON-RPC API you can build against and observe the transaction activity of your application. For now, we’ll focus on checking the gas price to transfer your NFT to another address. It’s just a single API call away. curl -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0", "id": 1, "method": "gas_price", "params": [null]}' \ "https://near-testnet.infura.io/v3/<YOUR-PROJECT-ID>" You should get a response that looks something like this: {"jsonrpc":"2.0","result":{"gas_price":"100000000"},"id":1} As long as you , you will be able to interact with the API using any of the other . Additionally, Infura will allow you to monitor interactions through your project dashboard. You’ll also be able to configure than is possible with just raw JSON-RPC calls to the NEAR API. add NEAR to your Infura RPC endpoint URL JSON-RPC methods supported by Infura a greater degree of security Step 3: Keep minting! In this article, you learned about NEAR, a faster, cheaper, and eco-friendly layer one blockchain. You also learned how Infura, as a node providing service, allows you to interact with NEAR using their RPC endpoint URL. Hopefully, the tutorial has shown you some of what’s possible, and you’re more confident in your ability to use Web3 tools to build your innovations. for your next Web3 project. They can really help make your work a lot smoother. Give NEAR and Infura a try Also Published Here