func (api *API) CreateSnapshot(ctx context.Context) (out *CreateSnapshotResp, err error) {
	err = api.call(ctx, "producer", "create_snapshot", nil, &out)
	return
}
CreateSnapshot will write a snapshot file on a nodeos with
`producer_api` plugin loaded.
package eos
import (
	"bytes"
	"context"
	"encoding/hex"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"log"
	"net"
	"net/http"
	"net/http/httputil"
	"strings"
	"sync"
	"time"
	"github.com/eoscanada/eos-go/ecc"
)
type API struct {
	HttpClient *http.Client
	BaseURL    string
	Signer     Signer
	Debug      bool
	Compress   CompressionType
	Header                  http.Header
	DefaultMaxCPUUsageMS    uint8
	DefaultMaxNetUsageWords uint32  
	lastGetInfo      *InfoResp
	lastGetInfoStamp time.Time
	lastGetInfoLock  sync.Mutex
	customGetRequiredKeys     func(ctx context.Context, tx *Transaction) ([]ecc.PublicKey, error)
	enablePartialRequiredKeys bool
}
func New(baseURL string) *API {
	api := &API{
		HttpClient: &http.Client{
			Transport: &http.Transport{
				Proxy: http.ProxyFromEnvironment,
				DialContext: (&net.Dialer{
					Timeout:   30 * time.Second,
					KeepAlive: 30 * time.Second,
					DualStack: true,
				}).DialContext,
				MaxIdleConns:          100,
				IdleConnTimeout:       90 * time.Second,
				TLSHandshakeTimeout:   10 * time.Second,
				ExpectContinueTimeout: 1 * time.Second,
				DisableKeepAlives:     true,  
			},
		},
		BaseURL:  strings.TrimRight(baseURL, "/"),
		Compress: CompressionZlib,
		Header:   make(http.Header),
	}
	return api
}
func (api *API) FixKeepAlives(ctx context.Context) bool {
	for i := 0; i < 5; i++ {
		_, err := api.GetInfo(ctx)
		if api.Debug {
			log.Println("err", err)
		}
		if err == io.EOF {
			if tr, ok := api.HttpClient.Transport.(*http.Transport); ok {
				tr.DisableKeepAlives = true
				return true
			}
		}
		_, err = api.GetNetConnections(ctx)
		if api.Debug {
			log.Println("err", err)
		}
		if err == io.EOF {
			if tr, ok := api.HttpClient.Transport.(*http.Transport); ok {
				tr.DisableKeepAlives = true
				return true
			}
		}
	}
	return false
}
func (api *API) EnableKeepAlives() bool {
	if tr, ok := api.HttpClient.Transport.(*http.Transport); ok {
		tr.DisableKeepAlives = false
		return true
	}
	return false
}
func (api *API) SetCustomGetRequiredKeys(f func(ctx context.Context, tx *Transaction) ([]ecc.PublicKey, error)) {
	api.customGetRequiredKeys = f
}
func (api *API) UsePartialRequiredKeys() {
	api.enablePartialRequiredKeys = true
}
func (api *API) getPartialRequiredKeys(ctx context.Context, tx *Transaction) ([]ecc.PublicKey, error) {
	var authorizers []PermissionLevel
	for _, act := range tx.Actions {
		for _, pl := range act.Authorization {
			authorizers = append(authorizers, pl)
		}
	}
	ourKeys, err := api.Signer.AvailableKeys(ctx)
	if err != nil {
		return nil, err
	}
	resp, err := api.GetAccountsByAuthorizers(ctx, authorizers, ourKeys)
	if err != nil {
		return nil, err
	}
	var out []ecc.PublicKey
	seen := make(map[string]bool)
	for _, acct := range resp.Accounts {
		if acct.AuthorizingKey == nil {
			continue
		}
		stringKey := acct.AuthorizingKey.String()
		if seen[stringKey] {
			continue
		}
		out = append(out, *acct.AuthorizingKey)
		seen[stringKey] = true
	}
	return out, nil
}
func (api *API) SetSigner(s Signer) {
	api.Signer = s
}
func (api *API) ProducerPause(ctx context.Context) error {
	return api.call(ctx, "producer", "pause", nil, nil)
}