ssb

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 29 Imported by: 1

README

Go-SSB

hermit gopher with a shell and crab hands

GoDoc Go Report Card Github Actions

A full-stack implementation of secure-scuttlebutt using the Go programming language.

WARNING: Project is still in alpha, backwards incompatible changes will be made. We suggest vendoring for a stable experience.

If you encounter a bug, please refer to our public issue tracker.

Server Features

Installation

You can install the project using Golang's install command which will place the commands into the directory pointed to by the GOBIN environment variable.

git clone https://github.com/cryptoscope/ssb
cd ssb
go install ./cmd/go-sbot
go install ./cmd/sbotcli

Requirements:

  • Golang version 1.13 or higher

Running go-sbot

The tool in cmd/go-sbot is similar to ssb-server (previously called scuttlebot or sbot for short).

See the quick start document for a walkthrough and getting started tour.

Bootstrapping from an existing key-pair

If you have an existing feed with published contact messages, you can just resync it from another go or js server. To get this going you copy the key-pair ($HOME/.ssb/secret by default) to $HOME/.ssb-go/secret, start the program and connect to the server (using the multiserver address format).

mkdir $HOME/.ssb-go
cp $HOME/.ssb/secret $HOME/.ssb-go
go-sbot &
sbotcli connect "net:some.ho.st:8008~shs:SomeActuallyValidPubKey="

Publishing

This currently constructs legacy SSB messages, that still have the signature inside the signed value:

{
  "key": "%EMr6LTquV6Y8qkSaQ96ncL6oymbx4IddLdQKVGqYgGI=.sha256",
  "value": {
    "previous": "%rkJMoEspdU75c1RpGbwjEH7eZxM/PJPFubpZTtynhsg=.sha256",
    "author": "@iL6NzQoOLFP18pCpprkbY80DMtiG4JFFtVSVUaoGsOQ=.ed25519",
    "sequence": 793,
    "timestamp": 1457694632215,
    "hash": "sha256",
    "content": {
      "type": "post",
      "text": "@dust \n> this feels like the cultural opposite of self-dogfooding, and naturally, leaves a bad taste in my mouth \n \n\"This\" meaning this thread? Or something in particular in this thread? And if this thread or something in it, how so? I don't want to leave a bad taste in your mouth.",
      "root": "%I3yWHMF2kqC7fLZrC8FB+Kuu/6MQZIKzJGIjR3fVv9g=.sha256",
      "branch": "%cNJgO+1R4ci/jgTup4LLACoaKZRtYtsO7BzRCDJh6Gg=.sha256",
      "mentions": [
        {
          "link": "@/02iw6SFEPIHl8nMkYSwcCgRWxiG6VP547Wcp1NW8Bo=.ed25519",
          "name": "dust"
        }
      ],
      "channel": "patchwork-dev"
    },
    "signature": "bbjj+zyNubLNEV+hhUf6Of4KYOlQBavQnvdW9rF2nKqTHQTBiFBnRehfveCft3OGSIIr4VgD4ePICCTlBuTdAg==.sig.ed25519"
  },
  "timestamp": 1550074432723.0059
}

The problem with this (for Go and others) is removing the signature field from value without changing any of the values or field ordering of the object, which is required to compute the exact same bytes that were used for creating the signature. Signing JSON was a bad idea. There is also other problems around this (like producing the same byte/string encoding for floats that v8 produces) and a new, canonical format is badly needed.

What you are free to input is the content object, the rest is filled in for you. The author is determined by the keypair used by go-sbot. Multiple identities are supported through the API.

over muxrpc

go-sbot also exposes the same async publish method that ssb-server has. So you can also use it with ssb-client!

Through Go API

To do this programatically in go, you construct a margaret.Log using multilogs.OpenPublishLog (godoc) that publishes the content portion you Append() to it the feed of the keypair.

Example:

package main

