rtns

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

README

RTNS

RTNS (RTrade Name Service) is a stand-alone IPNS record management service, designed to facilitate secure publishing of IPNS records, leveraging an encrypted keystore known as kaas. Internally it facilitates scheduled republishing of all published records.

It is essentially a modified and condensed version of go-ipfs/namesys with minor optimizations

Limitations

  • When used within Temporal, any keys derived from the fail-over KaaS host are not eligible for automated republishing

Future Improvements

  • DNSLink support
  • Act as a gateway implementation to TNS (Temporal Name Server)
  • Enable HA Kaas Backend
    • This will involve repeatedly iterating through all available KaaS hosts attempting to retrieve the private key, until we either find the key or we iterate through all available KaaS hosts without finding one, triggering an error
  • Enable automatic topic subscription for IPNS pubsub
    • This would involve using rtfs to call an IPFS node, establishing a subscription for a given topic

Documentation

Overview

Package rtns provides a secure, stand-alone IPNS publishing service that leverages the KaaS encrypted keystore service

Index

Constants

View Source
const DefaultRecordLifetime = time.Hour * 24

DefaultRecordLifetime is the default lifetime for IPNS records

Variables

View Source
var DefaultRebroadcastInterval = time.Hour * 4

DefaultRebroadcastInterval is the default interval at which we rebroadcast IPNS records

View Source
var FailureRetryInterval = time.Minute * 5

FailureRetryInterval is the interval at which we retry IPNS records broadcasts (when they fail)

Functions

This section is empty.

Types

type Config

type Config struct {
	Datastore   datastore.Batching
	PK          ci.PrivKey
	ListenAddrs []multiaddr.Multiaddr
	Secret      []byte
}

Config is used to configure the RTNS service

type Service added in v0.0.7

type Service interface {
	// Close is used to trigger a shutdown of internal services
	Close()

	// DefaultBootstrapPeers returns the normal libp2p bootstrap peers, as well as the production nodes of Temporal.
	DefaultBootstrapPeers() []peerstore.PeerInfo
	// Bootstrap is used to bootstrap the dht
	Bootstrap(peers []peerstore.PeerInfo)

	// Publish enables publishing of an IPNS record with a default lifetime of 24 hours
	Publish(ctx context.Context, pk ci.PrivKey, cache bool, keyID, content string) error
	// PublishWithEOL allows specifying a lifetime for this record overriding the default lifetime of 24 hours
	PublishWithEOL(ctx context.Context, pk ci.PrivKey, eol time.Time, cache bool, keyID, content string) error

	// GetKey returns a key from the underlying krab keystore
	GetKey(name string) (ci.PrivKey, error)
	// HasKey returns whether or not the key is in our keystore
	HasKey(name string) (bool, error)
}

Service implements the rtns logic as a consumable service or library.

func NewService added in v0.0.7

func NewService(ctx context.Context, kbClient *kaas.Client, cfg Config) (Service, error)

NewService is used to instantiate an RTNS publisher service

Directories

Path Synopsis
internal
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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