Skip to content

Latest commit

 

History

History
 
 

go

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Sample Go Integration for Wallet-Core

Overview

This folder contains a small Go sample integration with Wallet Core library (part of Trust Wallet), using cgo.

DISCLAIMER

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.

Documentation

See the official Trust Wallet developer documentation here.

See especially Wallet Core Integration Guide, and Build Instructions.

Prerequisites

  • Docker

Building and Running

  1. Run docker run -it trustwallet/wallet-core The librabry is already built in this image (Build instructions here) Note: may not be the most recent version.

  2. Install go: apt-get update && apt-get install golang (or download from here go1.13.3, configure GOROOT and append GOROOT/bin to PATH).

  3. Go to the samples/go folder within wallet core repo:

git clone https://github.com/trustwallet/wallet-core.git
cd wallet-core/samples/go
  1. Compile it by go build -o main. Relavant source file is main.go.

  2. Run ./main and you will see the output below:

==> calling wallet core from go
<== mnemonic is valid:  true
  1. You might want to copy and run main outside of the docker container, make sure you have libc++1 and libc++abi1 installed in your host Ubuntu.