Git Product home page Git Product logo

everscale-client-go's Introduction

TON SDK client Golang

EVER-SDK TON local-node docker image Chat Telegram Documentation CI tests and linters

Preparations

One needs to install

EVER-SDK installation - Mac OS

export EVER_SDK_INSTALLATION_PATH=`pwd`/tmp # example - should be specified as absolute path
# clean previous installation in case of reinstalling
rm -f $EVER_SDK_INSTALLATION_PATH/libton_client.dylib.gz $EVER_SDK_INSTALLATION_PATH/libton_client.dylib
# download binaries
wget https://binaries.tonlabs.io/tonclient_1_darwin.gz -O $EVER_SDK_INSTALLATION_PATH/libton_client.dylib.gz
# extract binaries
gzip -d $EVER_SDK_INSTALLATION_PATH/libton_client.dylib.gz
# make extracted file executable
chmod +x $EVER_SDK_INSTALLATION_PATH/libton_client.dylib
# set loading by absolute path
install_name_tool -id $EVER_SDK_INSTALLATION_PATH/libton_client.dylib $EVER_SDK_INSTALLATION_PATH/libton_client.dylib

# Better to add this to ~/.bashrc or ~/.zshrc to DRY in terminal each time you use it
export CGO_LDFLAGS="-L$EVER_SDK_INSTALLATION_PATH -lton_client"

EVER-SDK installation - Linux

EVER_SDK_INSTALLATION_PATH=`pwd`/tmp # example - should be specified as absolute path
# clean previous installation in case of reinstalling
rm -f $EVER_SDK_INSTALLATION_PATH/libton_client.so.gz $EVER_SDK_INSTALLATION_PATH/libton_client.so
# download binaries
wget https://binaries.tonlabs.io/tonclient_1_linux.gz -O $EVER_SDK_INSTALLATION_PATH/libton_client.so.gz
# extract binaries
gzip -d $EVER_SDK_INSTALLATION_PATH/libton_client.so.gz
# make extracted file executable
chmod +x $EVER_SDK_INSTALLATION_PATH/libton_client.so

# Better to add this to ~/.bashrc or ~/.zshrc to DRY in terminal each time you use it
export LD_LIBRARY_PATH=$EVER_SDK_INSTALLATION_PATH:$LD_LIBRARY_PATH
export CGO_LDFLAGS="-L$EVER_SDK_INSTALLATION_PATH -lton_client"

Run

One needs to specify compiled DLL directory path:

export CGO_LDFLAGS="-L$EVER_SDK_INSTALLATION_PATH -lton_client"
go build ./cmd/cli
go run ./cmd/cli
# or
task run

On Linux one needs to provide search path for DLL loader:

export LD_LIBRARY_PATH=$EVER_SDK_INSTALLATION_PATH:$LD_LIBRARY_PATH

Wrapper usage

For examples see cmd/cli/main.go and run it via go run ./cmd/cli. This wrapper covers 100% of functionality for EVER-SDK. All non-generated code has test coverage at least of 70% - one can see it via task coverage.

Tests

export CGO_LDFLAGS="-L$EVER_SDK_INSTALLATION_PATH -lton_client"
docker run -d --name local-node -p80:80 tonlabs/local-node:0.39.0
task test # tests without node
task full_test # tests including with node
task coverage # full_test with coverage

Development

You need to install:

See available task commands via task without arguments. To attach git hooks run task attach_hooks

Code generation

Most of the code is generated via script in ./cmd/gen/gen.go from spec api-spec.json one can regenerate it via task generate.

Useful reading

Methods and types with manual implementation

See more at spec/types.go

  • processing.send_message
  • processing.wait_for_transaction
  • processing.process_message
  • net.subscribe_collection

everscale-client-go's People

Contributors

risentveber avatar samorodkin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.