import (
	"log"
	"fmt"

	"go.cryptoscope.co/ssb"
	"go.cryptoscope.co/ssb/multilogs"
	"go.cryptoscope.co/ssb/sbot"
)

func main() {
	sbot, err := sbot.New()
	check(err)

	publish, err := multilogs.OpenPublishLog(sbot.ReceiveLog, sbot.UserFeeds, *sbot.KeyPair)
	check(err)

	alice, err := refs.ParseFeedRef("@alicesKeyInActualBase64Bytes.ed25519")
	check(err)

	var someMsgs = []interface{}{
		map[string]interface{}{
			"type":  "about",
			"about": sbot.KeyPair.ID().Ref(),
			"name":  "my user",
		},
		map[string]interface{}{
			"type":      "contact",
			"contact":   alice.Ref(),
			"following": true,
		},
		map[string]interface{}{
			"type": "post",
			"text": `# hello world!`,
		},
		map[string]interface{}{
			"type":  "about",
			"about": alice.Ref(),
			"name":  "test alice",
		},
	}
	for i, msg := range someMsgs {
		newSeq, err := publish.Append(msg)
		check(fmt.Errorf("failed to publish test message %d: %w", i, err))
		log.Println("new message:", newSeq)
	}

	err = sbot.Close()
	check(err)
}

func check(err error) {
	if err != nil {
		log.Fatal(err)
	}
}

sbotcli

Has some commands to publish frequently used messages like post, vote and contact:

sbotcli publish contact --following '@p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519'
sbotcli publish contact --blocking '@p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519'
sbotcli publish about --name "cryptix" '@p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519'

They all support passing multiple --recps flags to publish private messages as well:

sbotcli publish post --recps "@key1" --recps "@key2" "what's up?"

For more dynamic use, you can also just pipe JSON into stdin:

cat some.json | sbotcli publish raw

Building

We are trying to adopt the new Go Modules way of defining dependencies and therefore require at least Go version 1.11 to build with the go.mod file definitions. (Building with earlier versions is still possible, though. We keep an intact dependency tree in vendor/, populated by go mod vendor, which is picked up by default since Go 1.09.)

There are two binary executable in this project that are useful right now, both located in the cmd folder. go-sbot is the database server, handling incoming connections and supplying replication to other peers. sbotcli is a command line interface to query feeds and instruct actions like connect to X. This also works against the JS implementation.

If you just want to build the server and play without contributing to the code (and are using a recent go version > 1.11), you can do this:

# clone the repo
git clone https://github.com/cryptoscope/ssb
# go into the servers folder
cd ssb/cmd/go-sbot
# build the binary (also fetches pinned dependencies)
go build -v -i
# test the executable works by printing it's help listing
./go-sbot -h
# (optional) install it somwhere on your $PATH
sudo cp go-sbot /usr/local/bin

If you want to hack on the other dependencies of the stack, we still advise using the classic Go way with a $GOPATH. This way you have all the code available to inspect and change. (Go modules get stored in a read-only cache. Replacing them needs a checkout on an individual basis.)

# prepare workspace for all the go code
export GOPATH=$HOME/proj/go-ssb
mkdir -p $GOPATH
# fetch project source and dependencies
go get -v -u go.cryptoscope.co/ssb
# change to the project directory
cd $GOPATH/src/go.cryptoscope.co/ssb
# build the binaries (will get saved to $GOPATH/bin)
go install ./cmd/go-sbot
go install ./cmd/sbotcli

Testing Build Status

Once you have configured your environment set up to build the binaries, you can also run the tests. We have unit tests for most of the modules, most importantly message, blobstore and the replication plugins (gossip and blobs). There are also interoperability tests with the nodejs implementation (this requires recent versions of node and npm).

$ cd $GOPATH/src/go.cryptoscope.co/ssb

