https://github.com/goat-systems/go-tezos
Go Tezos Is a Go library that exposes and builds upon the Tezos RPC.
https://github.com/goat-systems/go-tezos
Last synced: 2 months ago
JSON representation
Go Tezos Is a Go library that exposes and builds upon the Tezos RPC.
- Host: GitHub
- URL: https://github.com/goat-systems/go-tezos
- Owner: goat-systems
- License: mit
- Created: 2018-07-18T23:59:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T23:23:44.000Z (over 2 years ago)
- Last Synced: 2024-08-01T22:43:44.011Z (11 months ago)
- Language: Go
- Homepage:
- Size: 1.63 MB
- Stars: 71
- Watchers: 5
- Forks: 45
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-tezos - go-tezos
README
[](https://godoc.org/github.com/goat-systems/go-tezos/v4)
# A Tezos Go LibraryGo Tezos is a GoLang driven library for your Tezos node. This library has received a grant from the Tezos Foundation to ensure it's continuous development through 2020.
## Installation
Get GoTezos
```
go get github.com/goat-systems/go-tezos/v4
```### Getting A Block
```
package mainimport (
"fmt"
goTezos "github.com/goat-systems/go-tezos/v4/rpc"
)func main() {
rpc, err := client.New("http://127.0.0.1:8732")
if err != nil {
fmt.Printf("failed tp connect to network: %v", err)
}resp, head, err := client.Block(&rpc.BlockIDHead{})
if err != nil {
fmt.Printf("failed to get (%s) head block: %s\n", resp.Status(), err.Error())
os.Exit(1)
}
fmt.Println(block)
}
```### Getting a Cycle
```
resp, cycle, err := rpc.Cycle(50)
if err != nil {
fmt.Printf("failed to get (%s) cycle: %s\n", resp.Status(), err.Error())
os.Exit(1)
}
fmt.Println(cycle)
```### More Examples
You can find more examples by looking through the unit tests and integration tests in each package. [Here](example/transaction/transaction.go) is an example on
how to forge and inject an operation.## Contributing
### The Makefile
The makefile is there as a helper to run quality code checks. To run vet and staticchecks please run:
```
make checks
```## Contributers: A Special Thank You
* [**BrianBland**](https://github.com/BrianBland)
* [**utdrmac**](https://github.com/utdrmac)
* [**Magic_Gum**](https://github.com/fkbenjamin)
* [**Johann**](https://github.com/tulpenhaendler)
* [**leopoldjoy**](https://github.com/leopoldjoy)
* [**RomarQ**](https://github.com/RomarQ)
* [**surzm**](https://github.com/surzm)
* [**fredcy**](https://github.com/fredcy)## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details