LocalNear is a Local Development Environment for NEAR with a simple docker-compose file, which contains following components:
- Localnet RPC Endpoint http://localhost:13031
- Indexer for Explorer
- NEAR Explorer http://localhost:13032
- Contract Helper http://localhost:13033
- Contract Helper Indexer http://localhost:23033
- NEAR Wallet http://localhost:13034
- Docker
- Docker Compose
- near-cli
$ git clone https://github.com/sigilnet/localnear.git
$ ln -s $(pwd)/localnear /usr/local/bin/localnear
$ docker-compose up -d
$ localnear state test.near
$ localnear login
$ export ACCOUNT_ID=<YOUR_ACCOUNT_ID>
$ localnear send $ACCOUNT_ID test.near 1
$ curl -o ~/main.wasm https://github.com/near-examples/nft-tutorial/raw/main/out/main.wasm -L
$ localnear deploy --wasmFile ~/main.wasm --accountId $ACCOUNT_ID
$ localnear call $ACCOUNT_ID new_default_meta '{"owner_id": "'$ACCOUNT_ID'"}' --accountId $ACCOUNT_ID
$ localnear call $ACCOUNT_ID nft_mint '{"token_id": "team_token", "metadata": { "title": "Go Team!", "description": "Go Team!", "media": "https://bafybeiftczwrtyr3k7a2k4vutd3amkwsmaqyhrdzlhvpt33dyjivufqusq.ipfs.dweb.link/goteam-gif.gif", "copies": 1}, "receiver_id": "'$ACCOUNT_ID'"}' --accountId $ACCOUNT_ID --amount 0.1
$ docker-compose down
In case you want a clean environment, reset all old data by following these steps:
$ docker-compose down
$ docker volume rm localnear_postgres
$ rm -rf .near*
$ docker-compose up -d