README ¶
Unreal-Nibi-SDK
Unreal-Nibi-SDK is a cpp package written in C++ to help developers integrate Nibiru blockchain technology into their cpp and Unreal projects.
- Project Layout
- Features
- Requirements
- Installation
- Unreal-Nibi-SDK with Blueprint
- Go API
- Testing
- Deploy CW721 contract
Project Layout
UnrealExample/
:: This directory contains Wallet example Unreal Project using Unreal-Nibi-SDK.Resource/
:: A place for various resources needed for the project, like images, data files, or other assets.libs/
: This directory houses a Go package specifically designed for connecting to and interacting with the blockchain, facilitating the initialization of the client for seamless integration with the project.test/
: This directory hosts Go unit test files to ensure the functionality, reliability, and performance of the associated components within the project.
Features
Creating a Wallet
: Generate new blockchain wallets to securely manage funds and conduct transactions.Querying
: Retrieve detailed information from the blockchain, such as transaction history, account balances, or smart contract data.Transfer Token
: Seamlessly transfer tokens between blockchain addresses with built-in security measures.Mint NFT
: Create unique and non-fungible tokens (NFTs) on the blockchain, enabling the creation and management of digital assets.
Requirements
Platforms | Unreal Version | Installation | Status |
---|---|---|---|
MacOS | Unity engine 5.4 | 3rd lib build config | Fully Tested |
Windows | Unity engine 5.4 | 3rd lib build config, visual studio 2022 (with desktop and game development c++) | Fully Tested |
Installation
FOR MACOS
Installation Guide
This guide provides step-by-step instructions for installing and setting up our library which is compatible macOS platforms. Ensure you have the following prerequisites installed to build the project:
Prerequisites
Go : https://go.dev/doc/install
Visual Studio Code with C++ development environment
Installation Steps
- Install Xcode
- Install Visual Studio Code with C++ development environment
- Install Go
- Install Unreal 5.4.1 and Launch UE (You need to create Epic Games account)
Project Setup
You can run setup.sh to do all these steps to set up the project environment:
- Build the project:
rm -f unreal_nibi_sdk.dylib go build -o unreal_nibi_sdk.dylib -buildmode=c-shared ./api.go
- To check Project Build Success
gcc -o sdk_test sdk_test.c unreal_nibi_sdk.dylib -lpthread
- Test some function in Project:
./sdk_test
- Settup library to use for Unreal Project:
install_name_tool -id @rpath/unreal_nibi_sdk.dylib unreal_nibi_sdk.dylib
https://github.com/VAR-META-Tech/unreal-nibi/assets/59425826/2ceed8bf-ab29-4a10-92c0-d71f2e9a021c
FOR WINDOWS
Installation Guide
This guide provides step-by-step instructions for installing and setting up our library which is compatible Windows platforms. Ensure you have the following prerequisites installed to build the project:
Prerequisites
Go : https://go.dev/doc/install
Visual Studio 2022 with C++ development environment for Desktop and Game
Installation Steps
- Install Visual Studio 2022 with C++ development environment
- Install Go
- Install Unreal 5.4.1
Project Setup
Do all these steps to set up the project environment:
- Build the project: Need copy wasmvm.dll to mingw64 path: C:\TDM-GCC-64\lib
go build -ldflags="-w" -o unreal_nibi_sdk.dll -buildmode=c-shared ./api.go
- To check Project Build Success and Test some function in Project:
C:\TDM-GCC-64\bin\x86_64-w64-mingw32-gcc.exe -o sdk_test sdk_test.c unreal_nibi_sdk.dll ./sdk_test.exe
Example Unreal Project
An Example unreal project can be found in the following path:
./UnrealExample/NibiruUnreal.uproject
.
https://github.com/VAR-META-Tech/unreal-nibi/assets/59425826/c9c6f4df-0181-4a28-bb50-2c6ddaad1afd
Follow these steps to run the Unreal Project Demo:
-
Click
NibiruUnreal.uproject
in the./UnrealExample/NibiruUnreal/NibiruUnreal.uproject
and waiting for Unreal open this project.For windows, you should Generate Visual Studio Files
After that open .sln file to build and run project example
NOTE: In Windows when you play program in first time with throw an exception, please continue to run
-
To run Unreal Project you need to open NibiruLevel and Click Button Play:
NOTE: You can see NibiruLevel into Content Drawer:
-
After Click Button Play : The project is now ready for Demo.
-
To view the Unreal C++ code, you can open
NibiruUnreal.code-workspace
in the./UnrealExample/NibiruUnreal/
by VS Code.
NOTE: You can open NibiruUnreal.code-workspace by Unreal Editer: Click Tools -> Open Visual Studio Code.
Integration sdk lib with Unreal Project
For Unreal project please reference example in NibiruUnreal
, you need define Build.cs to integration unreal_nibi_sdk
library with Unreal engine.
Here is an example:
using UnrealBuildTool;
using System.IO;
public class NibiruUnreal : ModuleRules
{
public NibiruUnreal(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
bEnableExceptions = true;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
if (Target.Platform == UnrealTargetPlatform.Mac)
{
string unreal_nibi_sdk_LibPath = Path.Combine(ModuleDirectory, "../../../../", "unreal_nibi_sdk.dylib");
string destinationDirectory = Target.ProjectFile.Directory.FullName;
File.Copy(unreal_nibi_sdk_LibPath, Path.Combine(destinationDirectory, "unreal_nibi_sdk.dylib"), true);
PublicAdditionalLibraries.Add(Path.Combine(destinationDirectory, "unreal_nibi_sdk.dylib"));
PublicIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "../../../") });
PublicIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "../../../../") });
} else if (Target.Platform == UnrealTargetPlatform.Win64)
{
string unreal_nibi_sdk_LibPath = Path.Combine(ModuleDirectory, "../../../../", "unreal_nibi_sdk.dll");
string cosmos_LibPath = Path.Combine(ModuleDirectory, "../../../../", "wasmvm.dll");
string destinationDirectory = Target.ProjectFile.Directory.FullName + "/Binaries/Win64";
File.Copy(unreal_nibi_sdk_LibPath, Path.Combine(destinationDirectory, "unreal_nibi_sdk.dll"), true);
File.Copy(cosmos_LibPath, Path.Combine(destinationDirectory, "wasmvm.dll"), true);
//PublicDelayLoadDLLs.Add(Path.Combine(destinationDirectory, "unreal_nibi_sdk.dll"));
//PublicDelayLoadDLLs.Add(Path.Combine(destinationDirectory, "wasmvm.dll"));
PublicIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "../../../") });
PublicIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "../../../../") });
}
CppStandard = CppStandardVersion.Cpp17;
}
}
Using Unreal-Nibi-SDK with Blueprint
Create Wallet
Transfer Transaction
Faucet
Testing
To run unit test. You can do the following cmd:
go test ./test/...
Go API
You can check out this file to see what APIs we using: gonibi.md
Deploy CW721 contract
The CW721 contract is a specification for non-fungible tokens (NFTs) built on the CosmWasm platform. Inspired by Ethereum's ERC721 standard, CW721 introduces enhancements tailored to the CosmWasm ecosystem. These enhancements aim to provide a robust framework for creating and managing NFTs within decentralized applications (dApps) on the CosmWasm network.
You can check out this file to see how to deploy CW721 contract and Mint an NFT ./deploy_cw721.md
License
This project is licensed under the Apache-2.0 License. Refer to the LICENSE.txt file for details.
Documentation ¶
There is no documentation for this package.