blockstack

package
v0.0.0-...-1f897c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2018 License: GPL-3.0 Imports: 6 Imported by: 5

README

Blockstack Core RPC Client

This is an implementation of the blockstack-core RPC protocol in Golang. To use it in your project import github.com/blockstack/blockstack.go/blockstack

RPC Implementation status

The following RPC methods are supported:

  • ping
  • getinfo
  • get_zonefiles_by_block
  • get_name_blockchain_record
  • get_name_history_blocks
  • get_name_at
  • get_names_owned_by_address
  • get_name_cost
  • get_namespace_cost
  • get_num_names
  • get_all_names
  • get_all_namespaces
  • get_names_in_namespace
  • get_num_names_in_namespace
  • get_consensus_at
  • get_block_from_consensus
  • get_atlas_peers
  • get_zonefile_inventory
  • get_namespace_blockchain_record
  • get_nameops_hash_at
  • get_op_history_rows
  • get_num_op_history_rows
  • get_num_nameops_affected_at
  • get_consensus_hashes
  • get_nameops_affected_at

The following methods have not been implemented:

  • get_mutable_data
  • get_immutable_data
  • put_mutable_data
  • get_last_nameops
  • get_data_servers
  • get_all_neighbor_info

The following methods don't appear to be implemented

  • get_zonefiles_by_names

Documentation

Index

Constants

View Source
const StartBlock = 373601

StartBlock is the first block on the bitcoin blockchain with blockstack transactions

Variables

This section is empty.

Functions

func ValidClients

func ValidClients(urls []string) ([]*Client, []Error)

ValidClients takes an array of strings and returns a *Client for Each valid URL that is in consensus with the others

Types

type CallError

type CallError struct {
	RPC string `json:"rpc_method"`
	Err error  `json:"error"`
}

CallError represents an error resulting from a failed RPC call

func (CallError) Error

func (err CallError) Error() string

Error satisfies the error interface

func (CallError) JSON

func (err CallError) JSON() string

JSON allows for easy Marshal

func (CallError) PrettyJSON

func (err CallError) PrettyJSON() string

PrettyJSON allows for easy Marshal

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the exportable object that the RPC methods are defined on

func NewClient

func NewClient(conf ServerConfig) *Client

NewClient creates a new instance of the blockstack-core rpc client

func (*Client) GetAllNames

func (bsk *Client) GetAllNames(offset, count int) (GetAllNamesResult, Error)

GetAllNames calls the get_all_names RPC method for blockstack server

func (*Client) GetAllNamespaces

func (bsk *Client) GetAllNamespaces() (GetAllNamespacesResult, Error)

GetAllNamespaces calls the get_all_namespaces RPC method for blockstack server

func (*Client) GetAtlasPeers

func (bsk *Client) GetAtlasPeers() (GetAtlasPeersResult, Error)

GetAtlasPeers calls the get_atlas_peers RPC method for blockstack server

func (*Client) GetBlockFromConsensus

func (bsk *Client) GetBlockFromConsensus(consensusHash string) (GetBlockFromConsensusResult, Error)

GetBlockFromConsensus calls the get_block_from_consensus RPC method for blockstack server

func (*Client) GetConsensusAt

func (bsk *Client) GetConsensusAt(blockHeight int) (GetConsensusAtResult, Error)

GetConsensusAt calls the get_consensus_at RPC method for blockstack server

func (*Client) GetConsensusHashes

func (bsk *Client) GetConsensusHashes(blocks []int) (GetConsensusHashesResult, Error)

GetConsensusHashes calls the get_consensus_hashes RPC method for blockstack server

func (*Client) GetInfo

func (bsk *Client) GetInfo() (GetInfoResult, Error)

GetInfo calls the getinfo RPC method for blockstack server

func (*Client) GetNameAt

func (bsk *Client) GetNameAt(name string, blockHeight int) (GetNameAtResult, Error)

GetNameAt calls the get_name_at RPC method for blockstack server

func (*Client) GetNameBlockchainRecord

func (bsk *Client) GetNameBlockchainRecord(name string) (GetNameBlockchainRecordResult, Error)

