Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Basic .NET Sample

Code for this sample is in ./Program.cs.

Prerequisites

Linux >= 5.6 is the only production environment we support. But for ease of development we also support macOS and Windows.

  • .NET >= 8.0.

And if you do not already have NuGet.org as a package source, make sure to add it:

dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org

Setup

First, clone this repo and cd into tigerbeetle/src/clients/dotnet/samples/basic.

Then, install the TigerBeetle client:

dotnet new console
dotnet add package tigerbeetle

Start the TigerBeetle server

Follow steps in the repo README to run TigerBeetle.

If you are not running on port localhost:3000, set the environment variable TB_ADDRESS to the full address of the TigerBeetle server you started.

Run this sample

Now you can run this sample:

dotnet run

Walkthrough

Here's what this project does.

1. Create accounts

This project starts by creating two accounts (1 and 2).

2. Create a transfer

Then it transfers 10 of an amount from account 1 to account 2.

3. Fetch and validate account balances

Then it fetches both accounts, checks they both exist, and checks that account 1 has:

  • debits_posted = 10
  • and credits_posted = 0

And that account 2 has:

  • debits_posted= 0
  • and credits_posted = 10