This repository provides bolt client sdk libraries for projectn.
- C++11 or higher
- cmake 3.21 or higher
- aws-sdk-cpp
You can download one of the prebuilt static library .zip in the release page. You can also build the projectn library from source.
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";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.
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 -iYou 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 ReleaseThe 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 ZIPgit submodule update --init --recursiveWe follow the same release versioning as aws-sdk-cpp.
- run
./update_version.shand 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) - run
./git_tag.shto tag the latest commit to the aws-version and trigger the release action.