GetNameBlockchainRecord calls the get_name_blockchain_record RPC method for blockstack server

func (*Client) GetNameCost

func (bsk *Client) GetNameCost(name string) (GetNameCostResult, Error)

GetNameCost calls the get_name_cost RPC method for blockstack server

func (*Client) GetNameHistoryBlocks

func (bsk *Client) GetNameHistoryBlocks(name string) (GetNameHistoryBlocksResult, Error)

GetNameHistoryBlocks calls the get_name_history_blocks RPC method for blockstack server

func (*Client) GetNameOpsAffectedAt

func (bsk *Client) GetNameOpsAffectedAt(blockID, offset, count int) (GetNameOpsAffectedAtResult, Error)

GetNameOpsAffectedAt calls the get_nameops_affected_at RPC method for blockstack server

func (*Client) GetNameOpsHashAt

func (bsk *Client) GetNameOpsHashAt(blockHeight int) (GetNameOpsHashAtResult, Error)

GetNameOpsHashAt calls the get_nameops_hash_at RPC method for blockstack server

func (*Client) GetNamesInNamespace

func (bsk *Client) GetNamesInNamespace(ns string, offset int, count int) (GetNamesInNamespaceResult, Error)

GetNamesInNamespace calls the get_names_in_namespace RPC method for blockstack server

func (*Client) GetNamesOwnedByAddress

func (bsk *Client) GetNamesOwnedByAddress(address string) (GetNamesOwnedByAddressResult, Error)

GetNamesOwnedByAddress calls the get_names_owned_by_address RPC method for blockstack server

func (*Client) GetNamespaceBlockchainRecord

func (bsk *Client) GetNamespaceBlockchainRecord(namespace string) (GetNamespaceBlockchainRecordResult, Error)

GetNamespaceBlockchainRecord calls the get_namespace_blockchain_record RPC method for blockstack server

func (*Client) GetNamespaceCost

func (bsk *Client) GetNamespaceCost(namespace string) (GetNamespaceCostResult, Error)

GetNamespaceCost calls the get_namespace_cost RPC method for blockstack server

func (*Client) GetNumNameOpsAffectedAt

func (bsk *Client) GetNumNameOpsAffectedAt(blockID int) (CountResult, Error)

GetNumNameOpsAffectedAt calls the get_num_nameops_affected_at RPC method for blockstack server

func (*Client) GetNumNames

func (bsk *Client) GetNumNames() (CountResult, Error)

GetNumNames calls the get_num_names RPC method for blockstack server

func (*Client) GetNumNamesInNamespace

func (bsk *Client) GetNumNamesInNamespace(namespace string) (CountResult, Error)

GetNumNamesInNamespace calls the get_num_names_in_namespace RPC method for blockstack server

func (*Client) GetNumOpHistoryRows

func (bsk *Client) GetNumOpHistoryRows(historyID string) (CountResult, Error)

GetNumOpHistoryRows calls the get_num_op_history_rows RPC method for blockstack server

func (*Client) GetOpHistoryRows

func (bsk *Client) GetOpHistoryRows(historyID string, offset int, count int) (GetOpHistoryRowsResult, Error)

GetOpHistoryRows calls the get_op_history_rows RPC method for blockstack server

func (*Client) GetZonefileInventory

func (bsk *Client) GetZonefileInventory(offset, length int) (GetZonefileInventoryResult, Error)

GetZonefileInventory calls the get_zonefile_inventory RPC method for blockstack server

func (*Client) GetZonefiles

func (bsk *Client) GetZonefiles(zonefiles []string) (GetZonefilesResult, Error)

GetZonefiles calls the get_zonefiles RPC method for blockstack server

func (*Client) GetZonefilesByBlock

func (bsk *Client) GetZonefilesByBlock(startBlock, endBlock, offset, count int) (GetZonefilesByBlockResult, Error)

GetZonefilesByBlock calls the get_zonefiles_by_block RPC method for blockstack server

func (*Client) Ping

func (bsk *Client) Ping() (PingResult, Error)

Ping calls the ping RPC method for blockstack server

func (*Client) TestMethod

func (bsk *Client) TestMethod(methodName string, args []interface{}) string

