config

package
v0.0.0-...-d0dabfa Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBootstrapAddresses = []string{}

DefaultBootstrapAddresses are the addresses of cafe nodes run by the Textile team.

View Source
var DefaultOpennetBootstrapAddresses = []string{

	"/ip4/202.120.38.131/tcp/4001/ipfs/12D3KooWQ41gpmRvEhuAPoMPwQm6DLCSruQiVV1gpSdQL98UKgaZ",
	"/ip4/202.120.38.100/tcp/4001/ipfs/QmZt8jsim548Y5UFN24GL9nX9x3eSS8QFMsbSRNMBAqKBb",
	"/ip4/159.138.3.74/tcp/4001/ipfs/QmYovpcqB12c56AjGRaMUcwfoZg1DYinCFmEAzFHYvLb6R",
}

DefaultHuaweiBootstrapAddresses are the addresses of nodes run by the SJTU opennetwork team.

View Source
var DefaultServerFilters = []string{
	"/ip4/10.0.0.0/ipcidr/8",
	"/ip4/100.64.0.0/ipcidr/10",
	"/ip4/169.254.0.0/ipcidr/16",
	"/ip4/172.16.0.0/ipcidr/12",
	"/ip4/192.0.0.0/ipcidr/24",
	"/ip4/192.0.0.0/ipcidr/29",
	"/ip4/192.0.0.8/ipcidr/32",
	"/ip4/192.0.0.170/ipcidr/32",
	"/ip4/192.0.0.171/ipcidr/32",
	"/ip4/192.0.2.0/ipcidr/24",
	"/ip4/192.168.0.0/ipcidr/16",
	"/ip4/198.18.0.0/ipcidr/15",
	"/ip4/198.51.100.0/ipcidr/24",
	"/ip4/203.0.113.0/ipcidr/24",
	"/ip4/240.0.0.0/ipcidr/4",
	"/ip6/100::/ipcidr/64",
	"/ip6/2001:2::/ipcidr/48",
	"/ip6/2001:db8::/ipcidr/32",
	"/ip6/fc00::/ipcidr/7",
	"/ip6/fe80::/ipcidr/10",
}

DefaultServerFilters has is a list of IPv4 and IPv6 prefixes that are private, local only, or unrouteable. according to https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml and https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml

View Source
var OpennetCafeAddresses = []string{
	"/ip6/2001:da8:8000:6084:1a31:bfff:fecf:e603/tcp/12589/ipfs/12D3KooWEBKQAdjyqa4iMp8Lu8NF9tMQSWZoninNNPhbGYJ1xvcH",
	"/ip4/202.120.38.131/tcp/12589/ipfs/12D3KooWEBKQAdjyqa4iMp8Lu8NF9tMQSWZoninNNPhbGYJ1xvcH",
}

Functions

func InitIpfs

func InitIpfs(identity native.Identity, mobile bool, server bool) (*native.Config, error)

InitIpfs create the IPFS config file

func OpennetBootstrapPeers

func OpennetBootstrapPeers() ([]peer.AddrInfo, error)

OpennetBootstrapPeers returns the (parsed) set of Opennet bootstrap peers.

func OpennetCafes

func OpennetCafes() ([]peer.AddrInfo, error)

func TextileBootstrapPeers

func TextileBootstrapPeers() ([]peer.AddrInfo, error)

TextileBootstrapPeers returns the (parsed) set of Textile bootstrap peers.

func Write

func Write(repoPath string, conf *Config) error

Write replaces the on-disk version of config with the given one

Types

type API

type API struct {
	HTTPHeaders HTTPHeaders
	SizeLimit   int64 // Maximum file size limit to accept for POST requests in bytes
}

API settings

type Account

type Account struct {
	Address string // public key (seed is stored in the _possibly_ encrypted datastore)
	Thread  string // thread id of the default account thread used for sync between account peers
}

Account store public account info

type Addresses

type Addresses struct {
	API       string // bind address of the local REST API
	CafeAPI   string // bind address of the cafe REST API
	Gateway   string // bind address of the IPFS object gateway
	Profiling string // bind address of the profiling API
}

Addresses stores the (string) bind addresses for the node.

type Cafe

type Cafe struct {
	Host CafeHost
}

Cafe settings

type CafeHost

type CafeHost struct {
	Open        bool   // When true, other peers can register with this node for cafe services.
	URL         string // Override the resolved URL of this cafe, useful for load HTTPS and/or load balancers
	NeighborURL string // Specifies the URL of a secondary cafe. Must return cafe info.
	SizeLimit   int64  // Maximum file size limit to accept for POST requests in bytes.
}

CafeHost settings

type Config

type Config struct {
	Account   Account      // local node's account (public info only)
	Addresses Addresses    // local node's addresses
	API       API          // local node's API settings
	Gateway   Gateway      // local node's Gateway settings
	Logs      Logs         // local node's log settings
	IsMobile  bool         // local node is setup for mobile
	IsServer  bool         // local node is setup for a server w/ a public IP
	IsShadow  bool         // whether work as shadow node
	IsAuto    bool         // whether work as automatic node
	Cafe      Cafe         // local node cafe settings
	Bots      []EnabledBot // local node enabled bots
}

Config is used to load textile config files.

func Init

func Init() (*Config, error)

Init returns the default textile config

func Read

func Read(repoPath string) (*Config, error)

Read reads config from disk

type EnabledBot

type EnabledBot struct {
	ID      string // the id of the bot
	CafeAPI bool   // if true the bot will be available (public) over the Cafe API
}

EnabledBot store settings for an enabled bot

type Gateway

type Gateway struct {
	HTTPHeaders HTTPHeaders
}

Gateway settings

type HTTPHeaders

type HTTPHeaders = map[string][]string

HTTPHeaders to customise things like COR

type Logs

type Logs struct {
	LogToDisk bool // when true, sends all logs to rolling files on disk
}

Logs settings

type SwarmPorts

type SwarmPorts struct {
	TCP string // TCP address port
	WS  string // WS address port
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