$ go test -v ./message
2019/01/08 12:21:55 loaded 236 messages from testdata.zip
=== RUN   TestPreserveOrder
--- PASS: TestPreserveOrder (0.00s)
=== RUN   TestComparePreserve
--- PASS: TestComparePreserve (0.02s)
=== RUN   TestExtractSignature
--- PASS: TestExtractSignature (0.00s)
=== RUN   TestStripSignature
--- PASS: TestStripSignature (0.00s)
=== RUN   TestUnicodeFind
--- PASS: TestUnicodeFind (0.00s)
=== RUN   TestInternalV8String
--- PASS: TestInternalV8String (0.00s)
=== RUN   TestSignatureVerify
--- PASS: TestSignatureVerify (0.06s)
=== RUN   TestVerify
--- PASS: TestVerify (0.06s)
=== RUN   TestVerifyBugs
--- PASS: TestVerifyBugs (0.00s)
PASS
ok  	go.cryptoscope.co/ssb/message	0.180s

If you encounter a feed that can't be validated with our code, there is a encode_test.js script to create the testdata.zip from a local sbot. Call it like this cd message && node encode_test.js @feedPubKey.ed25519 and re-run go test.

$ go test ./plugins/...
ok  	go.cryptoscope.co/ssb/plugins/blobs	0.021s
?   	go.cryptoscope.co/ssb/plugins/control	[no test files]
ok  	go.cryptoscope.co/ssb/plugins/gossip	0.667s
?   	go.cryptoscope.co/ssb/plugins/test	[no test files]
?   	go.cryptoscope.co/ssb/plugins/whoami	[no test files]

(Sometimes the gossip test blocks indefinitely. This is a bug in go-muxrpcs closing behavior. See the Known bugs section for more information.)

To run the interop tests you need to install the dependencies first and then run the tests. Diagnosing a failure might require adding the -v flag to get the stderr output from the nodejs process.

$ cd $GOPATH/src/go.cryptoscope.co/ssb/tests
$ npm ci
$ go test -v

Known Bugs

See our issue tracker for a complete list.

Forked version of x/crypto

We currently depend on this patch on x/crypto to support the key-material conversion between ed25519 and curve25519. See https://github.com/cryptoscope/ssb/issues/44 for all the details.

package golang.org/x/crypto/ed25519/edwards25519: cannot find package "golang.org/x/crypto/ed25519/edwards25519" in any of:
	/home/cryptix/go.root/src/golang.org/x/crypto/ed25519/edwards25519 (from $GOROOT)
	/home/cryptix/go-fooooo/src/golang.org/x/crypto/ed25519/edwards25519 (from $GOPATH)

If you see the above error, make sure your project has the following replace directive in place:

replace golang.org/x/crypto => github.com/cryptix/golang_x_crypto v0.0.0-20200303113948-2939d6771b24

compilation error regarding Badger

This should only happen if you are not using Go modules way of building and the vendor/ folder isn't used to build the SSB code. Badger pushed an API change to master. We still depend on v1.5.4 as there is only a candidate release version of the new API yet.

# go.cryptoscope.co/librarian/badger
./index.go:53:13: assignment mismatch: 2 variables but 1 values
./index.go:53:26: not enough arguments in call to item.Value
	have ()
	want (func([]byte) error)

Either use the Go Module way of building the project, which uses the pinned version specified by the go.mod file or check out the specific version of badger in your $GOPATH.

Startup error / illegal JSON value

We currently use a very rough state file to keep track of which messages are indexed already (multilogs and contact graph). When the server crashes while it is being rewritten, this file can get corrupted. We have a fsck-like tool in mind to rebuild the indicies from the static log but it's not done yet.

time=2019-01-09T21:19:08.73736113Z caller=new.go:47 module=sbot event="component terminated" component=userFeeds error="error querying rootLog for mlog: error decoding value: json: cannot unmarshal number 272954244983260621261341 into Go value of type margaret.Seq"

Our current workaround is to do a full resync from the network:

