factom

package module
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2016 License: MIT Imports: 13 Imported by: 0

README

factom api

golang library implementation of the Factom web service api.

Documentation

Index

Constants

View Source
const (
	ZeroHash = "0000000000000000000000000000000000000000000000000000000000000000"
)

Variables

This section is empty.

Functions

func CommitChain

func CommitChain(c *Chain, name string) error

CommitChain sends the signed ChainID, the Entry Hash, and the Entry Credit public key to the factom network. Once the payment is verified and the network is commited to publishing the Chain it may be published by revealing the First Entry in the Chain.

func CommitEntry

func CommitEntry(e *Entry, name string) error

CommitEntry sends the signed Entry Hash and the Entry Credit public key to the factom network. Once the payment is verified and the network is commited to publishing the Entry it may be published with a call to RevealEntry.

func ComposeChainCommit added in v0.3.5

func ComposeChainCommit(pub *[32]byte, pri *[64]byte, c *Chain) ([]byte, error)

func ComposeEntryCommit added in v0.3.5

func ComposeEntryCommit(pub *[32]byte, pri *[64]byte, e *Entry) ([]byte, error)

func ComposeEntryReveal added in v0.3.5

func ComposeEntryReveal(e *Entry) ([]byte, error)

func ECBalance

func ECBalance(key string) (int64, error)

func FctBalance

func FctBalance(key string) (int64, error)

func GenerateEntryCreditAddress

func GenerateEntryCreditAddress(name string) (string, error)

func GenerateEntryCreditAddressFromHumanReadablePrivateKey

func GenerateEntryCreditAddressFromHumanReadablePrivateKey(name string, privateKey string) (string, error)

func GenerateEntryCreditAddressFromPrivateKey

func GenerateEntryCreditAddressFromPrivateKey(name string, privateKey string) (string, error)

func GenerateFactoidAddress

func GenerateFactoidAddress(name string) (string, error)

func GenerateFactoidAddressFromHumanReadablePrivateKey

func GenerateFactoidAddressFromHumanReadablePrivateKey(name string, privateKey string) (string, error)

func GenerateFactoidAddressFromMnemonic

func GenerateFactoidAddressFromMnemonic(name string, mnemonic string) (string, error)

func GenerateFactoidAddressFromPrivateKey

func GenerateFactoidAddressFromPrivateKey(name string, privateKey string) (string, error)

func GetDBlockHeight

func GetDBlockHeight() (int, error)

func GetRaw

func GetRaw(keymr string) ([]byte, error)

func RevealChain

func RevealChain(c *Chain) error

func RevealEntry

func RevealEntry(e *Entry) error

func Server added in v0.3.5

func Server() string

Server() returns the global server string for debugging

func SetServer

func SetServer(s string)

SetServer sets the gloabal target for the factomd server

func SetWallet added in v0.3.5

func SetWallet(s string)

SetWallet sets the global target for the fctwallet server

Types

type Chain

type Chain struct {
	ChainID    string
	FirstEntry *Entry
}

func NewChain

func NewChain(e *Entry) *Chain

type ChainHead

type ChainHead struct {
	ChainHead string
}

func GetChainHead

func GetChainHead(chainid string) (*ChainHead, error)

type DBlock

type DBlock struct {
	DBHash string
	Header struct {
		PrevBlockKeyMR string
		Timestamp      uint64
		SequenceNumber int
	}
	EntryBlockList []struct {
		ChainID string
		KeyMR   string
	}
}

func GetDBlock

func GetDBlock(keymr string) (*DBlock, error)

func (*DBlock) String added in v0.3.4

func (d *DBlock) String() string

type DBlockHead

type DBlockHead struct {
	KeyMR string
}

func GetDBlockHead

func GetDBlockHead() (*DBlockHead, error)

type Data

type Data struct {
	Data string
}

type EBEntry

type EBEntry struct {
	Timestamp int64
	EntryHash string
}

type EBlock

type EBlock struct {
	Header struct {
		BlockSequenceNumber int
		ChainID             string
		PrevKeyMR           string
		Timestamp           uint64
	}
	EntryList []EBEntry
}

func GetEBlock

func GetEBlock(keymr string) (*EBlock, error)

func (*EBlock) String added in v0.3.4

func (e *EBlock) String() string

type Entry

type Entry struct {
	ChainID string
	ExtIDs  [][]byte
	Content []byte
}

func GetAllChainEntries added in v0.3.4

func GetAllChainEntries(chainid string) ([]*Entry, error)

func GetAllEBlockEntries added in v0.3.4

func GetAllEBlockEntries(ebhash string) ([]*Entry, error)

func GetEntry

func GetEntry(hash string) (*Entry, error)

func GetFirstEntry added in v0.3.4

func GetFirstEntry(chainid string) (*Entry, error)

func NewEntry

func NewEntry() *Entry

func (*Entry) Hash

func (e *Entry) Hash() []byte

func (*Entry) MarshalBinary

func (e *Entry) MarshalBinary() ([]byte, error)

func (*Entry) MarshalExtIDsBinary

func (e *Entry) MarshalExtIDsBinary() ([]byte, error)

func (*Entry) MarshalJSON added in v0.3.4

func (e *Entry) MarshalJSON() ([]byte, error)

func (*Entry) String added in v0.3.4

func (e *Entry) String() string

func (*Entry) UnmarshalJSON added in v0.3.4

func (e *Entry) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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