REACH LANGUAGE BASICS
Watiri Kambo
Posted on October 28, 2021
Reach is a programming language that has been designed to work on POSIX systems with make, Docker and Docker Compose installed.
In my case, I am operating on Linux OS. The first thing that I had to do was make sure that I created a directory where I am going to install the necessary files. To do this, I used the command $ mkdir reach.
To run Reach in your project repository you can run the following command : $ curl https://docs.reach.sh/reach -o reach ; chmod +x reach. Run this command within the new directory that you just created. In this case (reach).
To initialize a new Reach project, you can run the command $ reach init or $ ./reach init . This creates a template which contains an index.rsh & a index.mjs file.
Once you have prepared your code and are now ready to run the program, you can go ahead and execute the command $ reach run or $./reach run.
What happens when this command is run is that your program is compiled with reach, a docker image is build. This image depends on the Reach Javascript standard library. A container that is based on that particular image is executed while connected to the network.
You can halt all dockerized Reach apps and devnets by running the command $ ./reach down.
To create templated Dockerfile and package.json files for a simple Reach app use the command $ ./reach scaffold.
To execute a simple react app ,especially for frontend, use the command $ ./reach react. This command assumes that the frontend React JS program is named index.js and the reach program is called index.rsh.
To execute a private Reach devnet, you can use the command $ ./reach devnet. The option --await-background is supported and runs in the background and awaits availability.
The command $ ./reach docker-reset kills and removes all docker containers.
You can upgrade your reach installation by executing $./reach upgrade
Additionally, you can update your docker images by executing the command $ ./reach update.
To check the version on reach that you currently have installed you can run the command $./reach version.
To see the exact version of Reach Docker images that you are using, you can run the command $./reach hashes.
Posted on October 28, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.