kill $(pgrep go-sbot)
rm -rf $HOME/.ssb-go/{log,sublogs,indicies}
go-sbot &
sbotcli connect "net:some.ho.st:8008~shs:SomeActuallyValidPubKey="

Startup error / no mmio

The badger key-value database defaults to loading some of it's files using memory-mapped i/o. If this turns out to be a problem on your target platform, you can use go build -tags nommio when building to fall back to standard files, which can be a bit slower but should still be fully functional.

The error can look like this:

badger failed to open: Mmap value log file. Path=C:\\some\\where\\.ssb-go\\indexes\\contacts\\db\\000000.vlog. Error=MapViewOfFile: Not enough memory resources are available to process this command.

Contact

Either post to the #go-ssb channel on the mainnet or mention us individually:

  • cryptix: @p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519
  • keks: @YXkE3TikkY4GFMX3lzXUllRkNTbj5E+604AkaO1xbz8=.ed25519

Documentation

Index

Constants

View Source
const DropContentRequestType = "drop-content-request"

Variables

View Source
var ErrShuttingDown = fmt.Errorf("ssb: shutting down now") // this is fine
View Source
var ErrUnuspportedFormat = fmt.Errorf("ssb: unsupported format")
View Source
var SecretPerms = os.FileMode(0600)

SecretPerms are the file permissions for holding SSB secrets. We expect the file to only be accessable by the owner.

Functions

func EdKeyPair added in v0.2.1

func EdKeyPair(kp KeyPair) secrethandshake.EdKeyPair

func EncodeKeyPairAsJSON

func EncodeKeyPairAsJSON(kp KeyPair, w io.Writer) error

EncodeKeyPairAsJSON serializes the passed Keypair into the writer w

func FeedsWithSequnce

func FeedsWithSequnce(feedIndex multilog.MultiLog) (luigi.Source, error)

FeedsWithSequnce returns a source that emits one ReplicateUpToResponse per stored feed in feedIndex TODO: make cancelable and with no RAM overhead when only partially used (iterate on demand)

func GetFeedRefFromAddr

func GetFeedRefFromAddr(addr net.Addr) (refs.FeedRef, error)

GetFeedRefFromAddr uses netwrap to get the secretstream address and then uses ParseFeedRef

func IsMessageUnusable

func IsMessageUnusable(err error) bool

func IsValidFeedFormat

func IsValidFeedFormat(r refs.FeedRef) error

IsValidFeedFormat checks if the passed FeedRef is for one of the two supported formats, legacy/crapp or GabbyGrove.

func SaveKeyPair

func SaveKeyPair(kp KeyPair, path string) error

SaveKeyPair serializes the passed KeyPair to path. It errors if path already exists.

Types

type Authorizer

type Authorizer interface {
	Authorize(remote refs.FeedRef) error
}

type BlobStore

type BlobStore interface {
	// Get returns a reader of the blob with given ref.
	Get(ref refs.BlobRef) (io.ReadCloser, error)

	// Put stores the data in the reader in the blob store and returns the address.
	Put(blob io.Reader) (refs.BlobRef, error)

	// Delete deletes a blob from the blob store.
	Delete(ref refs.BlobRef) error

	// List returns a source of the refs of all stored blobs.
	List() luigi.Source

	// Size returns the size of the blob with given ref.
	Size(ref refs.BlobRef) (int64, error)

	// Register allows to get notified when the store changes
	BlobStoreBroadcaster
}

BlobStore is the interface of our blob store

type BlobStoreBroadcaster added in v0.2.1

type BlobStoreBroadcaster interface {
	Register(sink BlobStoreEmitter) CancelFunc
}

type BlobStoreEmitter added in v0.2.1

type BlobStoreEmitter interface {
	EmitBlob(BlobStoreNotification) error
	io.Closer
}

type BlobStoreNotification

type BlobStoreNotification struct {
	Op  BlobStoreOp
	Ref refs.BlobRef

	Size int64
}

