Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): Add Android builds to CI #682

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
18a500a
WIP: Add android presets to cmake presets. Doesn't currently build
rwalworth Feb 12, 2024
a2649b3
Try different path for android ndk
rwalworth Feb 22, 2024
9e1d55a
Try correct architecture ndk
rwalworth Feb 23, 2024
dceadbf
Wrong directory name for ndk
rwalworth Feb 23, 2024
f879c59
Trying stuff
rwalworth Feb 23, 2024
3bd293f
Revert back to x86_64
rwalworth Feb 23, 2024
a0bbb01
Update paths
rwalworth Feb 23, 2024
4763b55
Replace log4cxx with spdlog since android builds for apr don't work o…
rwalworth Feb 26, 2024
67526c4
Fix issue of traditional make ports being incompatible with NDK r26 (…
rwalworth Feb 26, 2024
32d3e9b
Try newer version of openssl
rwalworth Feb 27, 2024
2e7f1a4
Manually add VCPKG_DETECTED_CMAKE_ANDROID_ARCH to CMakePresets.json
rwalworth Feb 27, 2024
1bd1e10
Add update steps to dockerfile
rwalworth Feb 27, 2024
445bc23
Trying going back to r25c
rwalworth Feb 27, 2024
ee716e7
Revert vcpkg
rwalworth Feb 27, 2024
c21b09a
Revert openssl version
rwalworth Feb 27, 2024
2a9aeda
Downgrade spdlog
rwalworth Feb 27, 2024
5524e1e
Install vim
rwalworth Feb 27, 2024
f9718ca
Reupdate to new stuff
rwalworth Feb 27, 2024
f194cd6
Trying stuff
rwalworth Feb 27, 2024
35ac9de
Forgot to update json
rwalworth Feb 27, 2024
4fb16fd
Try r25c NDK
rwalworth Feb 28, 2024
368c99a
Forgot update to env var
rwalworth Feb 28, 2024
517dcc4
Try master
rwalworth Feb 28, 2024
837d8d0
Try adding package
rwalworth Feb 28, 2024
236eaa8
Add version to vcpkg-cmake-get-vars
rwalworth Feb 28, 2024
0ebb4c9
Try an updated baseline
rwalworth Feb 28, 2024
2ceb723
Merge branch 'main' into 00660-add-android-and-ios-builds
rwalworth Feb 29, 2024
934ef36
Use latest vcpkg release
rwalworth Feb 29, 2024
e70e8bf
Try no specific versions and just most recent packages
rwalworth Mar 1, 2024
ca44bc9
Get configuration working
rwalworth Mar 1, 2024
812294d
Fix google tests
rwalworth Mar 1, 2024
7634b73
Have gtest be brought in by vcpkg
rwalworth Mar 1, 2024
f1b862a
Fix Android build
rwalworth Mar 4, 2024
794418d
Change install prefix
rwalworth Mar 4, 2024
08238d7
Change HAPI path to find
rwalworth Mar 4, 2024
6228dea
Fix Windows build
rwalworth Mar 4, 2024
b89940b
Build with local protobufs
rwalworth Mar 8, 2024
e2cdc68
Trying installing test executables for android builds
rwalworth Mar 11, 2024
f166b0c
Don't install the examples twice
rwalworth Mar 11, 2024
8756cb5
Fix broken integration tests
rwalworth Mar 13, 2024
e8c1860
Build examples as shared libraries for android (just testing create a…
rwalworth Mar 19, 2024
9bede07
Add JNI calls to CreateAccountExample | Hook up correctly-named library
rwalworth Mar 19, 2024
5bbe4d0
Add stuff for android apk build
rwalworth Mar 20, 2024
eac5382
Add build tools to path
rwalworth Mar 21, 2024
7eff1fe
Update build tools
rwalworth Mar 26, 2024
d8fc447
Try changing JNI function name
rwalworth Apr 2, 2024
c7bcd9b
Change header file
rwalworth Apr 3, 2024
5a4647f
Use AssetManager to get addressbook and config files
rwalworth Apr 4, 2024
8b36990
Remove apk
rwalworth Apr 4, 2024
3ad3648
remove pull from dockerfile
rwalworth Apr 4, 2024
639161d
AndroidHelper not in impl
rwalworth Apr 4, 2024
5ebff29
Fix arg bug
rwalworth Apr 4, 2024
1a206ec
Fix include path
rwalworth Apr 4, 2024
62df8dd
Try setting environment variables with adb
rwalworth Apr 4, 2024
b74cb78
Add debug statements
rwalworth Apr 4, 2024
46e6c46
AAssetManager isn't internal
rwalworth Apr 4, 2024
5ca4534
Move Android definitions to own source file
rwalworth Apr 4, 2024
8066989
Can't name the function main()
rwalworth Apr 4, 2024
d9e89ce
Try using android logs
rwalworth Apr 4, 2024
8d499e4
Fix typo
rwalworth Apr 4, 2024
6739c93
Target newer API version
rwalworth Apr 9, 2024
a07c9b4
Clean up repo, remove example APK work
rwalworth Apr 16, 2024
5d030b9
Add workflow changes to build Android in CI
rwalworth Apr 16, 2024
199c175
Go back to latest of get-cmake
rwalworth Apr 16, 2024
efa231f
Fix repo being cloned
rwalworth Apr 16, 2024
001a527
Enable android build on PR merge
rwalworth Apr 16, 2024
d363e16
Merge branch 'main' into 00660-add-android-and-ios-builds
rwalworth Apr 17, 2024
7bce8a1
Address PR comments
rwalworth Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/zxc-build-library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ jobs:
- name: Ensure Binary Cache Path Exists
run: mkdir -p "${{ github.workspace }}/b/vcpkg_cache"

- name: CMake Android Build
if: github.event.pull_request.merged == true
run : |
docker build -t ubuntu-jammy-hedera-sdk-cpp-android-build . --build-arg BRANCH_NAME=${{ github.base_ref }}
docker cp $(docker create ubuntu-jammy-hedera-sdk-cpp-android-build:latest):/hedera-sdk-cpp/package .

- name: Install CMake & Ninja
uses: lukka/get-cmake@v3.27.7

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(hedera-sdk-cpp VERSION 0.1.0 DESCRIPTION "Hedera SDK C++" LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE}/${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR})
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR})

