Skip to content

project-n-oss/projectn-bolt-cpp

Repository files navigation

projectn.png

projectn-bolt-cpp

This repository provides bolt client sdk libraries for projectn.

Prerequisites

Getting Started

You can download one of the prebuilt static library .zip in the release page. You can also build the projectn library from source.

Using the library

You can look at the ./example folder to see how to use our library with your app.

Configure Bolt custom domain and httpClientFactory

You must set Bolt custom domain through environment variable BOLT_CUSTOM_DOMAIN or through code (see ./example/main.cpp):

ProjectN::Bolt::BoltConfig::customDomain = "example.bolt.projectn.co";

You must also set the httpClientFactory_create_fn option in the aws SDKOptions struct like so (see ./example/main.cpp):

SDKOptions options;
options.httpOptions.httpClientFactory_create_fn = []() { return Aws::MakeShared<ProjectN::Bolt::BoltS3HttpClientFactory>(ALLOCATION_TAG); };

Configure preferred region and availability zone:

If running on an EC2 instance the SDK will use that instance's region and availability zone by default

If you want a specific region you can set with the environment variable AWS_REGION

If you want a specific availability zone you can set it with the a environment variable AWS_ZONE_ID.

You can also set those values in your code:

ProjectN::Bolt::BoltConfig::region = "us-east-2";
ProjectN::Bolt::BoltConfig::zoneId = "use1‑az2";
ProjectN::Bolt::BoltConfig::customDomain = "example.com";

Building from source

You can build this C++ library from source using the ./build.sh bash script. This will create a new folder ./install with all of the headers and static library.

build.sh

flags:

  • r) set build type to Release
  • d) set build type to Debug
  • i) create an install/ target folder

Example to create a release:

./build.sh -r -i

CMake

You can also use cmake directly to build this library and pass in cmake arguments like -DBUILD_SHARED_LIBS=1:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target install --config Release

CPack

The prebuilt packages are built with cpack. After building the library with cmake, you can use cpack to build your own package like so:

# cd ./build
cpack -G ZIP

Git Submodule

git submodule update --init --recursive

Creating New Release

We follow the same release versioning as aws-sdk-cpp.

Steps

  1. run ./update_version.sh and give the aws-sdk-cpp version you want to update too. (This will checkout the correct version of the aws-sdk-cpp submodule and update the projectn cmake project to the same version)
  2. run ./git_tag.sh to tag the latest commit to the aws-version and trigger the release action.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published