TestMethod calls an RPC method with the given args

type ClientRegistrationError

type ClientRegistrationError struct {
	URL string `json:"url"`
	Err string `json:"error"`
}

ClientRegistrationError represents an error resulting from a failed RPC call

func (ClientRegistrationError) Error

func (err ClientRegistrationError) Error() string

Error satisfies the error interface

func (ClientRegistrationError) JSON

func (err ClientRegistrationError) JSON() string

JSON allows for easy Marshal

func (ClientRegistrationError) PrettyJSON

func (err ClientRegistrationError) PrettyJSON() string

PrettyJSON allows for easy Marshal

type Clients

type Clients []*Client

Clients is a collection of clients

type CountResult

type CountResult struct {
	Status    bool `json:"status"`
	Count     int  `json:"count"`
	Lastblock int  `json:"lastblock"`
	Indexing  bool `json:"indexing"`
}

CountResult is the go represenation of the get_num_names, get_num_names_in_namespace, get_num_nameops_affected_at, get_num_op_history_rows rpc methods

func (CountResult) JSON

func (r CountResult) JSON() string

JSON returns the JSON representation of CountResult

func (CountResult) PrettyJSON

func (r CountResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of CountResult

type Error

type Error interface {
	Error() string
	JSON() string
	PrettyJSON() string
}

Error models an error coming out of the blockstack lib.

type GetAllNamesResult

type GetAllNamesResult struct {
	Status    bool     `json:"status"`
	Lastblock int      `json:"lastblock"`
	Indexing  bool     `json:"indexing"`
	Names     []string `json:"names"`
}

GetAllNamesResult is the go represenation of the get_all_names method

func (GetAllNamesResult) JSON

func (r GetAllNamesResult) JSON() string

JSON returns the JSON representation of GetAllNamesResult

func (GetAllNamesResult) PrettyJSON

func (r GetAllNamesResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetAllNamesResult

type GetAllNamespacesResult

type GetAllNamespacesResult struct {
	Status     bool     `json:"status"`
	Lastblock  int      `json:"lastblock"`
	Indexing   bool     `json:"indexing"`
	Namespaces []string `json:"namespaces"`
}

GetAllNamespacesResult is the go represenation of the get_all_namespaces method

func (GetAllNamespacesResult) JSON

func (r GetAllNamespacesResult) JSON() string

JSON returns the JSON representation of GetAllNamespacesResult

func (GetAllNamespacesResult) PrettyJSON

func (r GetAllNamespacesResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetAllNamespacesResult

type GetAtlasPeersResult

type GetAtlasPeersResult struct {
	Status    bool     `json:"status"`
	Lastblock int      `json:"lastblock"`
	Indexing  bool     `json:"indexing"`
	Peers     []string `json:"peers"`
}

GetAtlasPeersResult is the go represenation of the get_atlas_peers rpc method

func (GetAtlasPeersResult) JSON

func (r GetAtlasPeersResult) JSON() string

JSON returns the JSON representation of GetAtlasPeersResult

func (GetAtlasPeersResult) PrettyJSON

func (r GetAtlasPeersResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetAtlasPeersResult

type GetBlockFromConsensusResult

type GetBlockFromConsensusResult struct {
	Status    bool `json:"status"`
	Lastblock int  `json:"lastblock"`
	Indexing  bool `json:"indexing"`
	BlockID   int  `json:"block_id"`
}

GetBlockFromConsensusResult is the go represenation of the get_block_from_consensus method

func (GetBlockFromConsensusResult) JSON

JSON returns the JSON representation of GetBlockFromConsensusResult

func (GetBlockFromConsensusResult) PrettyJSON

func (r GetBlockFromConsensusResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetBlockFromConsensusResult

type GetConsensusAtResult

type GetConsensusAtResult struct {
	Status    bool   `json:"status"`
	Consensus string `json:"consensus"`
	Lastblock int    `json:"lastblock"`
	Indexing  bool   `json:"indexing"`
}

GetConsensusAtResult is the go represenation of the get_consensus_at method

func (GetConsensusAtResult) JSON

func (r GetConsensusAtResult) JSON() string

JSON returns the JSON representation of GetConsensusAtResult

func (GetConsensusAtResult) PrettyJSON

func (r GetConsensusAtResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetConsensusAtResult

type GetConsensusHashesResult

type GetConsensusHashesResult struct {
	Status          bool           `json:"status"`
	ConsensusHashes map[int]string `json:"consensus_hashes"`
	Lastblock       int            `json:"lastblock"`
	Indexing        bool           `json:"indexing"`
}

GetConsensusHashesResult is the go representation of the get_consensus_hashes rpc method

func (GetConsensusHashesResult) JSON

JSON returns the JSON representation of GetConsensusHashesResult

func (GetConsensusHashesResult) PrettyJSON

func (r GetConsensusHashesResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetConsensusHashesResult

type GetInfoResult

type GetInfoResult struct {
	ServerAlive        bool   `json:"server_alive"`
	ZonefileCount      int    `json:"zonefile_count"`
	LastBlockProcessed int    `json:"last_block_processed"`
	Indexing           bool   `json:"indexing"`
	Consensus          string `json:"consensus"`
	LastBlockSeen      int    `json:"last_block_seen"`
	ServerVersion      string `json:"server_version"`
}

GetInfoResult is the go represenation of the getinfo rpc method

func (GetInfoResult) JSON

func (r GetInfoResult) JSON() string

JSON returns the JSON representation of GetInfoResult

func (GetInfoResult) PrettyJSON

func (r GetInfoResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetInfoResult

type GetNameAtResult

type GetNameAtResult struct {
	Status  bool `json:"status"`
	Records []struct {
		BlockNumber          int         `json:"block_number"`
		NamespaceID          string      `json:"namespace_id"`
		ImporterAddress      string      `json:"importer_address"`
		ValueHash            string      `json:"value_hash"`
		ConsensusHash        string      `json:"consensus_hash"`
		Txid                 string      `json:"txid"`
		Importer             string      `json:"importer"`
		NameHash128          string      `json:"name_hash128"`
		TransferSendBlockID  interface{} `json:"transfer_send_block_id"`
		PreorderHash         string      `json:"preorder_hash"`
		FirstRegistered      int         `json:"first_registered"`
		LastCreationOp       string      `json:"last_creation_op"`
		Name                 string      `json:"name"`
		NamespaceBlockNumber int         `json:"namespace_block_number"`
		Address              string      `json:"address"`
		OpFee                int         `json:"op_fee"`
		Revoked              bool        `json:"revoked"`
		LastRenewed          int         `json:"last_renewed"`
		Sender               string      `json:"sender"`
		SenderPubkey         string      `json:"sender_pubkey"`
		PreorderBlockNumber  int         `json:"preorder_block_number"`
		Opcode               string      `json:"opcode"`
		Op                   string      `json:"op"`
		Vtxindex             int         `json:"vtxindex"`
	} `json:"records"`
	Lastblock int  `json:"lastblock"`
	Indexing  bool `json:"indexing"`
}

GetNameAtResult is the go represenation of the get_name_at method

func (GetNameAtResult) JSON

func (r GetNameAtResult) JSON() string

JSON returns the JSON representation of GetNameAtResult

func (GetNameAtResult) PrettyJSON

func (r GetNameAtResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNameAtResult

type GetNameBlockchainRecordResult

type GetNameBlockchainRecordResult struct {
	Status bool `json:"status"`
	Record struct {
		RenewalDeadline      int                   `json:"renewal_deadline"`
		BlockNumber          int                   `json:"block_number"`
		LastCreationOp       string                `json:"last_creation_op"`
		NamespaceID          string                `json:"namespace_id"`
		NamespaceBlockNumber int                   `json:"namespace_block_number"`
		ExpireBlock          int                   `json:"expire_block"`
		Address              string                `json:"address"`
		ImporterAddress      string                `json:"importer_address"`
		Expired              bool                  `json:"expired"`
		TransferSendBlockID  interface{}           `json:"transfer_send_block_id"`
		Sender               string                `json:"sender"`
		ValueHash            string                `json:"value_hash"`
		LastRenewed          int                   `json:"last_renewed"`
		Name                 string                `json:"name"`
		Revoked              bool                  `json:"revoked"`
		ConsensusHash        string                `json:"consensus_hash"`
		PreorderBlockNumber  int                   `json:"preorder_block_number"`
		Txid                 string                `json:"txid"`
		Importer             string                `json:"importer"`
		NameHash128          string                `json:"name_hash128"`
		Opcode               string                `json:"opcode"`
		OpFee                int                   `json:"op_fee"`
		SenderPubkey         string                `json:"sender_pubkey"`
		PreorderHash         string                `json:"preorder_hash"`
		History              map[int][]Transaction `json:"history"`
	}
	Lastblock int  `json:"lastblock"`
	Indexing  bool `json:"indexing"`
}

GetNameBlockchainRecordResult needs testing rpc method get_name_blockchain_record

func (GetNameBlockchainRecordResult) JSON

JSON returns the JSON representation of GetNameBlockchainRecordResult

func (GetNameBlockchainRecordResult) LastTx

LastTx returns the last transcation from the history

func (GetNameBlockchainRecordResult) PrettyJSON

func (r GetNameBlockchainRecordResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNameBlockchainRecordResult

type GetNameCostResult

type GetNameCostResult struct {
	Status    bool `json:"status"`
	Lastblock int  `json:"lastblock"`
	Indexing  bool `json:"indexing"`
	Satoshis  int  `json:"satoshis"`
}

GetNameCostResult is the go represenation of the get_name_cost method

func (GetNameCostResult) JSON

func (r GetNameCostResult) JSON() string

JSON returns the JSON representation of GetNameCostResult

func (GetNameCostResult) PrettyJSON

func (r GetNameCostResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNameCostResult

type GetNameHistoryBlocksResult

type GetNameHistoryBlocksResult struct {
	Status        bool  `json:"status"`
	Lastblock     int   `json:"lastblock"`
	Indexing      bool  `json:"indexing"`
	HistoryBlocks []int `json:"history_blocks"`
}

GetNameHistoryBlocksResult is the go represenation of the get_name_history_blocks method

func (GetNameHistoryBlocksResult) JSON

JSON returns the JSON representation of GetNameHistoryBlocksResult

func (GetNameHistoryBlocksResult) PrettyJSON

func (r GetNameHistoryBlocksResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNameHistoryBlocksResult

type GetNameOpsAffectedAtResult

type GetNameOpsAffectedAtResult struct {
	Status    bool          `json:"status"`
	Nameops   []Transaction `json:"nameops"`
	Lastblock int           `json:"lastblock"`
	Indexing  bool          `json:"indexing"`
}

GetNameOpsAffectedAtResult is the go represenation of the get_nameops_affected_at rpc method

func (GetNameOpsAffectedAtResult) JSON

JSON returns the JSON representation of GetNameOpsAffectedAtResult

func (GetNameOpsAffectedAtResult) PrettyJSON

func (r GetNameOpsAffectedAtResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNameOpsAffectedAtResult

type GetNameOpsHashAtResult

type GetNameOpsHashAtResult struct {
	Status    bool   `json:"status"`
	Lastblock int    `json:"lastblock"`
	Indexing  bool   `json:"indexing"`
	OpsHash   string `json:"ops_hash"`
}

GetNameOpsHashAtResult is the go represenation of the get_nameops_hash_at rpc method

func (GetNameOpsHashAtResult) JSON

func (r GetNameOpsHashAtResult) JSON() string

JSON returns the JSON representation of GetNameOpsHashAtResult

func (GetNameOpsHashAtResult) PrettyJSON

func (r GetNameOpsHashAtResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNameOpsHashAtResult

type GetNamesInNamespaceResult

type GetNamesInNamespaceResult struct {
	Status    bool     `json:"status"`
	Lastblock int      `json:"lastblock"`
	Indexing  bool     `json:"indexing"`
	Names     []string `json:"names"`
}

GetNamesInNamespaceResult is the go represenation of the get_names_in_namespace rpc method

func (GetNamesInNamespaceResult) JSON

JSON returns the JSON representation of GetNamesInNamespaceResult

func (GetNamesInNamespaceResult) PrettyJSON

func (r GetNamesInNamespaceResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNamesInNamespaceResult

type GetNamesOwnedByAddressResult

type GetNamesOwnedByAddressResult struct {
	Status    bool     `json:"status"`
	Lastblock int      `json:"lastblock"`
	Indexing  bool     `json:"indexing"`
	Names     []string `json:"names"`
}

GetNamesOwnedByAddressResult is the go represenation of the get_names_owned_by_address method

func (GetNamesOwnedByAddressResult) JSON

JSON returns the JSON representation of GetNamesOwnedByAddressResult

func (GetNamesOwnedByAddressResult) PrettyJSON

func (r GetNamesOwnedByAddressResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNamesOwnedByAddressResult

type GetNamespaceBlockchainRecordResult

type GetNamespaceBlockchainRecordResult struct {
	Status bool `json:"status"`
	Record struct {
		BlockNumber      int                            `json:"block_number"`
		NonalphaDiscount int                            `json:"nonalpha_discount"`
		NamespaceID      string                         `json:"namespace_id"`
		RevealBlock      int                            `json:"reveal_block"`
		Buckets          []int                          `json:"buckets"`
		Base             int                            `json:"base"`
		Address          string                         `json:"address"`
		Ready            bool                           `json:"ready"`
		Lifetime         int                            `json:"lifetime"`
		Recipient        string                         `json:"recipient"`
		OpFee            int64                          `json:"op_fee"`
		Sender           string                         `json:"sender"`
		RecipientAddress string                         `json:"recipient_address"`
		SenderPubkey     string                         `json:"sender_pubkey"`
		ReadyBlock       int                            `json:"ready_block"`
		Coeff            int                            `json:"coeff"`
		Txid             string                         `json:"txid"`
		Version          int                            `json:"version"`
		Opcode           string                         `json:"opcode"`
		NoVowelDiscount  int                            `json:"no_vowel_discount"`
		PreorderHash     string                         `json:"preorder_hash"`
		History          map[int][]NamespaceTransaction `json:"history"`
		Vtxindex         int                            `json:"vtxindex"`
		Op               string                         `json:"op"`
	} `json:"record"`
	Lastblock int  `json:"lastblock"`
	Indexing  bool `json:"indexing"`
}

GetNamespaceBlockchainRecordResult is the go represenation of the get_namespace_blockchain_record rpc method

func (GetNamespaceBlockchainRecordResult) JSON

JSON returns the JSON representation of GetNamespaceBlockchainRecordResult

func (GetNamespaceBlockchainRecordResult) PrettyJSON

PrettyJSON returns the Pretty Printed JSON representation of GetNamespaceBlockchainRecordResult

type GetNamespaceCostResult

type GetNamespaceCostResult struct {
	Status    bool `json:"status"`
	Lastblock int  `json:"lastblock"`
	Indexing  bool `json:"indexing"`
	Satoshis  int  `json:"satoshis"`
}

GetNamespaceCostResult is the go represenation of the get_name_cost method

func (GetNamespaceCostResult) JSON

func (r GetNamespaceCostResult) JSON() string

JSON returns the JSON representation of GetNamespaceCostResult

func (GetNamespaceCostResult) PrettyJSON

func (r GetNamespaceCostResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetNamespaceCostResult

type GetOpHistoryRowsResult

type GetOpHistoryRowsResult struct {
	Status      bool `json:"status"`
	HistoryRows []struct {
		BlockID     int    `json:"block_id"`
		Op          string `json:"op"`
		HistoryID   string `json:"history_id"`
		HistoryData string `json:"history_data"`
		Vtxindex    int    `json:"vtxindex"`
		Txid        string `json:"txid"`
	} `json:"history_rows"`
	Lastblock int  `json:"lastblock"`
	Indexing  bool `json:"indexing"`
}

GetOpHistoryRowsResult is the go represenation of the get_zonfiles rpc method NOTE: The HistoryData field is a Transaction, but the JSON is returned from blockstack-core escaped TODO: Get this fixed server-side

func (GetOpHistoryRowsResult) JSON

func (r GetOpHistoryRowsResult) JSON() string

JSON returns the JSON representation of GetOpHistoryRowsResult

func (GetOpHistoryRowsResult) PrettyJSON

func (r GetOpHistoryRowsResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetOpHistoryRowsResult

type GetZonefileInventoryResult

type GetZonefileInventoryResult struct {
	Status    bool   `json:"status"`
	Lastblock int    `json:"lastblock"`
	Indexing  bool   `json:"indexing"`
	Inv       string `json:"inv"`
}

GetZonefileInventoryResult is the go represenation of the get_zonefile_inventory rpc method

func (GetZonefileInventoryResult) JSON

JSON returns the JSON representation of GetZonefileInventoryResult

func (GetZonefileInventoryResult) PrettyJSON

func (r GetZonefileInventoryResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetZonefileInventoryResult

type GetZonefilesByBlockResult

type GetZonefilesByBlockResult struct {
	Status       bool                 `json:"status"`
	Lastblock    int                  `json:"lastblock"`
	Indexing     bool                 `json:"indexing"`
	ZonefileInfo []ZonefileHashResult `json:"zonefile_info"`
}

GetZonefilesByBlockResult is the go represenation of the get_zonefiles_by_block rpc method

func (GetZonefilesByBlockResult) JSON

JSON returns the JSON representation of GetZonefilesByBlockResult

func (GetZonefilesByBlockResult) PrettyJSON

func (r GetZonefilesByBlockResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetZonefilesByBlockResult

func (GetZonefilesByBlockResult) Zonefiles

func (r GetZonefilesByBlockResult) Zonefiles() []string

Zonefiles is an affordance to return the zonefile hashes in []string

type GetZonefilesResult

type GetZonefilesResult struct {
	Status    bool              `json:"status"`
	Lastblock int               `json:"lastblock"`
	Indexing  bool              `json:"indexing"`
	Zonefiles map[string]string `json:"zonefiles"`
}

GetZonefilesResult is the go represenation of the get_zonfiles rpc method

func (GetZonefilesResult) Decode

func (r GetZonefilesResult) Decode() map[string]string

Decode is an affordance that returns the results in map[zonefileHash]zonefile

func (GetZonefilesResult) JSON

func (r GetZonefilesResult) JSON() string

JSON returns the JSON representation of GetZonefilesResult

func (GetZonefilesResult) PrettyJSON

func (r GetZonefilesResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of GetZonefilesResult

type JSONUnmarshalError

type JSONUnmarshalError struct {
	RPC string `json:"rpc_method"`
	Err error  `json:"error"`
}

JSONUnmarshalError represents an error resulting from a failed RPC call

func (JSONUnmarshalError) Error

func (err JSONUnmarshalError) Error() string

Error satisfies the error interface

func (JSONUnmarshalError) JSON

func (err JSONUnmarshalError) JSON() string

JSON allows for easy Marshal

func (JSONUnmarshalError) PrettyJSON

func (err JSONUnmarshalError) PrettyJSON() string

PrettyJSON allows for easy Marshal

type NamespaceTransaction

type NamespaceTransaction struct {
	Address          string `json:"address"`
	Base             int    `json:"base"`
	BlockNumber      int    `json:"block_number"`
	Buckets          []int  `json:"buckets"`
	BurnAddress      string `json:"burn_address"`
	Coeff            int    `json:"coeff"`
	ConsensusHash    string `json:"consensus_hash"`
	HistorySnapshot  bool   `json:"history_snapshot"`
	Lifetime         int    `json:"lifetime"`
	NamespaceID      string `json:"namespace_id"`
	NonalphaDiscount int    `json:"nonalpha_discount"`
	NoVowelDiscount  int    `json:"no_vowel_discount"`
	Op               string `json:"op"`
	Opcode           string `json:"opcode"`
	OpFee            int64  `json:"op_fee"`
	PreorderHash     string `json:"preorder_hash"`
	Recipient        string `json:"recipient"`
	RecipientAddress string `json:"recipient_address"`
	RevealBlock      int    `json:"reveal_block"`
	Sender           string `json:"sender"`
	SenderPubkey     string `json:"sender_pubkey"`
	Txid             string `json:"txid"`
	Version          int    `json:"version"`
	Vtxindex         int    `json:"vtxindex"`
}

NamespaceTransaction is used to decode the get_namespace_blockchain_record return

func (NamespaceTransaction) JSON

func (r NamespaceTransaction) JSON() string

JSON returns the JSON representation of Transaction

func (NamespaceTransaction) PrettyJSON

func (r NamespaceTransaction) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of Transaction

type PingResult

type PingResult struct {
	Status string `json:"status"`
}

PingResult is the go represenation of the ping rpc method

func (PingResult) JSON

func (r PingResult) JSON() string

JSON returns the JSON representation of PingResult

func (PingResult) PrettyJSON

func (r PingResult) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of PingResult

type RPCError

type RPCError struct {
	Err       string   `json:"error"`
	RPC       string   `json:"rpc_method"`
	Traceback []string `json:"traceback"`
}

RPCError wraps errors returned by the blockstack-core node

func (RPCError) Error

func (err RPCError) Error() string

Error satisfies the error interface

func (RPCError) JSON

func (err RPCError) JSON() string

JSON allows for easy Marshal

func (RPCError) PrettyJSON

func (err RPCError) PrettyJSON() string

PrettyJSON allows for easy Marshal

type Response

type Response interface {
	JSON() string
	PrettyJSON() string
}

Response is an interface to allow for common methods between responses

type ServerConfig

type ServerConfig struct {
	Address string `json:"address" yaml:"address"`
	Port    string `json:"port" yaml:"port"`
	Scheme  string `json:"scheme" yaml:"scheme"`
}

ServerConfig is connection details for an indivdual blockstack-core node

func (ServerConfig) String

func (s ServerConfig) String() string

type ServerConfigs

type ServerConfigs []ServerConfig

ServerConfigs is a type to hold multiple ServerConfig

type Transaction

type Transaction struct {
	ValueHash            string  `json:"value_hash"`
	LastRenewed          int     `json:"last_renewed"`
	LastCreationOp       string  `json:"last_creation_op"`
	Revoked              bool    `json:"revoked"`
	SenderPubkey         string  `json:"sender_pubkey"`
	BlockNumber          int     `json:"block_number"`
	ConsensusHash        string  `json:"consensus_hash"`
	NamespaceBlockNumber int     `json:"namespace_block_number"`
	PreorderBlockNumber  int     `json:"preorder_block_number"`
	Vtxindex             int     `json:"vtxindex"`
	Op                   string  `json:"op"`
	Txid                 string  `json:"txid"`
	Importer             string  `json:"importer"`
	Opcode               string  `json:"opcode"`
	OpFee                float64 `json:"op_fee"`
	Address              string  `json:"address"`
	PreorderHash         string  `json:"preorder_hash"`
	ImporterAddress      string  `json:"importer_address"`
	FirstRegistered      int     `json:"first_registered"`
	TransferSendBlockID  int     `json:"transfer_send_block_id"`
	Sender               string  `json:"sender"`
}

Transaction models a Bitcoin Transaction for various structs here

func (Transaction) JSON

func (r Transaction) JSON() string

JSON returns the JSON representation of Transaction

func (Transaction) PrettyJSON

func (r Transaction) PrettyJSON() string

PrettyJSON returns the Pretty Printed JSON representation of Transaction

type ZonefileHashResult

type ZonefileHashResult struct {
	Txid         string `json:"txid"`
	Name         string `json:"name"`
	ZonefileHash string `json:"zonefile_hash"`
	BlockHeight  int    `json:"block_height"`
}

ZonefileHashResult is a go represenation of a zonefile_hash_result

type ZonefileHashResults

type ZonefileHashResults []ZonefileHashResult

ZonefileHashResults is a collection of ZonefileHashResult

func (ZonefileHashResults) LatestZonefileHash

func (zfhr ZonefileHashResults) LatestZonefileHash(zonefileHash string) ZonefileHashResult

LatestZonefileHash returns the latest zonefile from a batch for a given zonefileHash

func (ZonefileHashResults) Zonefiles

func (zfhr ZonefileHashResults) Zonefiles() []string

Zonefiles returns zonefiles from a ZonefileHashResults

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL