Git Product home page Git Product logo

sandbox's Introduction

NEAR Sandbox

NEAR Sandbox lets you easily run a local NEAR blockchain.

NEAR Sandbox is a custom build of the NEAR blockchain optimized for local development and testing. If you're familiar with Ganache for Ethereum, this is similar.

This repository contains code to quickly install pre-built binaries of NEAR Sandbox for multiple programming languages (currently just NodeJS; Rust coming soon) and operating systems (currently just Intel-based Macs and Debian/Ubuntu-flavored Linux distros using Intel processors).

Using NEAR Sandbox

If you just want to run tests against a NEAR Sandbox instance, check out near-runner for your favorite language:

Tip: near-runner includes near-sandbox as a dependency, so you will not need to install or run near-sandbox on its own.

If you want to run NEAR Sandbox on its own, continue reading.

Install

With npm

npm i -g near-sandbox

With Rust

Coming soon

From Source

  • Install Rust with correct build target

  • Clone nearcore

    git clone https://github.com/near/nearcore
    
  • cd into your nearcore folder and run make sandbox

    cd nearcore
    make sandbox
    
  • For ease-of-use, you can copy (or symlink) the binary to somewhere in your PATH. For example, if you have a ~/bin folder:

    cp target/debug/near-sandbox ~/bin/
    

Use

  • Initialize the Sandbox node

    near-sandbox --home /tmp/near-sandbox init
    
  • Run it

    near-sandbox --home /tmp/near-sandbox run
    

To find out other things you can do:

near-sandbox --help

Stop

Once you're finished using the sandbox node you can stop it by using CtrlC. To clean up the data it generates:

rm -rf /tmp/near-sandbox

What's special about NEAR Sandbox

NEAR Sandbox includes custom features to make tweaking local and test environments easier.

  • sandbox_patch_state RPC call, used by patchState in runner-js, useful for making arbitrary state mutations on any contract or account

sandbox's People

Contributors

chadoh avatar chaotictempest avatar danielwpz avatar bucanero avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.