bcclientgo

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 16 Imported by: 8

README

bcclientgo

This is a Go implementation of a BC client using the BC data structures.

About

bcclientgo provides utilities and a command line interface to explore and interact with BC.

Build

go build -tags release

Install

Install the binary (or download from https://github.com/AletheiaWareLLC/bcclientgo/releases/latest)

go install -tags release aletheiaware.com/bcclientgo/cmd/bc

Usage

$ bc
BC Usage:
    bc - display usage
    bc init - initializes environment, generates key pair, and registers alias

    bc node - display registered alias and public key
    bc alias [alias] - display public key for given alias

    bc keys - display all stored keys
    bc import-keys [alias] [access-code] - imports the alias and keypair from BC server
    bc export-keys [alias] - generates a new access code and exports the alias and keypair to BC server

    bc push [channel] - pushes the channel to peers
    bc pull [channel] - pulls the channel from peers
    bc head [channel] - display head of given channel
    bc chain [channel] - display chain of given channel
    bc block [channel] [block-hash] - display block with given hash
    bc record [channel] [record-hash] - display record with given hash

    bc read [channel] [block-hash] [record-hash]- reads entries the given channel and writes to stdout
    bc read-key [channel] [block-hash] [record-hash]- reads keys the given channel and writes to stdout
    bc read-payload [channel] [block-hash] [record-hash]- reads payloads the given channel and writes to stdout
    bc write [channel] [access...] - reads data from stdin and writes it to cache for the given channel and grants access to the given aliases
    bc mine [channel] [threshold] - mines the given channel to the given threshold

    bc peers - display list of peers
    bc add-peer [peer] - adds the given peer to the list of peers
    bc keystore - display location of keystore
    bc cache - display location of cache
    bc purge - deletes contents of cache

    bc random - generate a random number

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintNode

func PrintNode(output io.Writer, node bcgo.Node) error

Types

type BCClient

type BCClient interface {
	Root() (string, error)
	Peers() []string
	Cache() (bcgo.Cache, error)
	Network() (bcgo.Network, error)
	Node() (bcgo.Node, error)
	Init(bcgo.MiningListener) (bcgo.Node, error)
	IsSignedIn() bool
	PublicKey(string) ([]byte, cryptogo.PublicKeyFormat, error)
	Head(string) ([]byte, error)
	Chain(string, func([]byte, *bcgo.Block) error) error
	Block(string, []byte) (*bcgo.Block, error)
	Record(string, []byte) (*bcgo.Record, error)
	Read(string, []byte, []byte, io.Writer) error
	ReadKey(string, []byte, []byte, io.Writer) error
	ReadPayload(string, []byte, []byte, io.Writer) error
	Write(string, []string, io.Reader) (int, error)
	Mine(string, uint64, bcgo.MiningListener) ([]byte, error)
	Pull(string) error
	Push(string) error
	Purge() error
	ImportKeys(string, string, string) error
	ExportKeys(string, string, []byte) (string, error)
	SetRoot(string)
	SetPeers(...string)
	SetCache(bcgo.Cache)
	SetNetwork(bcgo.Network)
	SetNode(bcgo.Node)
}

func NewBCClient

func NewBCClient(peers ...string) BCClient

Directories

Path Synopsis
cmd
bc

Jump to

Keyboard shortcuts

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