cloutcli

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 6 Imported by: 0

README

cloutcli

library to make building things with bitclout easy

building the "clout" executable

There is no main.go file in the root directory.

Instead go into "cmd" directory and go build there.

This is done to keep the root directory having the package name "cloutcli".

Which allows other go programs to just import:

import "github.com/andrewarrow/cloutcli"

and then:

list := cloutcli.GlobalPosts()

for _, post := range list {
  fmt.Println(post.Body)
}

Example

github.com/andrewarrow/referential

Documentation

Index

Constants

View Source
const HashSizeBytes = 32

Variables

View Source
var DefaultPublicKey = "BC1YLgw3KMdQav8w5juVRc3Ko5gzNJ7NzBHE1FfyYWGwpBEQEmnKG2v"

Functions

func EnumerateKeysForPrefix

func EnumerateKeysForPrefix(db *badger.DB, prefix []byte)

func PrintAllPostsFromBadger

func PrintAllPostsFromBadger(dir string) error

func UsernameToPub58

func UsernameToPub58(s string) string

Types

type BlockHash

type BlockHash [HashSizeBytes]byte

func (*BlockHash) Bytes

func (b *BlockHash) Bytes() []byte

type CoinEntry

type CoinEntry struct {
	CreatorBasisPoints      int64
	BitCloutLockedNanos     int64
	NumberOfHolders         int64
	CoinsInCirculationNanos int64
	CoinWatermarkNanos      int64
}

type DiamondEntry

type DiamondEntry struct {
	SenderPKID      *PKID
	ReceiverPKID    *PKID
	DiamondPostHash *BlockHash
	DiamondLevel    int64
	// contains filtered or unexported fields
}

type PKID

type PKID [33]byte

type Post

type Post struct {
	PostHashHex                string
	PosterPublicKeyBase58Check string
	ParentStakeID              string
	Body                       string
	PostExtraData              PostExtraData
	ImageURLs                  []string
	TimestampNanos             int64
	ProfileEntryResponse       ProfileEntryResponse
	LikeCount                  int64
	Comments                   []Post
	RecloutedPostEntryResponse *Post
	CommentCount               int64
	RecloutCount               int64
}

func FollowingFeedPosts

func FollowingFeedPosts(username string) []Post

func GlobalPosts

func GlobalPosts() []Post

type PostEntry

type PostEntry struct {
	PostHash                 *BlockHash
	PosterPublicKey          []byte
	ParentStakeID            []byte
	Body                     []byte
	RecloutedPostHash        *BlockHash
	IsQuotedReclout          bool
	CreatorBasisPoints       uint64
	StakeMultipleBasisPoints uint64
	ConfirmationBlockHeight  uint32
	TimestampNanos           uint64
	IsHidden                 bool
	StakeEntry               *StakeEntry
	LikeCount                uint64
	RecloutCount             uint64
	QuoteRecloutCount        uint64
	DiamondCount             uint64

	CommentCount  uint64
	IsPinned      bool
	PostExtraData map[string][]byte
	// contains filtered or unexported fields
}

type PostExtraData

type PostExtraData struct {
	EmbedVideoURL string
}

type PostsStateless

type PostsStateless struct {
	PostsFound []Post
}

type ProfileEntry

type ProfileEntry struct {
	PublicKey   []byte
	Username    []byte
	Description []byte
	ProfilePic  []byte
	IsHidden    bool
	CoinEntry

	StakeMultipleBasisPoints uint64
	StakeEntry               *StakeEntry
	// contains filtered or unexported fields
}

type ProfileEntryResponse

type ProfileEntryResponse struct {
	PublicKeyBase58Check   string
	Username               string
	Description            string
	CoinEntry              CoinEntry
	CoinPriceBitCloutNanos int64
}

type SingleProfile

type SingleProfile struct {
	Profile ProfileEntryResponse
}

type StakeEntry

type StakeEntry struct {
}

type StakeEntryStats

type StakeEntryStats struct {
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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