
This document provides a step-by-step process for setting up and configuring the NEAR Protocol on a local machine using Docker. It involves pulling the latest stable version, setting up the Docker environment, and configuring the local network for interaction with the NEAR Protocol nodes.
Navigate to hub.docker.com and search for the NEAR Protocol. Locate the nearprotocol/nearcore image, which is available for each commit made to the master branch.

You can find release tags such as 2.7.0-rc.3 (release candidates which are deployed to testnet) or 2.6.5 (stable release for mainnet). Ensure Docker is installed on your system to start and pull the latest stable version.

Currently, the latest version is 2.6.5 stable. Let's pull that in. If using arm64 architecture (e.g. Mac with M-series CPUs), specify the --platform parameter with linux/amd64. It should work the same on Windows, Linux, and macOS. So, it is safe to use this parameter everywhere.
You'll also want to expose the port. The default JSON RPC port for nearcore node interaction is 3030, and let's run bash in interactive mode to perform node configuration and be able to restart the node without loosing the data between the runs.
docker run --platform linux/amd64 -it --rm -p 3030:3030 nearprotocol/nearcore:2.6.5 bash

Inside the container, use the neard binary. Let's check the version.

With the near node being there, it's time to initialize it for localnet. Let's set the home folder inside /tmp/neard:
neard --home /tmp/neard init

You can find the config.json, genesis.json, node_key.json, and validator_key.json created in the home directory.

There’s no need to check these configurations now. Proceed to run the node immediately.
neard --home /tmp/neard run

The node is now running. Use the terminal to execute the curl command as a sample operation.
curl http://localhost:3030/status

With everything set up, install and configure the NEAR CLI to use the local network. Add a connection using the near command, and following the prompts providing the network name (localnet), RPC URL (http://localhost:3030), and sipping all other settings as they are not applicable.

Now use NEAR CLI to access account information for test.near on localnet, retrieving the amount of available local NEAR tokens (these NEAR tokens have no value). Just type near command and follow the interactive prompts -> "account" -> "view-account-summary" ... or use the fully-specified command:
near account view-account-summary test.near network-config localnet now

Let's send transactions with these tokens using the test.near account.

We will send NEAR to another account, and since there is only one other account on our localnet, we use it - near. Sign transactions using the plaintext private key of test.near account - you can get it from the validator_key.json in the /tmp/neard home folder.

Once the transaction is successfully signed, send it. Here we can see that the tokens transfer transaction is successfully signed, and sent to the network. The transfer is successful!