set(Protobuf_USE_STATIC_LIBS ON)

Expand All @@ -20,7 +20,7 @@ find_package(upb CONFIG REQUIRED)
find_package(Threads REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(CURL CONFIG REQUIRED)
find_package(EXPAT CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)

include(FetchContent)
include(SystemLibraries.cmake)
Expand Down
84 changes: 83 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,45 @@
}
}
},
{
"name": "vcpkg-android-base",
"hidden": true,
"displayName": "Android VCPkg Base Build",
"description": "Configured via the Android NDK toolchain",
"binaryDir": "${sourceDir}/build/${presetName}",
"installDir": "${sourceDir}/package",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"ANDROID_ABI": {
"type": "STRING",
"value": "arm64-v8a"
},
"ANDROID_PLATFORM": {
"type": "STRING",
"value": "21"
},
"CMAKE_SYSTEM_NAME": {
"type": "STRING",
"value": "Android"
},
"CMAKE_SYSTEM_PROCESSOR": {
"type": "STRING",
"value": "aarch64"
},
"CMAKE_SYSTEM_VERSION": {
"type": "STRING",
"value": "34"
},
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake"
},
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "/android-ndk-r25c/build/cmake/android.toolchain.cmake"
}
}
},
{
"name": "linux-x64-release",
"inherits": ["vcpkg-base"],
Expand Down Expand Up @@ -147,6 +186,34 @@
"value": "Debug"
}
}
},
{
"name": "android-arm64-debug",
"inherits": ["vcpkg-android-base"],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "arm64-android"
},
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Debug"
}
}
},
{
"name": "android-arm64-release",
"inherits": ["vcpkg-android-base"],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "arm64-android"
},
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Release"
}
}
}
],
"buildPresets": [
Expand Down Expand Up @@ -213,9 +280,24 @@
"description": "Build MSVC Configurations",
"configuration": "Debug",
"targets": ["install"]
},
{
"name": "android-arm64-debug",
"configurePreset": "android-arm64-debug",
"displayName": "Build ninja-multi-vcpkg",
"description": "Build ninja-multi-vcpkg Configurations",
"configuration": "Debug",
"targets": ["install"]
},
{
"name": "android-arm64-release",
"configurePreset": "android-arm64-release",
"displayName": "Build ninja-multi-vcpkg",
"description": "Build ninja-multi-vcpkg Configurations",
"configuration": "Release",
"targets": ["install"]
}
],
"testPresets": [

]
}
123 changes: 123 additions & 0 deletions Dockerfile
gsstoykov marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
FROM ubuntu:jammy

ENV DEBIAN_FRONTEND noninteractive
ARG BRANCH_NAME

