Skip to content

stratumfarm/go-miningcore-client

Repository files navigation

go-miningcore-api

testing lint GoDoc Go Report Card

About

This is a go wrapper around the miningcore api. It implements the miningcore api v2, which also returns meta object, on all available endpoints.

Install

$ go get github.com/stratumfarm/go-miningcore-client

Usage

package main

import (
	"context"
	"fmt"

	"github.com/stratumfarm/go-miningcore-client"
)

func main() {
    c := miningcore.New(
        "https://localhost:8443",
        miningcore.WithTimeout(time.Second * 5),
        miningcore.WithoutTLSVerfiy(),
    )

    pools, statusCode, err := c.GetPools(context.Background())
    if err != nil {
        fmt.Println(statusCode, err)
    }

    for _, v := range pools {
        fmt.Println(v)
    }
}