Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koinos/koinos-sdk-cpp
The Koinos Software Development Kit (SDK) facilitates the creation of smart contracts on the Koinos blockchain.
https://github.com/koinos/koinos-sdk-cpp
blockchain cryptocurrency koinos smart-contracts wasm
Last synced: 3 months ago
JSON representation
The Koinos Software Development Kit (SDK) facilitates the creation of smart contracts on the Koinos blockchain.
- Host: GitHub
- URL: https://github.com/koinos/koinos-sdk-cpp
- Owner: koinos
- License: mit
- Created: 2020-06-23T17:01:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-01T18:15:08.000Z (over 1 year ago)
- Last Synced: 2024-07-03T12:07:43.461Z (7 months ago)
- Topics: blockchain, cryptocurrency, koinos, smart-contracts, wasm
- Language: C++
- Homepage:
- Size: 10.9 MB
- Stars: 5
- Watchers: 7
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Components
- `koinos_api_c` : C library for invoking Koinos API syscalls with C syntax
- `koinos_api_cpp` : C++ library for invoking Koinos API syscall with C++ syntax
- `koinos_wasi_api` : C library for translating WASI syscalls to Koinos API syscalls
- `koinos-types` : C++ serialization library for Koinos
- `boost` : Header only Boost libraries## Installation
You first need to download wasi-sdk. We recommend the pre-compiled release for your system. Building contracts
has been tested on wasi sdk 12.0. Release binaries can be found on their git repo. https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-12Download and extract the wasi sdk to a location of your choosing. We recommend `$HOME/opt/wasi-sdk`. Save this
location in an env variable, `KOINOS_WASI_SDK_ROOT`.Set `KOINOS_SDK_ROOT` to the location you want to install the SDK. We recommend `$HOME/opt/koinos-sdk`.
The SDK builds using cmake.
To build and install run the following commands:
```
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$KOINOS_SDK_ROOT ..
make -j install
```## Using the SDK
You can now use the SDK to build C++ smart contracts using the cmake toolchain file.
Create your cmake project like normal. You will need to set your `target_link_libraries` to `koinos_api koinos_api_cpp koinos_wasi_api c c++ c++abi clang_rt.builtins-wasm32`.
Invoke your cmake project with the following command:
`cmake -DCMAKE_TOOLCHAIN_FILE=${KOINOS_SDK_ROOT}/cmake/koinos-wasm-toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..`You will have `.wasm` binaries in your build directory which will be valid Koinos smart contracts, ready to upload to Koinos.