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.
Go Makefile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
account refactor: changed the project structure Jul 27, 2019
block refactor: changed the project structure Jul 27, 2019
client refactor: changed the project structure Jul 27, 2019
contracts refactor: changed the project structure Jul 27, 2019
crypto refactor: changed the project structure Jul 27, 2019
cycle refactor: changed the project structure Jul 27, 2019
delegate refactor: changed the project structure Jul 27, 2019
network refactor: changed the project structure Jul 27, 2019
node refactor: changed the project structure Jul 27, 2019
operations refactor: changed the project structure Jul 27, 2019
snapshot refactor: changed the project structure Jul 27, 2019
vendor refactor: changed the project structure Jul 27, 2019
CHANGELOG.md refactor: changed the project structure Jul 27, 2019
Jenkinsfile Added Jenkinsfile Aug 3, 2019
LICENSE.md First Commit Jul 19, 2018
Makefile
README.md refactor: changed the project structure Jul 27, 2019
go.mod refactor: changed the project structure Jul 27, 2019
go.sum refactor: changed the project structure Jul 27, 2019
gotezos.go refactor: changed the project structure Jul 27, 2019

README.md

GoDoc

A Tezos Go Library

Go Tezos is a GoLang driven library for your Tezos node.

Installation

Get goTezos

go get github.com/DefinitelyNotAGoat/go-tezos

Quick Start

Go Tezos is split into multiple services underneath to help organize it's functionality and also makes the library easier to maintain.

To understand how Go Tezos works, take a look at the GoTezos Structure:

type GoTezos struct {
	Client    tzc.TezosClient
	Constants network.Constants
	Block     block.TezosBlockService
	Snapshot  snapshot.TezosSnapshotService
	Cycle     cycle.TezosCycleService
	Account   account.TezosAccountService
	Delegate  delegate.TezosDelegateService
	Network   network.TezosNetworkService
	Operation operations.TezosOperationsService
	Contract  contracts.TezosContractsService
	Node      node.TezosNodeService
}

You can see GoTezos is a wrapper for several services such as block, Snapshot, Cycle, Account, Delegate, Network, Operation, Node, and Contract. Each service has it's own set of functions. You can see examples of using the Block and SnapShot service below.

Getting A Block

package main

import (
	"fmt"
	goTezos "github.com/DefinitelyNotAGoat/go-tezos"
)

func main() {
	gt, err := goTezos.NewGoTezos("http://127.0.0.1:8732")
	if err != nil {
		fmt.Printf("could not connect to network: %v", err)
	}

	block, err := gt.Block.Get(1000)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(block)
}

Getting a Snapshot For A Cycle

	snapshot, err := gt.Snapshot.Get(50)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(snapshot)

More Documentation

See github pages

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

You can’t perform that action at this time.