BlobStoreNotification contains info on a single change of the blob store. Op is either "rm" or "put".

func (BlobStoreNotification) String

func (bn BlobStoreNotification) String() string

type BlobStoreOp

type BlobStoreOp string

BlobStoreOp specifies the operation in a blob store notification.

const (
	// BlobStoreOpPut is used in put notifications
	BlobStoreOpPut BlobStoreOp = "put"

	// BlobStoreOpRm is used in remove notifications
	BlobStoreOpRm BlobStoreOp = "rm"
)

func (BlobStoreOp) String

func (op BlobStoreOp) String() string

String returns the string representation of the operation.

type BlobWant

type BlobWant struct {
	Ref refs.BlobRef

	// if Dist is negative, it is the hop count to the original wanter.
	// if it is positive, it is the size of the blob.
	Dist int64
}

func (BlobWant) String

func (w BlobWant) String() string

type BlobWantsBroadcaster added in v0.2.1

type BlobWantsBroadcaster interface {
	Register(sink BlobWantsEmitter) CancelFunc
}

type BlobWantsEmitter added in v0.2.1

type BlobWantsEmitter interface {
	EmitWant(BlobWant) error
	io.Closer
}

type CancelFunc added in v0.2.1

type CancelFunc func()

type ConnTracker

type ConnTracker interface {
	// Active returns true and since when a peer connection is active
	Active(net.Addr) (bool, time.Duration)

	// OnAccept receives a new connection as an argument.
	// If it decides to accept it, it returns true and a context that will be canceled once it should shut down
	// If it decides to deny it, it returns false (and a nil context)
	OnAccept(context.Context, net.Conn) (bool, context.Context)

	// OnClose notifies the tracker that a connection was closed
	OnClose(conn net.Conn) time.Duration

	// Count returns the number of open connections
	Count() uint

	// CloseAll closes all tracked connections
	CloseAll()
}

ConnTracker decides if connections should be established and keeps track of them

type ContentNuller

type ContentNuller interface {
	NullContent(feed refs.FeedRef, seq uint) error
}

type DropContentRequest added in v0.2.1

type DropContentRequest struct {
	Type     string          `json:"type"`
	Sequence uint            `json:"sequence"`
	Hash     refs.MessageRef `json:"hash"`
}

DropContentRequest has special meaning on a gabby-grove feed. It's signature verification allows ommiting the content. A feed author can ask other peers to drop a previous message of theirs with this. Sequence must be smaller then current, also the targeted message can't be a drop-content-request

func NewDropContentRequest added in v0.2.1

func NewDropContentRequest(seq uint, h refs.MessageRef) *DropContentRequest

func (DropContentRequest) Valid added in v0.2.1

func (dcr DropContentRequest) Valid(log margaret.Log) bool

type EndpointStat

type EndpointStat struct {
	ID       refs.FeedRef
	Addr     net.Addr
	Since    time.Duration
	Endpoint muxrpc.Endpoint
}

EndpointStat gives some information about a connected peer

type ErrMalfromedMsg

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

func (ErrMalfromedMsg) Error

func (emm ErrMalfromedMsg) Error() string

type ErrOutOfReach

type ErrOutOfReach struct {
	Dist int
	Max  int
}

func (ErrOutOfReach) Error

func (e ErrOutOfReach) Error() string

type ErrWrongSequence

type ErrWrongSequence struct {
	Ref             refs.FeedRef
	Logical, Stored int64
}

ErrWrongSequence is returned if there is a glitch on the current sequence number on the feed between in the offsetlog and the logical entry on the feed

func (ErrWrongSequence) Error

func (e ErrWrongSequence) Error() string

type ErrWrongType

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

func (ErrWrongType) Error

func (ewt ErrWrongType) Error() string

type Getter

type Getter interface {
	Get(refs.MessageRef) (refs.Message, error)
}

