Executing actions from your backend, will require you to utilize one of ARISEN's SDKs. For this example, we're going to use ArisenJS.
To add ArisenJS to your project, simply install it, as follows:
Now you need to create the configuration ArisenJS will work off of, which means connecting ArisenJS to a particular ARISEN network, an ARISEN-based HTTP endpoint to send requests to, as well as they private keys being used for transactions. In the case where you're using an authenticator, keys will be provided by the authenticator and obviously ArisenJS would not be used for signing, although in the below example, we act as if the keys are provided to the config locally and ArisenJS in this case would be used for signing, since it has access to the keys.
dWeb-based applications should never hardcode keys into their application code, as shown in the example below. Instead, they should use signature providers, to interface with platform-based keystores, in order to obtain signatures for transactions. There are many signature providers here, which are pluggable into SDKs like ArisenJS. The methods below are simply used to showcase how ArisenJS works and how actions can be executed from within your application.
Executing An Action
You can execute an action, like so:
Named Action Functions
More concise functions are provided for applications that may use actions more frequently. This avoids having lots of JSON in the code. A few examples of this are below:
For a full description of all of ArisenJS's features and APIs, please refer to it's official documentation.
Learn how to query the on-chain database related to your contract, using ARISEN's RPC-based API, here.