Sample Go Integration for Wallet-Core
This folder contains a small Go sample integration with Wallet Core library (part of Trust Wallet), using cgo.
This is a sample application with demonstration purpose only, do not use it with real addresses, real transactions, or real funds. Use it at your own risk.
See the official Trust Wallet developer documentation here.
See especially Wallet Core Integration Guide, and Build Instructions.
- Docker
-
Run
docker run -it trustwallet/wallet-coreThe librabry is already built in this image (Build instructions here) Note: may not be the most recent version. -
Install go:
apt-get update && apt-get install golang(or download from here go1.13.3, configureGOROOTand appendGOROOT/bintoPATH). -
Go to the samples/go folder within wallet core repo:
git clone https://github.com/trustwallet/wallet-core.git
cd wallet-core/samples/go-
Compile it by
go build -o main. Relavant source file ismain.go. -
Run
./mainand you will see the output below:
==> calling wallet core from go
<== mnemonic is valid: true- You might want to copy and run
mainoutside of the docker container, make sure you havelibc++1andlibc++abi1installed in your host Ubuntu.