type IndexState

type IndexState struct {
	Name  string
	State string
}

type IndexStates

type IndexStates []IndexState

type Indexer

type Indexer interface {
	MultiLogGetter
	SimpleIndexGetter
	GetIndexNamesSimple() []string
	GetIndexNamesMultiLog() []string
}

type KeyPair

type KeyPair interface {
	ID() refs.FeedRef
	Secret() ed25519.PrivateKey
}

func LoadKeyPair

func LoadKeyPair(fname string) (KeyPair, error)

LoadKeyPair opens fname, ignores any line starting with # and passes it ParseKeyPair

func NewKeyPair

func NewKeyPair(r io.Reader, algo refs.RefAlgo) (KeyPair, error)

NewKeyPair generates a fresh KeyPair using the passed io.Reader as a seed. Passing nil is fine and will use crypto/rand.

func ParseKeyPair

func ParseKeyPair(r io.Reader) (KeyPair, error)

ParseKeyPair json decodes an object from the reader. It expects std base64 encoded data under the `private` and `public` fields.

type LegacyKeyPair added in v0.2.1

type LegacyKeyPair struct {
	Feed refs.FeedRef
	Pair secrethandshake.EdKeyPair
}

func (LegacyKeyPair) ID added in v0.2.1

func (lkp LegacyKeyPair) ID() refs.FeedRef

func (LegacyKeyPair) Secret added in v0.2.1

func (lkp LegacyKeyPair) Secret() ed25519.PrivateKey

type MultiLogGetter

type MultiLogGetter interface {
	GetMultiLog(name string) (multilog.MultiLog, bool)
}

type Network

type Network interface {
	Connect(ctx context.Context, addr net.Addr) error
	Serve(context.Context, ...muxrpc.HandlerWrapper) error
	GetListenAddr() net.Addr

	GetAllEndpoints() []EndpointStat
	GetEndpointFor(refs.FeedRef) (muxrpc.Endpoint, bool)

	GetConnTracker() ConnTracker

	DialViaRoom(portal, target refs.FeedRef) error

	// websock hack
	HandleHTTP(handler http.Handler)

	io.Closer
}

type NetworkFrontier

type NetworkFrontier map[string]Note

NetworkFrontier represents a set of feeds and their length The key is the canonical string representation (feed.Ref())

func (NetworkFrontier) String

func (nf NetworkFrontier) String() string

func (*NetworkFrontier) UnmarshalJSON

func (nf *NetworkFrontier) UnmarshalJSON(b []byte) error

type Note

type Note struct {
	Seq int64

	// Replicate (seq==-1) tells the peer that it doesn't want to hear about that feed
	Replicate bool

	// Receive controlls the eager push.
	// a peer might want to know if there are updates but not directly get the messages
	Receive bool
}

Note informs about a feeds length and some control settings

func (Note) MarshalJSON

func (s Note) MarshalJSON() ([]byte, error)

type PeerStatus

type PeerStatus struct {
	Addr  string
	Since string
}

type Plugin

type Plugin interface {
	// Name returns the name and version of the plugin.
	// format: name-1.0.2
	Name() string

	// Method returns the preferred method of the call
	Method() muxrpc.Method

	// Handler returns the muxrpc handler for the plugin
	Handler() muxrpc.Handler
}

type PluginManager

type PluginManager interface {
	Register(Plugin)
	MakeHandler(conn net.Conn) (muxrpc.Handler, error)
}

func NewPluginManager

func NewPluginManager() PluginManager

type Publisher

type Publisher interface {
	margaret.Log

	// Publish is a utility wrapper around append which returns the new message reference key
	Publish(content interface{}) (refs.MessageRef, error)
}

type ReplicateUpToResponse

type ReplicateUpToResponse struct {
	ID       refs.FeedRef `json:"id"`
	Sequence int64        `json:"sequence"`
}

this is one message of replicate.upto also handy to talk about the (latest) state of a single feed

