On this page:
5.4.3.1 Statements
5.4.3.1.1 deploy
deploy
5.4.3.1.2 set  Options
set  Options
verify  Arithmetic
verify  Per  Connector
connectors
ETH
ALGO
5.4.3.2 Expressions
5.4.3.2.1 Participant Definition
Participant
Participant  Class
5.4.3.2.2 View Definition
View
0.1.5
5.4.3 Application Initialization

The body of Reach.app is an application initialization. It defines the various participants and views of the DApp, as well as sets compilation options. It is finalized with deploy() and then the application begins in a step.

5.4.3.1 Statements

Any statements valid for a computation are valid for application initialization. However, some additional statements are allowed.

5.4.3.1.1 deploy

deploy(); 

A deploy statement, written deploy();, deploys the DApp and finalizes all of the available participants, views, and compilation options.

Its continuation is a step, which means its content is specified by Steps. It represents the body of the DApp to be compiled.

5.4.3.1.2 setOptions

setOptions({ verifyArithmetic: true });
setOptions({}); 

The compilation options for the DApp may be set by calling setOptions(OBJ_EXPR); where OBJ_EXPR is an object with the following keys and values:

5.4.3.2 Expressions

Any expressions valid for a computation are valid for application initialization. However, some additional expressions are allowed.

5.4.3.2.1 Participant Definition

A participant and participant class may be declared with

Participant(participantName, participantInteractInterface)

and

ParticipantClass(participantName, participantInteractInterface)

respectively.

participantName is a string which indicates the name of the participant function in the generated backend code. Each participantName must be unique.

participantInteractInterface is a participant interact interface, an object where each field indicates the type of a function or value which must be provided to the backend by the frontend for interacting with the participant.

5.4.3.2.2 View Definition

This section is about defining views during in application initialization. Views are set in consensus steps, in your Reach program. But, they are accessed by frontends by using the Reach standard library of the frontend language, such as JavaScript.

View('NFT', { owner: Address })

A view is defined with View(viewName, viewInterface), where viewName is a string that labels the view and viewInterface is an object where each field indicates the type of a function or value provided by the contract associated with the specified DApp. These views are available in frontends via the ctc.getViews function. In the DApp, the result of this application argument is referred to as a view object.