luishsr / near-hat

NEARHat is a NEAR Protocol local development toolkit.

Home Page:https://www.near.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NEARHat

NEARHat is a NEAR Protocol local development environment. It allows you to run local development of dApps and create automated end-to-end tests from smart contracts to indexers.

NEARHat-Logo

Built by the Pagoda Engineers for the NEAR Ecosystem as part of the December 2023 hackathon.

Currently supports local versions of:

  • nearcore sandbox
  • NEAR Lake Indexer (+ LocalStack NEAR Lake S3 bucket)
  • NEAR Relayer
  • Local NEAR Explorer
  • Query API

Potential future support:

  • Local MyNearWallet
  • BOS dependency chain and near.org gateway
  • FastAuth

One line installation:

$ ./install.sh

This will install dependencies via Homebrew and setup local .nearhat domain.

You need to be logged into Github Container Registry (until all docker containers are published to DockerHub): https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry

image

Starting and stopping local environment

$ ./start.sh

Forking mainnet smart contracts

NEARHat allows to fork mainnet contracts and refer to them through http://rpc.nearhat. To fork the USDC contract (with account id 17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2) start NEARHat with the following command:

RUST_BACKTRACE=1 RUST_LOG=info cargo run -p near-hat-cli -- start --contracts-to-spoon 17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2

About

NEARHat is a NEAR Protocol local development toolkit.

https://www.near.org

License:MIT License


Languages

Language:Rust 88.0%Language:JavaScript 10.3%Language:Python 1.3%Language:Shell 0.5%