Skip to content

go-tezos Is a Golang library that exposes the Tezos RPC, along with some helper functions that may be used in common scenarios. It is currently under development.

License

RomarQ/go-tezos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

A Tezos Go Library

Go 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/romarq/go-tezos/v4

Getting A Block

package main

import (
	"fmt"
	goTezos "github.com/romarq/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 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

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

go-tezos Is a Golang library that exposes the Tezos RPC, along with some helper functions that may be used in common scenarios. It is currently under development.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.8%
  • Makefile 0.2%