depute

package module
v0.0.0-...-46f04ea Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0, MIT Imports: 30 Imported by: 0

README

🎩 depute

Go Test

A gRPC service to advertise content addressable data onto IPNI.

Install

To install depute CLI directly via Golang, run:

$ go install github.com/ipni/depute/cmd/depute@latest

Usage

$ depute -h 
Usage of depute:
Usage of ./depute:
  -directAnnounceURL value
    	Indexer URL to send direct http announcement to. Multiple OK
  -grpcListenAddr string
    	The gRPC server listen address. (default "0.0.0.0:40080")
  -grpcTlsCertPath string
    	Path to gRPC server TLS Certificate.
  -grpcTlsKeyPath string
    	Path to gRPC server TLS Key.
  -httpListenAddr string
    	Address to listen on for publishing advertisements over HTTP.
  -libp2pIdentityPath string
    	Path to the marshalled libp2p host identity. If unspecified a random identity is generated.
  -libp2pListenAddrs string
    	Comma separated libp2p host listen addrs. If unspecified the default listen addrs are used at ephemeral port.
  -logLevel string
    	Logging level. Only applied if GOLOG_LOG_LEVEL environment variable is unset. (default "info")
  -noPubsub
    	Disable pubsub announcements of new advertisements.
  -pubAddr value
    	Address to tell indexer where to retrieve advertisements. Multiple OK
  -retrievalAddrs string
    	Comma separated retrieval multiaddrs to advertise. If unspecified, libp2p host listen addrs are used.
  -topic string
    	Sets the topic that pubsub messages are send on. (default "/indexer/ingest/mainnet")
Run Server Locally

To run the depute HTTP server locally, execute:

$ go run ./cmd/depute

The above command starts the gRPC server exposed on default listen address: http://localhost:40080.

To shutdown the server, interrupt the terminal by pressing Ctrl + C

License

SPDX-License-Identifier: Apache-2.0 OR MIT

Documentation

Index

Constants

View Source
const DefaultTopic = "/indexer/ingest/mainnet"

Variables

This section is empty.

Functions

This section is empty.

Types

type Depute

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

func New

func New(o ...Option) (*Depute, error)

func (*Depute) NotifyContent

func (d *Depute) NotifyContent(source depute.Publisher_NotifyContentServer) error

func (*Depute) Publish

func (*Depute) Shutdown

func (d *Depute) Shutdown(_ context.Context) error

func (*Depute) Start

func (d *Depute) Start(_ context.Context) error

type Option

type Option func(*options) error

func WithDirectAnnounceURLs

func WithDirectAnnounceURLs(urls []string) Option

WithDirectAnnounceURLs sets URLs of indexers to send direct HTTP announcements to.

func WithGrpcListenAddr

func WithGrpcListenAddr(a string) Option

func WithGrpcServerOptions

func WithGrpcServerOptions(opt ...grpc.ServerOption) Option

func WithHost

func WithHost(h host.Host) Option

func WithHttpListenAddr

func WithHttpListenAddr(addr string) Option

WithHttpListenAddrs sets the address to listen on for publishing advertisements over HTTP.

func WithNoPubsubAnnounce

func WithNoPubsubAnnounce() Option

WithNoPubsubAnnounce disables libp2p pubsub announcements.

func WithPublishAddrs

func WithPublishAddrs(addrs []string) Option

WithPublishAddrs sets the addresses put into announcements to tell indexers where to get the advertisements. Addresses are multiaddr strings.

func WithPublishTopic

func WithPublishTopic(topicName string) Option

WithPublishTopic sets the topic that pubsub messages are send on.

func WithPublisher

func WithPublisher(publisher dagsync.Publisher) Option

func WithRetrievalAddrs

func WithRetrievalAddrs(a ...string) Option

Directories

Path Synopsis
api
v0
cmd

Jump to

Keyboard shortcuts

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