Prerequisites
Ensure that you have the following installed on your machine.- Docker and Compose for running Blnk locally on your machine.
- Node.js (v14.0.0 or later) and npm for installing the Blnk Typescript SDK.
1. Installation & Configuration
Once you’re good to go with the prerequisites, you can set up your Blnk server and SDK in 5 steps:1
Clone the Blnk repository
Run the following command in your terminal to clone Blnk to your local machine:
bash
2
Set up your Blnk configuration
Create a This configuration sets up the required connections to PostgreSQL and Redis, specifies your server details, and allows Slack notifications if needed.
blnk.json
file in your blnk
project folder, paste the following configuration settings, and save.blnk.json
3
Launch Blnk
Launch the Blnk server with the following command:Once running, your server will be accessible at http://localhost:5001.
bash
4
Install Blnk CLI
The Blnk CLI helps you to quickly test and manage your Blnk backend directly from your command line. You can also use it to perform create actions or view your data tables. To install and use the Blnk CLI, see the following in: Installing the Blnk CLI.To confirm that the CLI has been installed, run the following command:
bash
2. Install the Blnk TypeScript SDK
In yourblnk
project folder, install Blnk Typescript SDK.
bash
3. Create your first ledger
A ledger is a folder for grouping balances together in your Blnk server. To learn more, see the following: Introduction to Ledgers To create a ledger using the TypeScript SDK:Create ledger
bash
4. Create your first balance
A balance is used to represent a store of value in your Blnk server, e.g., wallet or account. To learn more, see the following: Introduction to Balances To create a balance using the TypeScript SDK:Create balance
bash
5. Record your first transaction
Transaction records represent all financial activities (money in and money out) happening within your Blnk ledger. All transactions are immutable (cannot be modified or deleted) and idempotent (producing the same result no matter how many times an operation is performed). To record a transaction using the TypeScript SDK:Create transaction
bash