config

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBootstrapAddresses = []string{
	"/ip4/104.210.43.77/tcp/4001/ipfs/12D3KooWSdGmRz5JQidqrtmiPGVHkStXpbSAMnbCcW8abq6zuiDP",
	"/ip4/20.39.232.27/tcp/4001/ipfs/12D3KooWLnUv9MWuRM6uHirRPBM4NwRj54n4gNNnBtiFiwPiv3Up",
	"/ip4/34.87.103.105/tcp/4001/ipfs/12D3KooWA5z2C3z1PNKi36Bw1MxZhBD8nv7UbB7YQP6WcSWYNwRQ",
	"/ip4/18.144.12.135/tcp/4001/ipfs/12D3KooWGBW3LfzypK3zgV4QxdPyUm3aEuwBDMKRRpCPm9FrJvar",
	"/ip4/13.57.23.210/tcp/4001/ipfs/12D3KooWQue2dSRqnZTVvikoxorZQ5Qyyug3hV65rYnWYpYsNMRE",
	"/ip4/13.56.163.77/tcp/4001/ipfs/12D3KooWFrrmGJcQhE5h6VUvUEXdLH7gPKdWh2q4CEM62rFGcFpr",
	"/ip4/52.53.127.155/tcp/4001/ipfs/12D3KooWGN8VAsPHsHeJtoTbbzsGjs2LTmQZ6wFKvuPich1TYmYY",
	"/ip4/18.221.167.133/tcp/4001/ipfs/12D3KooWERmHT6g4YkrPBTmhfDLjfi8b662vFCfvBXqzcdkPGQn1",
	"/ip4/18.224.173.65/tcp/4001/ipfs/12D3KooWLh9Gd4C3knv4XqCyCuaNddfEoSLXgekVJzRyC5vsjv5d",
	"/ip4/35.180.16.103/tcp/4001/ipfs/12D3KooWDhSfXZCBVAK6SNQu7h6mfGCBJtjMS44PW5YA5YCjVmjB",
	"/ip4/35.180.35.45/tcp/4001/ipfs/12D3KooWBCZEDkZ2VxdNYKLLUACWbXMvW9SpVbbvoFR9CtH4qJv9",
	"/ip4/13.250.53.27/tcp/4001/ipfs/12D3KooWQ5MR9Ugz9HkVU3fYFbiWbQR4jxKJB66JoSY7nP5ShsqQ",
	"/ip4/3.1.49.130/tcp/4001/ipfs/12D3KooWDWJ473M3fXMEcajbaGtqgr6i6SvDdh5Ru9i5ZzoJ9Qy8",
}

DefaultBootstrapAddresses are the addresses of cafe nodes run by the Textile 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

Functions

func InitIpfs added in v0.1.10

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

InitIpfs create the IPFS config file

func TextileBootstrapPeers added in v0.1.10

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

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

func Write added in v0.1.10

func Write(repoPath string, conf *Config) error

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

Types

type API added in v0.1.10

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

API settings

type Account added in v0.1.10

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 added in v0.1.10

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 added in v0.1.10

type Cafe struct {
	Host CafeHost
}

Cafe settings

type CafeHost added in v0.1.10

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 added in v0.1.10

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
	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 added in v0.1.10

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

Read reads config from disk

type EnabledBot added in v0.7.5

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 added in v0.1.14

type Gateway struct {
	HTTPHeaders HTTPHeaders
}

Gateway settings

type HTTPHeaders added in v0.1.14

type HTTPHeaders = map[string][]string

HTTPHeaders to customise things like COR

type Logs added in v0.1.10

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

Logs settings

type SwarmPorts added in v0.1.10

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