func (ReplicateUpToResponse) Seq

func (upto ReplicateUpToResponse) Seq() int64

type ReplicationLister

type ReplicationLister interface {
	Authorizer
	ReplicationList() *StrFeedSet
	BlockList() *StrFeedSet
}

ReplicationLister is used by the executing part to get the lists TODO: maybe only pass read-only/copies or slices down

type Replicator

type Replicator interface {
	Replicate(refs.FeedRef)
	DontReplicate(refs.FeedRef)
	Block(refs.FeedRef)
	Unblock(refs.FeedRef)

	Lister() ReplicationLister
}

Replicator is used to tell the bot which feeds to copy from other peers and which ones to block

type SimpleIndexGetter

type SimpleIndexGetter interface {
	GetSimpleIndex(name string) (librarian.Index, bool)
}

type Status

type Status struct {
	PID      int // process id of the bot
	Peers    []PeerStatus
	Blobs    []BlobWant
	Root     int64
	Indicies IndexStates
}

type Statuser

type Statuser interface {
	Status() (Status, error)
}

Statuser returns status information about the bot, like how many open connections it has (see type Status for more)

type StrFeedSet

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

func NewFeedSet

func NewFeedSet(size int) *StrFeedSet

func (*StrFeedSet) AddRef

func (fs *StrFeedSet) AddRef(ref refs.FeedRef) error

func (*StrFeedSet) Count

func (fs *StrFeedSet) Count() int

func (*StrFeedSet) Delete

func (fs *StrFeedSet) Delete(ref refs.FeedRef) error

func (StrFeedSet) Has

func (fs StrFeedSet) Has(ref refs.FeedRef) bool

func (StrFeedSet) List

func (fs StrFeedSet) List() ([]refs.FeedRef, error)

type WantManager

type WantManager interface {
	io.Closer

	BlobWantsBroadcaster

	Want(ref refs.BlobRef) error
	Wants(ref refs.BlobRef) bool
	WantWithDist(ref refs.BlobRef, dist int64) error
	//Unwant(ref refs.BlobRef) error
	CreateWants(context.Context, *muxrpc.ByteSink, muxrpc.Endpoint) luigi.Sink

	AllWants() []BlobWant
}

Directories

