Gno Native Kit is a framework that allows developers to build and port gno.land (d)apps written in the (d)app's native language.
Current Gno (d)apps run on desktop/laptop computers which have Go installed. To run on mobile, the (d)app would need to bundle the Go runtime, which is complicated for most developers.
However, Gno Native Kit helps bypass this complexity by using gRPC to make calls to the Gno core API and access the blockchain's realm functions on a remote Gno.land node. These API calls are a programming language-independent wrapper on top of the core supported APIs like gnoclient and crypto/keys.
Watch this Gno Native Kit tutorial to easily get started on building and bringing your (d)apps to mobile and desktop.
(If you are on Ubuntu, see the next section to install prerequisites.)
Install Xcode. To install the Command Line Developer Tools, in a terminal enter:
xcode-select --install
After the Developer Tools are installed, we need to make sure it is updated. In System Preferences, click Software Update and update it if needed.
To install asdf using brew, follow instructions at https://asdf-vm.com . In short, first install brew following the instructions at https://brew.sh . Then, in a terminal enter:
brew install asdf gnu-tar gpg jq
If your terminal is zsh, enter:
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
If your terminal is bash, enter:
echo -e "\n. \"$(brew --prefix asdf)/libexec/asdf.sh\"" >> ~/.bash_profile
Start a new terminal to get the changes to the environment.
(optional) To install Android Studio, download and install the latest android-studio-{version}-mac.dmg from https://developer.android.com/studio . (Tested with Jellyfish 2023.3.1 .)
To install asdf, follow instructions at https://asdf-vm.com . In short, in a terminal enter:
sudo apt install curl git make
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.profile
source ~/.profile
Start a new terminal to get the changes to the environment.
(optional) To install Android Studio, download the latest android-studio-{version}-linux.tar.gz from https://developer.android.com/studio . (Tested with Jellyfish 2023.3.1 .) In a terminal, enter the following with the correct {version}:
sudo tar -C /usr/local -xzf android-studio-{version}-linux.tar.gz
To launch Android Studio, in a terminal enter:
/usr/local/android-studio/bin/studio.sh &
git clone https://github.com/gnolang/gnonative
cd gnonative
(If not building for iOS, edit the file .tool-versions
and remove the unneeded lines for ruby
and cocoapods
.)
make asdf.install_tools
make build.android
cd examples/js/react-native/gnoboard
yarn start
You can either connect an Android phone via USB cable, or launch an emulator device from Android Studio.
Connect your device and bind the port to metro:
cd examples/js/react-native/gnoboard
make android.reverse_tcp
You can either run Android Studio and open the Android project in examples/js/react-native/gnoboard/android
.
If you prefer the CLI option:
android-studio ./android
Once done, bind the port to metro:
make android.reverse_tcp
Open Android Studio and open the current Android project if it's not already done.
Select the right device in the device list. Open the Run
menu, and select Run app
.
See more: https://developer.android.com/studio/run#basic-build-run
make asdf.install_tools
If you get an error like "https://github.com/CocoaPods/CLAide.git (at master@97b765e) is not yet checked out" then reinstall cocoapods like this:
asdf uninstall cocoapods
make asdf.install_tools
make build.ios
cd examples/js/react-native/gnoboard
yarn start
Open Xcode and open the GnoBoard Xcode workspace: examples/js/react-native/gnoboard/ios/gnoboard.xcworkspace
You can either connect an iOS phone via USB cable, or launch an emulator device from Xcode.
See more: https://developer.apple.com/documentation/xcode/running-your-app-in-simulator-or-on-a-device
In Xcode, double click on gnoboard project on the left pane, go to the Signing & Capabilities
pane.
In the Signing
section, select your team
certificate.
Select the right device in the device list. Open the Product
menu, and select Run
.
See more: https://developer.apple.com/documentation/xcode/building-and-running-an-app