RUN \
apt-get update && \
apt-get -y upgrade

RUN \
apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \
cmake \
curl \
git \
libc6-dbg \
libgtest-dev \
linux-libc-dev \
ninja-build \
pkg-config \
python3 \
tar \
unzip \
vim \
wget \
zip

# Download the Android NDK.
RUN \
wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip && \
unzip android-ndk-r25c-linux.zip && \
rm android-ndk-r25c-linux.zip
ENV ANDROID_NDK_HOME /android-ndk-r25c

# This is needed by OpenSSL because for some reason it uses PATH to find the Android NDK compilers (and obviously
# this will only work for linux-x86_64 images).
ENV PATH $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH

# Clone the repository.
RUN git clone https://github.com/hashgraph/hedera-sdk-cpp.git

# Change the working directory to that of the cloned repository.
WORKDIR /hedera-sdk-cpp

# Checkout the working branch.
RUN git checkout origin/$BRANCH_NAME
rwalworth marked this conversation as resolved.
Show resolved Hide resolved

# Update the submodule.
RUN git submodule update --init

# Build
RUN cmake --preset android-arm64-release
RUN cmake --preset android-arm64-debug
RUN cmake --build --preset android-arm64-release
RUN cmake --build --preset android-arm64-debug

# TODO:
# The steps below are steps needed to test the Android library executables. Currently, the Android emulator is unable to
# run in a linux-x86_64 environment because it is built for arm64. If there is interest in testing the Android library
# in CI, this issue of where to run the Android emulator will need to be figured out (must be in an arm64 environment,
# arm64 docker container has been tested but doesn't work). The steps here should be the general workflow of how to get
# the emulator up and running and the test executables ran.

# Download Android SDK
gsstoykov marked this conversation as resolved.
Show resolved Hide resolved
#WORKDIR /
#RUN \
# mkdir android-sdk && \
# cd android-sdk && \
# wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip && \
# unzip commandlinetools-linux-11076708_latest.zip && \
# rm commandlinetools-linux-11076708_latest.zip && \
# # For some reason the SDK download doesn't put the cmdline-tools in a 'latest' folder even though its required by the
# # sdkmanager, so some directory rearranging is required here.
# mkdir latest && \
# mv cmdline-tools/* latest && \
# mv latest cmdline-tools

# Add environment variables to help run tools.
#ENV ANDROID_HOME /android-sdk
#ENV PATH $ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$ANDROID_HOME
#/build-tools/29.0.2:$PATH

# Download an Android platform on which to test.
#RUN yes | sdkmanager --licenses
#RUN sdkmanager --update
#RUN sdkmanager \
# "emulator" \
# "platforms;android-21" \
# "platform-tools" \
# "system-images;android-21;default;arm64-v8a" \
# "build-tools;29.0.2"
#RUN echo | avdmanager create avd --name test-avd --package "system-images;android-21;default;arm64-v8a"
#RUN emulator -avd test-avd -no-audio -no-window

# TODO:
# The steps below are remnants of the effort that was put into making the examples Android APKs. This has since been
# abandoned, but if this is looked at again then here are some remnants of that work to pick up.

# RUN apt-get -y --no-install-recommends install openjdk-17-jdk
# ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64

#WORKDIR /hedera-sdk-cpp/src/sdk/examples/CreateAccountExample
#RUN mkdir -p build/gen build/obj build/apk/lib/arm64-v8a build/apk/assets
#RUN aapt package -f -m -J build/gen -S res -M AndroidManifest.xml -I $ANDROID_HOME/platforms/android-21/android.jar
#RUN javac -bootclasspath $JAVA_HOME/jre/lib/rt.jar -classpath $ANDROID_HOME/platforms/android-21/android.jar -d \
# build/obj build/gen/com/hedera/hashgraph/sdk/cpp/examples/R.java \
# src/main/java/com/hedera/hashgraph/sdk/cpp/examples/CreateAccountExample.java -source 1.7 -target 1.7
#RUN dx --dex --output=build/apk/classes.dex build/obj
#RUN cp \
# /hedera-sdk-cpp/build/android-arm64-release/src/sdk/examples/Release/libhedera-sdk-cpp-create-account-example.so \
# build/apk/lib/arm64-v8a/
#RUN cp -r /hedera-sdk-cpp/addressbook build/apk/assets
#RUN cp -r /hedera-sdk-cpp/config build/apk/assets
#RUN aapt package -f -M AndroidManifest.xml -S res -I $ANDROID_HOME/platforms/android-21/android.jar -F \
# build/hedera-sdk-cpp-create-account-example-apk.unsigned.apk build/apk
#RUN zipalign -f -p 4 build/hedera-sdk-cpp-create-account-example-apk.unsigned.apk \
# build/hedera-sdk-cpp-create-account-example-apk.aligned.apk
#RUN { echo testkey; echo testkey; echo; echo; echo; echo; echo; echo; echo y; } | keytool -genkeypair -keystore \
# keystore.jks -alias androidkey -validity 10000 -keyalg RSA -keysize 2048
#RUN echo testkey | apksigner sign --ks keystore.jks --ks-key-alias androidkey --out \
# build/hedera-sdk-cpp-create-account-example-apk.apk build/hedera-sdk-cpp-create-account-example-apk.aligned.apk