Path Synopsis
Package blobstore implements the filesystem storage and simpathy/want managment for ssb-blobs.
Package blobstore implements the filesystem storage and simpathy/want managment for ssb-blobs.
Package client is a a simple muxrpc interface to common ssb methods, similar to npm:ssb-client
Package client is a a simple muxrpc interface to common ssb methods, similar to npm:ssb-client
cmd
go-sbot
go-sbot hosts the database and p2p server for replication.
go-sbot hosts the database and p2p server for replication.
gossb-null-entry
usefull to eradicate entries in offsetlog by hand.
usefull to eradicate entries in offsetlog by hand.
sbotcli
sbotcli implements a simple tool to query commands on another sbot
sbotcli implements a simple tool to query commands on another sbot
ssb-drop-feed
ssb-drop-feed nulls entries of one particular feed from repo there is no warning or undo
ssb-drop-feed nulls entries of one particular feed from repo there is no warning or undo
Package graph derives trust/block relations by consuming type:contact message and offers lookup APIs between two feeds.
Package graph derives trust/block relations by consuming type:contact message and offers lookup APIs between two feeds.
Package indexes contains functions to create indexing for 'get(%ref) -> message'.
Package indexes contains functions to create indexing for 'get(%ref) -> message'.
internal
aliases
Package aliases implements the validation and signing features of https://ssb-ngi-pointer.github.io/rooms2/#alias
Package aliases implements the validation and signing features of https://ssb-ngi-pointer.github.io/rooms2/#alias
extra25519
Package extra25519 implements the key conversion from ed25519 to curve25519.
Package extra25519 implements the key conversion from ed25519 to curve25519.
leakcheck
Package leakcheck contains functions to check leaked goroutines.
Package leakcheck contains functions to check leaked goroutines.
mutil
Package mutil offers some margaret utilities.
Package mutil offers some margaret utilities.
slp
Package slp implements "shallow length prefixed" data.
Package slp implements "shallow length prefixed" data.
statematrix
Package statematrix stores and provides useful operations on an state matrix for the Epidemic Broadcast Tree protocol.
Package statematrix stores and provides useful operations on an state matrix for the Epidemic Broadcast Tree protocol.
storedrefs
Package storedrefs provides methods to encode certain types as bytes, as used by the internal storage system.
Package storedrefs provides methods to encode certain types as bytes, as used by the internal storage system.
tools
mainly used to install https://github.com/maxbrunsfeld/counterfeiter
mainly used to install https://github.com/maxbrunsfeld/counterfeiter
Package invite contains functions for parsing invite codes and dialing a pub as a guest to redeem a token.
Package invite contains functions for parsing invite codes and dialing a pub as a guest to redeem a token.
Package message contains abstract verification and publish helpers.
Package message contains abstract verification and publish helpers.
legacy
Package legacy how to encode and verify the current ssb messages.
Package legacy how to encode and verify the current ssb messages.
multimsg
Package multimsg implements a margaret codec to encode multiple kinds of messages to disk.
Package multimsg implements a margaret codec to encode multiple kinds of messages to disk.
Package network implements utilities for dialing and listening to secret-handshake powered muxrpc connections.
Package network implements utilities for dialing and listening to secret-handshake powered muxrpc connections.
plugins
blobs
Package blobs implements the muxrpc handlers for npm:ssb-blobs.
Package blobs implements the muxrpc handlers for npm:ssb-blobs.
conn
Package conn offers muxrpc helpers to connect to remote peers.
Package conn offers muxrpc helpers to connect to remote peers.
ebt
friends
Package friends supplies some of npm:ssb-friends, namly isFollowing, isBlocking and hops but not hopStream, onEdge or createLayer.
Package friends supplies some of npm:ssb-friends, namly isFollowing, isBlocking and hops but not hopStream, onEdge or createLayer.
get
Package get is just a muxrpc wrapper around sbot.Get
Package get is just a muxrpc wrapper around sbot.Get
gossip
Package gossip implements the createHistoryStream muxrpc call.
Package gossip implements the createHistoryStream muxrpc call.
groups
Package groups supplies muxprc handlers for group managment.
Package groups supplies muxprc handlers for group managment.
legacyinvites
Package legacyinvites supplies the follow-back sub protocol for new users.
Package legacyinvites supplies the follow-back sub protocol for new users.
partial
Package partial is a helper module for ssb-browser-core, enabling to fetch subsets of feeds.
Package partial is a helper module for ssb-browser-core, enabling to fetch subsets of feeds.
private
Package private suuplies an about to be deprecated way of accessing private messages.
Package private suuplies an about to be deprecated way of accessing private messages.
publish
Package publish is just a muxrpc wrapper around sbot.PublishLog.Publish.
Package publish is just a muxrpc wrapper around sbot.PublishLog.Publish.
replicate
Package replicate roughly translates to npm:ssb-replicate and only selects which feeds to block and fetch.
Package replicate roughly translates to npm:ssb-replicate and only selects which feeds to block and fetch.
box
Package query holds the first version of a generic query engine for go-ssb.
Package query holds the first version of a generic query engine for go-ssb.
Package repo contains utility modules to open offset logs and create different kinds of indexes.
Package repo contains utility modules to open offset logs and create different kinds of indexes.
Package sbot ties together network, repo and plugins like graph and blobs into a large server that offers data-access APIs and background replication.
Package sbot ties together network, repo and plugins like graph and blobs into a large server that offers data-access APIs and background replication.

Jump to

Keyboard shortcuts

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