On this page:
REACH_  VERSION
5.2.1 reach compile
REACH_  DEBUG
5.2.2 reach init
5.2.3 reach run
REACH_  CONNECTOR_  MODE
ETH-live
ETH-browser
ETH-devnet
ALGO-live
ALGO-browser
ALGO-devnet
REACH_  DEBUG
5.2.4 reach down
5.2.5 reach scaffold
5.2.6 reach react
5.2.7 reach devnet
5.2.8 reach rpc-server
REACH_  RPC_  TLS_  KEY
REACH_  RPC_  TLS_  CRT
REACH_  RPC_  TLS_  PASSPHRASE
5.2.9 reach rpc-run
5.2.10 reach docker-reset
5.2.11 reach upgrade
5.2.12 reach update
5.2.13 reach version
5.2.14 reach hashes

5.2 Usage

Reach has a few sub-commands, each with their own options.

However, all commands support the following options:

5.2.1 reach compile

You compile your Reach code by executing

  $ reach compile SOURCE EXPORT ...

where SOURCE is your source file, and each EXPORT is an exported Reach.App.

If no SOURCE is provided, then index.rsh is used.

If no EXPORT is provided, then all the exported Reach.Apps will be compiled. If there are no Reach.Apps exported, then the program will be compiled as a library, where its exports are available to other Reach programs and frontends. The output name of a library is the same as if it exported a Reach.App named default.

reach compile supports the following options:

5.2.2 reach init

You can create template index.rsh and index.mjs files for a simple Reach app by running

  $ reach init

5.2.3 reach run

You can run a simple Reach application by executing

  $ reach run [APP or DIR] [ARGS]

APP represents a Reach module name without its extension (e.g. "index" by default).

If no APP or DIR is provided then index in the current working directory is assumed.

If DIR matches an existing, relative subdirectory of the current working directory then DIR/index is used.

ARGS represents zero or more arguments to be passed into APP’s frontend.

This assumes

It then

reach run supports the following options:

reach run can be further specialized via the presence of a Dockerfile and package.json file. If either are absent, reach run assumes a default behavior (which may be persisted with reach scaffold).

The Dockerfile can be modified to introduce new dependencies, services, or filesystem prerequisites into your app’s containerized environment, and the package.json file may likewise be extended to include additional libraries or make configuration changes to the resultant Node.js package.

5.2.4 reach down

You can halt all Dockerized Reach apps and devnets by running

  $ reach down

5.2.5 reach scaffold

You can create templated Dockerfile and package.json files for a simple Reach app by running

  $ reach scaffold

The files created are the same as those used temporarily by reach run.

5.2.6 reach react

You can run a simple React app by executing

  $ reach react

This assumes

It then

reach react supports the following options:

When using loadStdlib in conjunction with reach react, be sure to pass in process.env as its argument. See loadStdlib for details.

reach react does not respect the same scaffolded files as reach run. It is just a simplified tool to give you a taste of web programming with reach. If you would like access to more customizations on a browser-based project, such as custom environment variables, custom JavaScript dependencies, or using other JavaScript frameworks like Angular, we recommend that you simply use reach compile, and use your own preferred JavaScript setup for the project. The compiled build/index.main.mjs JavaScript file and the '@reach-sh/stdlib' JavaScript library may be used in any JavaScript project like any other JavaScript file and library, respectively.

5.2.7 reach devnet

You can run a private Reach devnet by executing

  $ reach devnet

reach devnet supports the following options:

5.2.8 reach rpc-server

The sub-command

  $ reach rpc-server

starts an instance of the Reach RPC Server using all of the same options and defaults as reach run.

reach rpc-server supports the following options:

5.2.9 reach rpc-run

The sub-command

  $ reach rpc-run CMD

is a convenient means of launching a pre-configured RPC server and frontend which are suitable for development purposes. It uses a REACH_RPC_KEY value of opensesame (the standard development API key), and sets REACH_RPC_TLS_REJECT_UNVERIFIED to 0.

Consider this example from the Rock, Paper, Scissors in Python tutorial:
  $ reach rpc-run python3 -u ./index.py

5.2.10 reach docker-reset

You can easily kill and remove all Docker containers by executing

  $ reach docker-reset

This can be a useful thing to try if your Docker containers stop responding to requests or otherwise misbehave, or if you have updated your Reach images (with reach update) but those changes are not taking effect. This command is a loose approximation of "turning Docker off and on again." It will affect all Docker containers on your machine, not just those created by Reach.

5.2.11 reach upgrade

You can upgrade your Reach installation by executing

  $ reach upgrade

This may change the default version used by reach commands.

5.2.12 reach update

You can update the Docker images used by your Reach installation by executing

  $ reach update

This may change the patch version used by reach commands.

5.2.13 reach version

You can see what version of Reach you have installed by running

  $ reach version

5.2.14 reach hashes

You can see which exact versions of Reach Docker images you are using by running

  $ reach hashes

This is more precise, but less readable, than reach version, in that each hash refers to the git commit used to build the image.