To try out the new features of Unchained, or to test your applications, you can run a local development network. This network is a simulation of the real network, but it runs on your local machine. This allows you to test your applications in a controlled environment.
To run a local devnet, you need to install the Unchained CLI. You can install the CLI from GitHub releases. Download the latest release for your operating system and architecture here. Once you have downloaded the binary, you can move it to a directory in your PATH. You can also rename the binary to .
To run a local devnet, you need to configure the network. The configuration file is a YAML file that contains the settings for Broker, Worker, Plugins, and Dataframes. You can share the same config file both for the Broker and Worker. Create a new directory for your project and add a file with the following content:
Replace the placeholders with the actual values. For the , option, you should run the binary with the . This will generate a new secrets file in your project directory. You can then copy the public key from the secrets file to the option.
Once you have created the configuration file, you can start the Broker and Worker nodes. To start the Broker, run the following command:
To start the Worker, run the following command:
The Broker and Worker nodes will start and connect to each other. You can now start testing your applications on the local devnet.
To run the TEP-1 demo plugin on the local devnet, you need to clone the plugin repository from GitHub. You can clone the repository using the following command:
The sample plugin is located in the directory. First, you need to build the plugin using the following command:
Now generate a new private key for the plugin using the following command:
Then create a .env file in the plugin directory with the following content:
Replace the placeholders with the actual values. You can get the worker public key from the secrets file generated by the binary in the previous step.
Finally, you can start the plugin using the following command:
Now back to the Unchained configuration file, add the plugin configuration to the Plugins section:
Replace the placeholders with the actual values, and restart the Worker node.
To interact with the sample plugin over the local devnet, you can use the Unchained RPC client in the TEP examples GitHub repository. Head back to the TEP examples repository and build the RPC client using the following command:
Generate a new private key for the client using the following command:
Then create a .env file in the client directory with the following content:
Replace the placeholders with the actual values. You can get the broker public key from the secrets file generated by the binary in the previous steps.
Finally, you can start the RPC client using the following command:
Pl. de l'Industrie 2, 1180 Rolle, Switzerland