replicatr

command module
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: GPL-2.0 Imports: 3 Imported by: 0

README

Replicatr

logo

replicatr is a relay for the nostr protocol

  • Supports most applicable NIPs: 1, 2, 4, 9, 11, 12, 15, 16, 20, 22, 28, 33, 40, 42
  • Websocket compression: permessage-deflate with optional sliding window, when supported by clients
  • Extremely configurable making it seamlessly customizable across several parameters for relay operators
  • No external database required: All data is stored first locally on the filesystem in BadgerDB and optionally on the Internet Computer for inter-relay synchronization.
  • The local badgerDB is additionally equipped with a nostr-specific, highly configurable garbage collection scheme and a nostr-specific prefix-indexing scheme for seamless data mangement and rapid querying
  • Supports optionally mandating nip-42 authorization upon initial connection for enhanced security
  • Internet Computer-integration for efficient syncing with remote relays

Syncing

The most original feature of replicatr is it's Internet Computer integration allowing for quick and seamless inter-relay synchronization. This is achieved by defining relay clusters, an interconnected group of relays that're given authorization by a replicatr canister owner to utilize the canister's synchronization tooling to achieve consistency across the cluster.

Click here** to learn more about the problem this solves.

Click here** to learn more about the synchronization architecture.

Usage

Setup

Works with Linux, MacOS, and WSL

To setup an Owner relay (and start your own cluster):
  1. Clone the repo and ensure golang (v1.20+) is installed.
  2. Ensure dfx is installed in the repo root directory with a nonzero cycle balance.
  3. From the root directory, run the initialization script:
chmod +x pkg/ic/setup/owner.sh
./pkg/ic/setup/owner.sh

This will initialize your relay and deploy a replicatr canister on the Internet Computer with your relay as the specified owner.

To setup as a Minion/Secondary-Owner relay (and join a preexisting cluster):
  1. Identify the a relay cluster you would like to join and ask the owner for their canister-id and if you can join.
  2. Clone the repo and ensure golang (v1.20+) is installed
  3. Run the following command from the root directory to initialize the relay with the previously obtained canister-id:
    go run . initcfg -I <canister-id>
  4. Run the following command to obtain your canister-facing relay pubkey:
    go run . pubkey
  5. Send the resulting pubkey to the canister owner and wait for them to grant you user/owner level access

To learn more about canister permissions, click here**.

Running The Relay

Here is how to run the relay:

go run . -<flags> <args>

add flags to configure the relay as needed or run without any flags to use defaults. Click here** to view customizable parameters and configuration details

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app
acl
cmd
agent command
authr command
blower command
firehose command
Package main provides a configurable, frequency and event/size volume control that hoses a relay with events to test garbage collection.
Package main provides a configurable, frequency and event/size volume control that hoses a relay with events to test garbage collection.
ingestr command
postr command
testr command
vacuum command
pkg
nostr/context
Package context is a set of shorter names for the very stuttery context library.
Package context is a set of shorter names for the very stuttery context library.
nostr/eventstore/badger/keys
Package keys is a composable framework for constructing badger keys from fields of events.
Package keys is a composable framework for constructing badger keys from fields of events.
nostr/eventstore/l2
Package l2 is a testing data store that implements a level 2 cache for events with a badger eventstore.
Package l2 is a testing data store that implements a level 2 cache for events with a badger eventstore.
nostr/nostrbinary
Package nostrbinary provides a simple interface for using Gob encoding on nostr events.
Package nostrbinary provides a simple interface for using Gob encoding on nostr events.
nostr/pool
Package pool is
Package pool is
nostr/wire/array
Package array implements an interface slice data structure that produces JSON as its string/byte string output.
Package array implements an interface slice data structure that produces JSON as its string/byte string output.
nostr/wire/object
Package object implements an ordered key/value data structure for use with JSON documents that must be strictly ordered in order to create a consistent blob of data in canonical order for creating verifiable signatures while delivering the data over the wire or storing it with its signature and object hash also present, as is used for nostr events.
Package object implements an ordered key/value data structure for use with JSON documents that must be strictly ordered in order to create a consistent blob of data in canonical order for creating verifiable signatures while delivering the data over the wire or storing it with its signature and object hash also present, as is used for nostr events.

Jump to

Keyboard shortcuts

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