Help us shape the future of Go! Take the 2026 Go Developer Survey

http

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package http implements ockam.Node interface to enable interaction with a remote node that can be commiunicated with over http.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discoverer

func Discoverer(name string, port int) ockam.NodeDiscoverer

Discoverer returns

Types

type BroadcastTxSyncResponse

type BroadcastTxSyncResponse struct {
	Result struct {
		Code int    `json:"code"`
		Data string `json:"data"`
		Log  string `json:"log"`
		Hash string `json:"hash"`
	} `json:"result"`
	Error interface{} `json:"error"`
}

BroadcastTxSyncResponse is

type CommitResponse

type CommitResponse struct {
	Error  interface{} `json:"error"`
	Result node.Commit `json:"result"`
}

CommitResponse is

type Node

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

Node represent a remote node

func NewNode

func NewNode(options ...Option) (*Node, error)

NewNode returns

func (*Node) BroadcastTxSync

func (n *Node) BroadcastTxSync(tx string) ([]byte, error)

BroadcastTxSync broadcasts a transaction

func (*Node) Call

func (n *Node) Call(q string, r interface{}) error

Call makes an RPC call

func (*Node) Chain

func (n *Node) Chain() ockam.Chain

Chain is

func (*Node) Commit

func (n *Node) Commit(height string) (*node.Commit, error)

Commit fetches the the commit at the provided height

func (*Node) ID

func (n *Node) ID() string

ID is

func (*Node) LatestBlock

func (n *Node) LatestBlock() ockam.Block

LatestBlock returns

func (*Node) LatestCommit

func (n *Node) LatestCommit() *node.Commit

LatestCommit returns

func (*Node) Peers

func (n *Node) Peers() []ockam.Node

Peers is

func (*Node) Register

func (n *Node) Register(e ockam.Entity) (ockam.Claim, error)

Register is

func (*Node) Submit

func (n *Node) Submit(cl ockam.Claim) error

Submit is

func (*Node) Sync

func (n *Node) Sync() error

Sync returns

func (*Node) Tx

func (n *Node) Tx(hash []byte) (*node.Tx, error)

Tx fetched a transaction including a proof for the transaction

type Option

type Option func(*Node)

Option is

func IP

func IP(ip string) Option

IP is

func Port

func Port(port int) Option

Port is

type TxResponse

type TxResponse struct {
	Error  interface{} `json:"error"`
	Result node.Tx     `json:"result"`
}

TxResponse is

Jump to

Keyboard shortcuts

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