Skip to content
🎉 Welcome! Translations are currently experimental. | 翻訳は現在実験的です。 | 翻译目前处于实验阶段。
Click here to submit feedback! | ここをクリックしてフィードバックを送信してください! | 点击这里提交反馈!
BuildSDKsGo SDKExample Code

Go SDK Example Code

For sample code which explains the core concepts of how to use the SDK, see:

Below are additional resources which may be more suited for your individual use case.

Code Snippets

The examples folder in the SDK repo has many code snippets you can customize to your needs.

How to run examples

To run one of the example scripts:

Clone the aptos-go-sdk repository

Terminal
git clone https://github.com/aptos-labs/aptos-go-sdk.git

From the top-level of the package, install all dependencies.

Terminal
go install

Build the package.

Terminal
go build ./...

Run an example

Terminal
go run examples/transfer_coin/main.go

Helpful Reference Code

  • SDK source code - This has in-line comments explaining what each function does.
  • SDK reference docs - These are another way to view the in-line documentation with built-in search.