4 changes: 2 additions & 2 deletions HederaApi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ else ()
set(hapi_SOURCE_DIR ${HAPI_LOCAL_LIBRARY_PATH})
endif ()

set(HAPI_ROOT_DIR ${hapi_SOURCE_DIR}/${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR})
set(HAPI_ROOT_DIR ${hapi_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR})

if (NOT EXISTS ${HAPI_ROOT_DIR})
set(HAPI_ROOT_DIR ${hapi_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR})
set(HAPI_ROOT_DIR ${hapi_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR})

if (NOT EXISTS ${HAPI_ROOT_DIR})
message(FATAL_ERROR "Failed to the HAPI_ROOT_DIR at `${HAPI_ROOT_DIR}`")
Expand Down
97 changes: 23 additions & 74 deletions src/sdk/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,6 @@ add_executable(${UPDATE_ACCOUNT_PUBLIC_KEY_EXAMPLE_NAME} UpdateAccountPublicKeyE
add_executable(${VALIDATE_CHECKSUM_EXAMPLE_NAME} ValidateChecksumExample.cc)
add_executable(${ZERO_TOKEN_OPERATIONS_EXAMPLE_NAME} ZeroTokenOperationsExample.cc)

file(COPY ${PROJECT_SOURCE_DIR}/addressbook/mainnet.pb
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
file(COPY ${PROJECT_SOURCE_DIR}/addressbook/previewnet.pb
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
file(COPY ${PROJECT_SOURCE_DIR}/addressbook/testnet.pb
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})

file(COPY ${PROJECT_SOURCE_DIR}/config/hello_world.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
file(COPY ${PROJECT_SOURCE_DIR}/config/local_node.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
file(COPY ${PROJECT_SOURCE_DIR}/config/stateful.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})

file(COPY precompile-example DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})

# Install gRPC's roots.pem file for Windows with the examples so that it can be easily referenced.
if (WIN32)
file(COPY ${PROJECT_SOURCE_DIR}/vcpkg/packages/grpc_x64-windows/share/grpc/roots.pem
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
endif ()

target_link_libraries(${ACCOUNT_ALIAS_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${ACCOUNT_ALLOWANCE_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${ACCOUNT_ALLOWANCE_SERIALIZED_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
Expand All @@ -138,7 +116,7 @@ target_link_libraries(${CONSENSUS_PUB_SUB_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${CONSENSUS_PUB_SUB_CHUNKED_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${CONSENSUS_PUB_SUB_WITH_SUBMIT_KEY_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${CONSTRUCT_CLIENT_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${CREATE_ACCOUNT_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${CREATE_ACCOUNT_EXAMPLE_NAME} PRIVATE ${PROJECT_NAME})
target_link_libraries(${CREATE_FILE_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${CREATE_ACCOUNT_THRESHOLD_KEY_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${CREATE_SIMPLE_CONTRACT_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
Expand Down Expand Up @@ -178,55 +156,26 @@ target_link_libraries(${UPDATE_ACCOUNT_PUBLIC_KEY_EXAMPLE_NAME} PUBLIC ${PROJECT
target_link_libraries(${VALIDATE_CHECKSUM_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
target_link_libraries(${ZERO_TOKEN_OPERATIONS_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE} DESTINATION examples FILES_MATCHING PATTERN *)
file(COPY ${PROJECT_SOURCE_DIR}/addressbook/mainnet.pb
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
file(COPY ${PROJECT_SOURCE_DIR}/addressbook/previewnet.pb
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
file(COPY ${PROJECT_SOURCE_DIR}/addressbook/testnet.pb
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})

file(COPY ${PROJECT_SOURCE_DIR}/config/hello_world.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
file(COPY ${PROJECT_SOURCE_DIR}/config/local_node.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
file(COPY ${PROJECT_SOURCE_DIR}/config/stateful.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})

file(COPY precompile-example DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})

# Install gRPC's roots.pem file for Windows with the examples so that it can be easily referenced.
if (WIN32)
file(COPY ${PROJECT_SOURCE_DIR}/vcpkg/packages/grpc_x64-windows/share/grpc/roots.pem
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
endif ()

install(TARGETS
${ACCOUNT_ALIAS_EXAMPLE_NAME}
${ACCOUNT_ALLOWANCE_EXAMPLE_NAME}
${ACCOUNT_CREATE_WITH_HTS_EXAMPLE_NAME}
${ACCOUNT_CREATION_WAYS_EXAMPLE_NAME}
${AUTO_CREATE_ACCOUNT_TRANSFER_TRANSACTION_EXAMPLE_NAME}
${CONSENSUS_PUB_SUB_EXAMPLE_NAME}
${CONSENSUS_PUB_SUB_CHUNKED_EXAMPLE_NAME}
${CONSENSUS_PUB_SUB_WITH_SUBMIT_KEY_EXAMPLE_NAME}
${CONSTRUCT_CLIENT_EXAMPLE_NAME}
${CREATE_ACCOUNT_EXAMPLE_NAME}
${CREATE_FILE_EXAMPLE_NAME}
${CREATE_ACCOUNT_THRESHOLD_KEY_EXAMPLE_NAME}
${CREATE_SIMPLE_CONTRACT_EXAMPLE_NAME}
${CREATE_STATEFUL_CONTRACT_EXAMPLE_NAME}
${CREATE_TOPIC_EXAMPLE_NAME}
${CONTRACT_NONCES_EXAMPLE_NAME}
${CUSTOM_FEES_EXAMPLE_NAME}
${DELETE_ACCOUNT_EXAMPLE_NAME}
${DELETE_FILE_EXAMPLE_NAME}
${EXEMPT_CUSTOM_FEES_EXAMPLE_NAME}
${FILE_APPEND_CHUNKED_EXAMPLE_NAME}
${GENERATE_KEY_EXAMPLE_NAME}
${GENERATE_PRIVATE_KEY_FROM_MNEMONIC_EXAMPLE_NAME}
${GET_ACCOUNT_BALANCE_EXAMPLE_NAME}
${GET_ACCOUNT_INFO_EXAMPLE_NAME}
${GET_ADDRESS_BOOK_EXAMPLE_NAME}
${GET_EXCHANGE_RATES_EXAMPLE_NAME}
${GET_FILE_CONTENTS_EXAMPLE_NAME}
${MULTI_APP_TRANSFER_EXAMPLE_NAME}
${MULTI_SIG_OFFLINE_EXAMPLE_NAME}
${NFT_ADD_REMOVE_ALLOWANCES_EXAMPLE_NAME}
${PRNG_EXAMPLE_NAME}
${SCHEDULE_EXAMPLE_NAME}
${SCHEDULE_IDENTICAL_TRANSACTION_EXAMPLE_NAME}
${SCHEDULE_MULTI_SIG_TRANSACTION_EXAMPLE_NAME}
${SCHEDULE_TRANSACTION_MULTI_SIG_TRANSACTION_EXAMPLE_NAME}
${SCHEDULE_TRANSFER_EXAMPLE_NAME}
${SIGN_TRANSACTION_EXAMPLE_NAME}
${SOLIDITY_PRECOMPILE_EXAMPLE_NAME}
${STAKING_EXAMPLE_NAME}
${STAKING_WITH_UPDATE_EXAMPLE_NAME}
${TOPIC_WITH_ADMIN_KEY_EXAMPLE_NAME}
${TRANSFER_CRYPTO_EXAMPLE_NAME}
${TRANSFER_TOKENS_EXAMPLE_NAME}
${TRANSFER_USING_EVM_ADDRESS_EXAMPLE_NAME}
${UPDATE_ACCOUNT_PUBLIC_KEY_EXAMPLE_NAME}
${VALIDATE_CHECKSUM_EXAMPLE_NAME}
${ZERO_TOKEN_OPERATIONS_EXAMPLE_NAME}
RUNTIME DESTINATION examples)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/ DESTINATION examples FILES_MATCHING PATTERN *)
1 change: 1 addition & 0 deletions src/sdk/examples/CreateAccountExample.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ using namespace Hedera;
int main(int argc, char** argv)
{
dotenv::init();

const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

Expand Down