Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
December 18, 2022 12:25
December 18, 2022 00:34
November 11, 2022 16:47
May 19, 2020 21:01
June 25, 2020 00:34
May 15, 2020 23:49
November 21, 2022 14:43
July 1, 2022 01:46
November 9, 2022 01:40
July 1, 2020 01:05
May 15, 2020 17:23
June 5, 2020 14:59
November 11, 2022 16:38

C/C++ CI


This library is used to interface with the Aergo blockchains from different programming languages:

  • C
  • C++
  • C#
  • VB.NET
  • Swift
  • Ruby

Other languages can also use it via FFI.

Supported OS

  • Linux
  • Mac
  • Windows
  • iOS
  • Android

Pre-compiled binaries

You can download binaries for iOS and Windows in the releases


libaergo depends on secp256k1-vrf and libcurl

Use the http1 branch if you want a version that does not depend on libcurl. Subscriptions to events are not possible on that case.

It also depends on hidapi when interfacing with a Ledger Nano S

Compiling the dependencies

First install the tools required for compilation

On Linux:

sudo apt-get install gcc make automake libtool libcurl4-openssl-dev -y

On Mac:

brew install automake libtool

Compiling and installing secp256k1-vrf:

git clone --depth=1
cd secp256k1-vrf
sudo make install
cd ..

Compiling and installing hidapi (only required if using a Ledger device):

sudo apt-get install libudev-dev libusb-1.0-0-dev
git clone --depth=1
cd hidapi
sudo make install
cd ..

Compiling libaergo

sudo make install

For iOS:

cd ../secp256k1-vrf
cd -


You can link your application to the external dynamic library.

On some languages you can also include the static library in your project instead of linking to the dynamic library.

Supported Features

  • Get Account State
  • Smart Contract Call
  • Smart Contract Query
  • Smart Contract Events Notification
  • Transfer



There are many usage examples available for each supported language, for synchronous and asynchronous calls.

Compiling an example code:


gcc examples/contract_call/contract_call.c -laergo -o contract_call


g++ examples/contract_call/contract_call.cpp -std=c++17 -laergo -o contract_call

C# and VB.NET

Open the example in a new project, include the .NET wrapper in the project, then build and execute it.

Or compile it via command line: (Windows)

csc examples\contract_query\contract_query.cs wrappers\dotNet\AergoClient.cs /r:System.Numerics.dll


Open the example in a new project, include the Swift wrapper and the bridging header on the project, then build and execute it.

Or compile it via command line:

swiftc examples/contract_query/main.swift wrappers/Swift/aergo.swift -import-objc-header wrappers/Swift/libaergo-Bridging-Header.h -L/usr/local/lib -laergo


Install the ffi module:

[sudo] gem install ffi

To run an example:

ruby examples/contract_call/contract_call.rb