On this page:
REACH_  VERSION
5.2.1 reach compile
5.2.2 reach init
5.2.3 reach run
REACH_  CONNECTOR_  MODE
ETH-live
ETH-browser
ETH-test-dockerized-geth
ALGO-live
ALGO-browser
ALGO-test-dockerized-algod
REACH_  DEBUG
RUN_  FROM_  REACH
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

If no APP is provided, index is used.

If APP is a directory, then APP/index is used.

This assumes

It then

reach run supports the following options:

reach run can be configured via the presence of certain files. In the absence of these files, reach run assumes a default behavior based on reach scaffold.

Furthermore, if all of the scaffolded files are present, then pay special attention to the Makefile that you write, because reach will use it in specific ways. Refer to the Makefile generated by reach scaffold for hints on how to get it right.

5.2.4 reach down

You can halt the docker containers started by reach run by running

  $ reach down

5.2.5 reach scaffold

You can create template package.json, Dockerfile, docker-compose.yml, and Makefile 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.