DipDup Golang SDK

Overview

go-lib

General instruments for DipDup in golang

Packages

  • cmdline - parser for default dipdup keys
import "github.com/dipdup-net/go-lib/cmdline"

args := cmdline.Parse()
if args.Help {
	return
}
  • config
import "github.com/dipdup-net/go-lib/config"

type MyConfig struct {
	config.Config `yaml:",inline"`
    // Custom field here
    Fields Fields `yaml:"fields"`
}

// Validate - required by Configurable interface
func (c *MyConfig) Validate() error {
    return c.Fields.Validate() // if needed
}

// Substitute - required by Configurable interface
func (c *MyConfig) Substitute() error {
    return nil
}

type Fields struct {
    First string `yaml:"first"`
}

// Validate -
func (f *Fields) Validate() error {
    return nil
}

var cfg MyConfig
if err := config.Parse("config.yaml", &cfg); err != nil {
    panic(err)
}
  • node - package for accessing to tezos node
import "github.com/dipdup-net/go-lib/node"

rpc := node.NewNodeRPC(url, node.WithTimeout(timeout))
  • state - package with DipDup state model
import "github.com/dipdup-net/go-lib/state"

s := state.State{}

State structure is

// State -
type State struct {
	IndexName string `gorm:"primaryKey"`
	IndexType string
	Hash      string
	Level     uint64
}
  • tzkt - package with API and Events wrapper for TzKT.

You can find docs on Events wrapper here.

Example usage of events

package main

import (
	"log"

	"github.com/dipdup-net/go-lib/tzkt/events"
)

func main() {
	tzkt := events.NewTzKT(events.BaseURL)
	if err := tzkt.Connect(); err != nil {
		log.Panic(err)
	}
	defer tzkt.Close()

	if err := tzkt.SubscribeToBlocks(); err != nil {
		log.Panic(err)
	}

	for msg := range tzkt.Listen() {
		log.Println(msg)
	}
}

Example usage of API wrapper

package main

import (
	"log"

	"github.com/dipdup-net/go-lib/tzkt/api"
)

func main() {
    tzkt := api.New("url here")
    
    head, err := tzkt.GetHead()
    if err != nil {
        log.Panic(err)
    }
    log.Println(head)
}
Issues
Releases(v0.1.47)
Owner
DipDup
A framework for building selective Tezos indexers
DipDup
Nextengine-sdk-go: the NextEngine SDK for the Go programming language

NextEngine SDK for Go nextengine-sdk-go is the NextEngine SDK for the Go programming language. Getting Started Install go get github.com/takaaki-s/nex

null 0 Dec 7, 2021
Commercetools-go-sdk is fork of original commercetools-go-sdk

commercetools-go-sdk The Commercetools Go SDK is automatically generated based on the official API specifications of Commercetools. It should therefor

Flink 0 Dec 13, 2021
Sdk-go - Go version of the Synapse SDK

synapsesdk-go Synapse Protocol's Go SDK. Currently in super duper alpha, do not

null 0 Jan 7, 2022
A Golang SDK for Medium's OAuth2 API

Medium SDK for Go This repository contains the open source SDK for integrating Medium's OAuth2 API into your Go app. Install go get github.com/Medium/

Medium 131 Dec 30, 2021
Simple no frills AWS S3 Golang Library using REST with V4 Signing (without AWS Go SDK)

simples3 : Simple no frills AWS S3 Library using REST with V4 Signing Overview SimpleS3 is a golang library for uploading and deleting objects on S3 b

Rohan Verma 74 Jan 8, 2022
Twilight is an unofficial Golang SDK for Twilio APIs

Twilight is an unofficial Golang SDK for Twilio APIs. Twilight was born as a result of my inability to spell Twilio correctly. I searched for a Twillio Golang client library and couldn’t find any, I decided to build one. Halfway through building this, I realized I had spelled Twilio as Twillio when searching for a client library on Github.

Ghvst Code 18 Jul 2, 2021
weixin/wechat/微信公众平台/微信企业号/微信商户平台/微信支付 go/golang sdk

wechat SDK for golang https://github.com/chanxuehong/wechat 招人啦 golang 后端的坑, 趣头条集团下面的创新团队, 现在步入正常轨道了, 前景很好. 要求: golang中高级 自驱、有责任心 沟通没有问题 待遇: open, 看能力

chanxuehong 2.3k Jan 7, 2022
Confluent Golang SDK

Confluent Platform Client Maintainer: Quan Phuong [email protected] Provide Go client for Confluent platform, reference Confluent API document and C

Wayarmy 0 Oct 11, 2021
百度ai golang SDK

BauDuAi 百度人工智能模块go语言SDK,持续更新中 安装 go get github.com/iscoderLee/BaiDuAi 使用说明 使用示例(人脸检测接口) package main import ( "encoding/base64" "fmt" "github.c

coderLee 15 Nov 19, 2021
sdk for filedag in golang

FileDAG SDK Official GO SDK for FileDAG Overview The FileDAG GO SDK provides the quickest / easiest path for interacting with the FileDAG API. Install

FileDrive Team 3 Aug 18, 2021
golang sdk for BRCC ( BRCC:Better Remote Config Center)

brcc-go-sdk golang sdk for BRCC BRCC:Better Remote Config Center

Baidu 6 Dec 6, 2021
Golang SDK du Logiciel de Facturation en ligne VosFactures

Golang VosFactures Implémentation sommaire de l'API VosFactures en Golang. Ce projet n'est pas complet, il l'est suffisamment pour les fonctionnalités

Squirrel Réunion 3 Oct 15, 2021
SSL wireless Golang SDK

ssl-wireless-pgw-golang-sdk (Beta) SSLCOMMERZ is the first payment gateway in Bangladesh opening doors for merchants to receive payments on the intern

sagar 4 Nov 8, 2021
🚀 BiliBili API SDK in Golang

BiliGO BiliBili API SDK in Golang 简介 BiliBili API 的 Golang 实现,目前已经实现了 100+ API,还在进一步更新中 特性 良好的设计,支持自定义 client 与 UA 完善的单元测试,易懂的函数命名,极少的第三方库依赖 代码、结构体注释完

iyear 26 Jan 9, 2022
A Golang SDK for binance API

go-binance A Golang SDK for binance API. All the REST APIs listed in binance API document are implemented, as well as the websocket APIs. For best com

null 0 Oct 28, 2021
Zenvia API - Golang SDK

Zenvia API - Golang SDK Zenvia API (2.0) Why? This project is part of my personal portfolio, so, I'll be happy if you could provide me any feedback ab

Vinícius Boscardin 5 Nov 5, 2021
Golang SDK for Blockfrost.io

Official Blockfrost SDK Client Getting started To use this SDK, you first need to log in to blockfrost.io, create your project and retrieve the API to

blockfrost.io 7 Nov 29, 2021
Opensea SDK in Golang

go-opensea Golang library for OpenSea APIs (https://docs.opensea.io/reference). Get Started TBD Devlopment Acknowledgement This library was forked an

Guil. Sperb Machado 3 Nov 30, 2021
Inofficial SDK for gameanalytics written in Golang

gameanalytics-go gameanalytics-go is an inofficial sdk for gameanalytics which is written in go. It currently can send the following events: Business

Tobias Beck 0 Nov 21, 2021