Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge request 1.4.0 #51

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -4,7 +4,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.16.x]
go-version: [1.16.x, 1.17.x, 1.18.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -5,3 +5,5 @@ rpc/debug-utils.go
.DS_Store

solana-vault.json

.env
6 changes: 3 additions & 3 deletions README.md
@@ -1,6 +1,6 @@
# Solana SDK library for Go

[![GoDoc](https://pkg.go.dev/badge/github.com/gagliardetto/solana-go?status.svg)](https://pkg.go.dev/github.com/gagliardetto/solana-go@v1.3.0?tab=doc)
[![GoDoc](https://pkg.go.dev/badge/github.com/gagliardetto/solana-go?status.svg)](https://pkg.go.dev/github.com/gagliardetto/solana-go@v1.4.0?tab=doc)
[![GitHub tag (latest SemVer pre-release)](https://img.shields.io/github/v/tag/gagliardetto/solana-go?include_prereleases&label=release-tag)](https://github.com/gagliardetto/solana-go/releases)
[![Build Status](https://github.com/gagliardetto/solana-go/workflows/tests/badge.svg?branch=main)](https://github.com/gagliardetto/solana-go/actions?query=branch%3Amain)
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/gagliardetto/solana-go/main)](https://www.tickgit.com/browse?repo=github.com/gagliardetto/solana-go&branch=main)
Expand Down Expand Up @@ -72,7 +72,7 @@ More contracts to come.

## Current development status

There is currently **no stable release**. The SDK is actively developed and latest is `v1.3.0` which is an `alpha` release.
There is currently **no stable release**. The SDK is actively developed and latest is `v1.4.0` which is an `alpha` release.

The RPC and WS client implementation is based on [this RPC spec](https://github.com/solana-labs/solana/blob/c2435363f39723cef59b91322f3b6a815008af29/docs/src/developing/clients/jsonrpc-api.md).

Expand All @@ -90,7 +90,7 @@ Note

```bash
$ cd my-project
$ go get github.com/gagliardetto/solana-go@v1.3.0
$ go get github.com/gagliardetto/solana-go@v1.4.0
```

## Pretty-Print transactions/instructions
Expand Down
72 changes: 72 additions & 0 deletions contrib/setup.sh
@@ -0,0 +1,72 @@
#!/bin/bash

set -euxo pipefail

source $HOME/.cargo/env

decho(){
1>&2 echo $@
}


new(){
decho "setting up solana test environment on localhost"
solana-keygen new -o $KEYPAIR_FILE_PATH
solana config set --url localhost
solana config set --keypair $KEYPAIR_FILE_PATH
( ( </dev/null solana-test-validator 1>/dev/null 2>/dev/null & ) & )
sleep 3
decho "solana test validator has started"

solana airdrop 10
}

build(){
yarn
anchor build
}

deploy(){
decho "building serum program"
( cd deps/serum-dex/dex/ && cargo build-bpf )
export DEX_PID=$(solana program deploy ./deps/serum-dex/dex/target/deploy/serum_dex.so | grep Program | perl -e '$x=<STDIN>;if($x=~m#Program Id\: (\w+)#){print "$1";}else{die "no match";}' )
decho "dex id is ${DEX_PID}"
}

test(){
if [[ -z "${DEX_PID}" ]]; then
decho "DEX_PID not defined"
exit 1
fi
anchor test
}




CMD=$1

case $1 in
all)
new
deploy
build
test
;;
new)
new
;;
build)
build
;;
deploy)
deploy
;;
test)
test
;;
*)
decho "bad choice"
exit 1
;;
esac
84 changes: 61 additions & 23 deletions go.mod
@@ -1,6 +1,6 @@
module github.com/gagliardetto/solana-go

go 1.16
go 1.18

require (
github.com/gagliardetto/binary v0.6.1
Expand All @@ -9,41 +9,79 @@ require (
)

require (
contrib.go.opencensus.io/exporter/stackdriver v0.13.4 // indirect
cloud.google.com/go/compute v1.5.0 // indirect
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/daaku/go.zipexe v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/googleapis/gax-go/v2 v2.2.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/tidwall/gjson v1.14.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb // indirect
google.golang.org/grpc v1.45.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

require (
contrib.go.opencensus.io/exporter/stackdriver v0.13.10 // indirect
filippo.io/edwards25519 v1.0.0-rc.1
github.com/AlekSi/pointer v1.1.0
github.com/GeertJohan/go.rice v1.0.0
github.com/AlekSi/pointer v1.2.0
github.com/GeertJohan/go.rice v1.0.2
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59
github.com/buger/jsonparser v1.1.1
github.com/davecgh/go-spew v1.1.1
github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70
github.com/fatih/color v1.9.0
github.com/google/go-cmp v0.5.1
github.com/fatih/color v1.13.0
github.com/google/go-cmp v0.5.7
github.com/gorilla/rpc v1.2.0
github.com/gorilla/websocket v1.4.2
github.com/gorilla/websocket v1.5.0
github.com/joho/godotenv v1.4.0
github.com/json-iterator/go v1.1.12
github.com/klauspost/compress v1.13.6
github.com/klauspost/compress v1.15.1
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/magiconair/properties v1.8.1
github.com/magiconair/properties v1.8.6
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1
github.com/mr-tron/base58 v1.2.0
github.com/onsi/gomega v1.10.1
github.com/pkg/errors v0.9.1
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f
github.com/spf13/cobra v1.1.1
github.com/ryanuber/columnize v2.1.2+incompatible
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.6.1
github.com/spf13/viper v1.10.1
github.com/stretchr/testify v1.7.0
github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect
go.opencensus.io v0.22.5 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.opencensus.io v0.23.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/ratelimit v0.2.0
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect
golang.org/x/tools v0.0.0-20200601175630-2caf76543d99 // indirect
google.golang.org/api v0.29.0
go.uber.org/zap v1.21.0
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
google.golang.org/api v0.73.0
)