-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move go-ipfs-config back into go-ipfs #8756
Merged
Merged
Changes from all commits
Commits
Show all changes
332 commits
Select commit
Hold shift + click to select a range
6135edf
go-ipfs-config: core: Add config option for datastore read rehashing
Kubuxu 3510859
go-ipfs-config: config: Add explicit default value for HashOnRead
Kubuxu e8912c1
go-ipfs-config: core/commands: do not show PrivKey in config if it is…
Kubuxu 30b5a1f
go-ipfs-config: config: add config option for bloom filter
Kubuxu f851787
go-ipfs-config: Merge pull request #2973 from ipfs/feature/blockstore…
whyrusleeping f5e4f18
go-ipfs-config: reprovider: add config option to set reprovide interval
whyrusleeping 16dd947
go-ipfs-config: update deps for libp2p 3.4.0
whyrusleeping b4fd445
go-ipfs-config: config: guard against privkey being overwritten in fs…
whyrusleeping d229517
go-ipfs-config: Extract peerset, update peer, peerset, secio, libp2p
geoah faef265
go-ipfs-config: Merge branch 'version/0.4.3-rc4'
whyrusleeping 3e6db54
go-ipfs-config: update to libp2p 4.0.1 and propogate other changes
whyrusleeping ed67b7b
go-ipfs-config: Changed so only explicit ipfs cli commands are lowerc…
RichardLitt 07559a2
go-ipfs-config: add config option to disable bandwidth metrics
whyrusleeping 608f6f3
go-ipfs-config: bootstrap: add a few /ip6 nodes
90644b3
go-ipfs-config: update go-multihash and bubble up deps
whyrusleeping a224112
go-ipfs-config: Merge pull request #3523 from ipfs/feat/ipv6-bootstrap
whyrusleeping 4b5929d
go-ipfs-config: update go-libp2p-kad-dht with getclosestpeers fix
whyrusleeping f1cb6fe
go-ipfs-config: Implement basic filestore 'no-copy' functionality
whyrusleeping b40ebf1
go-ipfs-config: Merge pull request #3748 from ipfs/deps/update-dht
whyrusleeping 0d70e83
go-ipfs-config: Add DisableNatPortMap option.
kevina 4d73fe8
go-ipfs-config: add global config switch for sharding
whyrusleeping 4299e72
go-ipfs-config: Merge pull request #3042 from ipfs/feat/hamt-sharding
whyrusleeping 413034b
go-ipfs-config: bubble up updates from go-multihash changes
whyrusleeping 53ceee4
go-ipfs-config: Corenet API: Apply suggestions, cleanups
magik6k 9e050b1
go-ipfs-config: apply the megacheck tool to improve code quality
zramsay 11f5cc6
go-ipfs-config: address PR comments; remove commented/dead code
zramsay 90b6d80
go-ipfs-config: Merge pull request #3943 from magik6k/feat/corenet2
whyrusleeping 08255bc
go-ipfs-config: Allow the use of the Range header in WebTorrent (#3929)
ivan386 c475d31
go-ipfs-config: Disable MDNS in server profile, move it out from init.go
magik6k af57db7
go-ipfs-config: Add test init profile
magik6k 87d7ddb
go-ipfs-config: update go-multihash and bubble up changes
whyrusleeping c875a44
go-ipfs-config: core: make announced swarm addresses configurable
2f2b1fb
go-ipfs-config: Removed tour command and fix test
92d7259
go-ipfs-config: Reprovider strategies
magik6k 5ae8a36
go-ipfs-config: Merge pull request #4113 from ipfs/feat/reprovider-st…
whyrusleeping b4973a5
go-ipfs-config: integrate circuit-relay transport
vyzo f65d6e4
go-ipfs-config: bootstrap: add /dnsaddr nodes, remove half of /ip4,/i…
9c60623
go-ipfs-config: make datastore configuration nicely customizable
whyrusleeping 94a60d3
go-ipfs-config: cleanup and bug fixes
kevina f142bea
go-ipfs-config: bump repo version, remove support for old config
kevina 4eb6ac6
go-ipfs-config: address p.r. comments
kevina 2aa8f02
go-ipfs-config: Address p.r. feedback
kevina 6110648
go-ipfs-config: add badger init profile
whyrusleeping 118baa6
go-ipfs-config: add measure layer to badgerds profile defaults
whyrusleeping 9e4fa0d
go-ipfs-config: add option to set syncWrites to badger
whyrusleeping 842d0d3
go-ipfs-config: remove the rest of the supernode code
Stebalien 810c8e7
go-ipfs-config: Integrate connection manager
whyrusleeping d214226
go-ipfs-config: Merge pull request #4288 from ipfs/feat/connmgr
whyrusleeping 330b646
go-ipfs-config: default settings for the connection manager
whyrusleeping 516673d
go-ipfs-config: extract go-ipfs-addr
whyrusleeping 8061e0a
go-ipfs-config: Merge pull request #4340 from ipfs/feat/extract-ipfsaddr
whyrusleeping a93e251
go-ipfs-config: cmd: use go-ipfs-cmds
keks 8662bbb
go-ipfs-config: gx: massive update
Stebalien 85b87f7
go-ipfs-config: gx: update go-multihash
Stebalien 3de82a7
go-ipfs-config: config: revert profile subcommand
magik6k cb7bc06
go-ipfs-config: config: profile tests, docs
magik6k 151c8dc
go-ipfs-config: conifg-patch: apply review
magik6k c2a7465
go-ipfs-config: config: rename profile.Unapply to Revert
magik6k 2423a8f
go-ipfs-config: config-patch: apply review suggestions
magik6k 4c300c5
go-ipfs-config: config-patch: docs typo, fix server profile
magik6k cdb9c2f
go-ipfs-config: config-patch: Inverse profiles
magik6k 60e814b
go-ipfs-config: cmds: use Executors
f1e0a38
go-ipfs-config: gx: mass update
Stebalien e811add
go-ipfs-config: update go-lib2p-loggables
Stebalien ca129b4
go-ipfs-config: gx: update go-log
Stebalien efb99b5
go-ipfs-config: daemon: config option for routing
magik6k 8d8b02b
go-ipfs-config: init: lowpower profile
magik6k 88d7dfe
go-ipfs-config: config: apply review to lowpower profile
magik6k 020c55a
go-ipfs-config: Fix missing profile docs
magik6k 0c8a2e1
go-ipfs-config: config/profile: disable UPnP/NAT in server profile, docs
magik6k af1fc17
go-ipfs-config: fix error style
magik6k 18dec72
go-ipfs-config: Merge pull request #4846 from ipfs/feat/profile-help
whyrusleeping 97590c7
go-ipfs-config: fix default-net profile not reverting bootstrap config
magik6k a55c0fb
go-ipfs-config: profile: fix test profile tests
magik6k c78cad7
go-ipfs-config: update deps
Stebalien 5455b50
go-ipfs-config: update multiplexers
Stebalien e66b6dd
go-ipfs-config: update gx imports
Stebalien 4a56636
go-ipfs-config: gx update go-log, sys, go-crypto
Stebalien 019e7b2
go-ipfs-config: make ipfs swarm connect /ipfs/QmId work
Stebalien 4b19004
go-ipfs-config: explicitly import go-multiaddr-dns in config/bootstra…
Stebalien 7fded30
go-ipfs-config: gx update
Stebalien ee071db
go-ipfs-config: Add config option to enable urlstore.
kevina 54e8e77
go-ipfs-config: move serialize package to config
magik6k d67080f
go-ipfs-config: Setup gx
magik6k 757f25d
go-ipfs-config: gx-go uw
magik6k 512b4d3
go-ipfs-config: remove version.go
magik6k 212b72f
go-ipfs-config: add pubsub configuration
vyzo fda7020
go-ipfs-config: Merge pull request #3 from ipfs/feat/pubsub
Stebalien 32cf2a6
go-ipfs-config: add QUIC experiment
marten-seemann dd22be5
go-ipfs-config: Merge pull request #4 from marten-seemann/quic
Stebalien 6a618df
go-ipfs-config: allow multiple API/Gateway addresses
Stebalien d7c1f55
go-ipfs-config: Add Gateway.APICommands for /api allowlists
b62629a
go-ipfs-config: Merge pull request #10 from ipfs/feat/gateway-commands
5d245d8
go-ipfs-config: Merge pull request #11 from ipfs/feat/multi-addr
Stebalien 6a3a087
go-ipfs-config: Fix handling of null strings
3258968
go-ipfs-config: Merge pull request #12 from ipfs/fix/null-string
43a6230
go-ipfs-config: add experiment for p2p http proxy
ianopolous 765faf5
go-ipfs-config: Merge pull request #13 from ipfs/feat/p2p-http-proxy
ianopolous 1ca5f8e
go-ipfs-config: Allow the use of the User-Agent header
ivan386 7cecbb9
go-ipfs-config: add pubsub message signing options to config
Stebalien e534f3b
go-ipfs-config: Merge pull request #18 from ipfs/feat/pubsub-message-…
Stebalien 77a3e94
go-ipfs-config: profile: add badger truncate option
schomatis b83ea09
go-ipfs-config: change randomports Description
tarekbadrsh bf2923e
go-ipfs-config: autorelay options
vyzo 008c926
go-ipfs-config: Merge pull request #21 from ipfs/feat/autorelay
Stebalien 7735514
go-ipfs-config: Merge pull request #15 from ivan386/patch-1
Stebalien 16f3d22
go-ipfs-config: Merge pull request #17 from tarekbadrshalaan/feat/pro…
Stebalien b627585
go-ipfs-config: add a Clone function
Stebalien 3cd45d8
go-ipfs-config: add tests for the "Strings" type
Stebalien e4282bd
go-ipfs-config: Add one more test for config.Clone
magik6k b251798
go-ipfs-config: Merge pull request #16 from ipfs/fix/thread-safety
Stebalien bc31fd9
go-ipfs-config: Add Gateway.NoFetch
magik6k ca406e1
go-ipfs-config: Merge pull request #19 from ipfs/feat/gw-nofetch
magik6k 3475f83
go-ipfs-config: add an experiment to prefer TLS over secio
marten-seemann a75c9b7
go-ipfs-config: Merge pull request #32 from marten-seemann/prefer-tls
Stebalien c920b46
go-ipfs-config: Closes: #6284 Add appropriate IPv6 ranges to defaultS…
62c4b48
go-ipfs-config: Merge pull request #34 from teran-mckinney/master
Stebalien b2029f1
go-ipfs-config: Add provider system experiment
michaelavila e1c26d5
go-ipfs-config: Merge pull request #33 from ipfs/experiment/provider-…
michaelavila e76a8cf
go-ipfs-config: migrate to the consolidated libp2p
Stebalien ae7c2e9
go-ipfs-config: Merge pull request #36 from ipfs/migrate-libp2p
Stebalien e9c30cf
go-ipfs-config: fix string formatting of bootstrap peers
Stebalien a7d7f22
go-ipfs-config: Merge pull request #37 from ipfs/fix/formatting-boots…
Stebalien f61d052
go-ipfs-config: Add very basic (possibly temporary) Provider configs
michaelavila 86abf1f
go-ipfs-config: Fix bad go fmt
michaelavila 3692ba8
go-ipfs-config: Merge pull request #38 from ipfs/features/add-provide…
Stebalien a7ff340
go-ipfs-config: chore: bump minimum key size to 2048
Stebalien a04a858
go-ipfs-config: add plugins config section
Stebalien 1f6f939
go-ipfs-config: Merge pull request #43 from ipfs/feat/plugin-config
Stebalien 25e3e19
go-ipfs-config: nit: omit empty plugin values
Stebalien 356880a
go-ipfs-config: Merge pull request #44 from ipfs/nit/omitempty-plugin
Stebalien 40bc237
go-ipfs-config: make it easier to detect an uninitialized repo
Stebalien a052688
go-ipfs-config: Merge pull request #45 from ipfs/fix/is-not-exist
Stebalien f0b5fe9
go-ipfs-config: plugins: don't omit empty config values
Stebalien ad3cb6c
go-ipfs-config: Merge pull request #46 from ipfs/fix/no-omitempty
Stebalien 66886eb
go-ipfs-config: fix(init): use key size constraints defined in libp2p
Stebalien 944d62b
go-ipfs-config: Merge pull request #57 from ipfs/fix/generic-key-size
Stebalien d0d55a8
go-ipfs-config: migrate multiaddrs from /ipfs -> /p2p
Stebalien ba29412
go-ipfs-config: Merge pull request #39 from ipfs/feat/ipfs-to-p2p
Stebalien 95a14f4
go-ipfs-config: profile: badger profile now defaults to asynchronous …
aschmahmann 357e86d
go-ipfs-config: Merge pull request #60 from ipfs/defaults/badger-async
Stebalien 7dfdeeb
go-ipfs-config: feat: add graphsync option
Stebalien 265f8cf
go-ipfs-config: add config options for proxy/subdomain
lidel 7a22748
go-ipfs-config: Merge pull request #30 from ipfs/feat/gateway-subdomains
Stebalien f455264
go-ipfs-config: feat: remove old bootstrap peers
Stebalien fe9db1c
go-ipfs-config: Merge pull request #67 from ipfs/feat/remove-old-boot…
Stebalien f83f2b1
go-ipfs-config: chore: remove unnecessary dependency
Stebalien 51770f5
go-ipfs-config: Merge pull request #68 from ipfs/chore/remove-dep
Stebalien cc723f9
go-ipfs-config: feat: mark badger as stable
Stebalien 542ca92
go-ipfs-config: feat: remove PreferTLS experiment
Stebalien 94994aa
go-ipfs-config: Merge pull request #71 from ipfs/chore/remove-prefer-tls
Stebalien 0f2ebaa
go-ipfs-config: Merge pull request #70 from ipfs/feat/badger-stable
Stebalien 043f20c
go-ipfs-config: feat: add private routing config field
Stebalien 7b92251
go-ipfs-config: doc: add a bit of documentation.
Stebalien c030db0
go-ipfs-config: Merge pull request #73 from ipfs/feat/add-private-rou…
Stebalien ab3a78d
go-ipfs-config: feat: remove Routing.PrivateType
Stebalien 8b77ad2
go-ipfs-config: Merge pull request #74 from ipfs/feat/remove-private
Stebalien 4554fc9
go-ipfs-config: feat: add an autonat config section
Stebalien 3c6a974
go-ipfs-config: Merge pull request #75 from ipfs/feat/autonat
Stebalien 25a96cf
go-ipfs-config: feat: add and use a duration helper type
Stebalien 08c4a24
go-ipfs-config: Merge pull request #76 from ipfs/feat/duration-type
Stebalien cf3fa1b
go-ipfs-config: feat: disable autonat service when in lowpower mode
Stebalien 48dc791
go-ipfs-config: Merge pull request #77 from ipfs/feat/disable-autonat…
Stebalien d02cdb3
go-ipfs-config: Add Init Alternative allowing specification of ED2551…
willscott c6336c3
go-ipfs-config: interface
willscott 515d690
go-ipfs-config: fix: correct the default-datastore config profile
Stebalien 23817a3
go-ipfs-config: Merge pull request #80 from ipfs/fix/default-datastore
Stebalien a70d82e
go-ipfs-config: add test validating that createIdentity follows algor…
willscott eaf1cc8
go-ipfs-config: Merge pull request #78 from ipfs/feat/ed25519init
willscott ed0f306
go-ipfs-config: feat: remove strict signing pubsub option.
Stebalien 00a7c6a
go-ipfs-config: Merge pull request #90 from ipfs/feat/remove-strict-s…
Stebalien ca70989
go-ipfs-config: default config: add QUIC listening ports + quic to ma…
RubenKelevra c3cd359
go-ipfs-config: Merge pull request #91 from RubenKelevra/feat/default…
Stebalien 7f51e84
go-ipfs-config: QUIC: remove experimental config option
RubenKelevra 5f248ac
go-ipfs-config: fix boostrap peers
RubenKelevra 984de70
go-ipfs-config: Merge pull request #94 from RubenKelevra/fix/bootstra…
Stebalien 45f2784
go-ipfs-config: Merge pull request #93 from RubenKelevra/feat/quic_re…
Stebalien ba2e10a
go-ipfs-config: fix: include key size in key init method
Stebalien 435b942
go-ipfs-config: Merge pull request #95 from ipfs/fix/key-init-message
Stebalien 13bcc4d
go-ipfs-config: feat: add peering service config section
Stebalien 75bde89
go-ipfs-config: doc: improve wording for peering config
Stebalien a346451
go-ipfs-config: Merge pull request #96 from ipfs/feat/peering-service
Stebalien e69fcd9
go-ipfs-config: feat: add an option for security transport experiments
Stebalien 3d90053
go-ipfs-config: Merge pull request #97 from ipfs/feat/sec-transport-e…
Stebalien 9ebfb49
go-ipfs-config: fix: remove group permissions
Stebalien 89e73d9
go-ipfs-config: Merge pull request #98 from ipfs/fix/default-perms
Stebalien dfe53cd
go-ipfs-config: feat: add flag and priority types
Stebalien 4f3aeb7
go-ipfs-config: feat: add a transports section for enabling/disabling…
Stebalien 57089fd
go-ipfs-config: feat: remove OverrideSecurityTransports
Stebalien 7ce67b8
go-ipfs-config: feat: add WithDefault for flag/priority
Stebalien 0f17ef6
go-ipfs-config: doc(swarm): fix autorelay description
Stebalien f74d15e
go-ipfs-config: fix: fix type name typo
Stebalien f55b515
go-ipfs-config: doc(swarm): extend autorelay docs
Stebalien e26444e
go-ipfs-config: fix typo
Stebalien 5c1b4cd
go-ipfs-config: doc: document Flag.WithDefault
Stebalien 38ad98d
go-ipfs-config: fix: remove undefined support from unmarshal
Stebalien 44e005e
go-ipfs-config: fix: panic on invalid priority/flag values
Stebalien 9e480f6
go-ipfs-config: Merge pull request #102 from ipfs/feat/transports
Stebalien da97929
go-ipfs-config: error if bit size specified with ed25519 keys (#105)
petar 1ec9262
go-ipfs-config: Add badger2 profile and config spec
gammazero 74dcf42
go-ipfs-config: Remove badger2 profile
gammazero d445c0c
go-ipfs-config: Merge pull request #115 from ipfs/chore/rm-badger2
aschmahmann 06fe967
go-ipfs-config: add remote pinning services config
aschmahmann d643a2b
go-ipfs-config: go fmt
aschmahmann ba6b029
go-ipfs-config: Merge pull request #113 from ipfs/petar/remotepin
aschmahmann 2690c10
go-ipfs-config: add support for pinning mfs (#116)
aschmahmann f5fb70e
go-ipfs-config: remove duplicate entries in defaultServerFilters
RubenKelevra 8a8b161
go-ipfs-config: add custom DNS Resolver configuration
vyzo 28553d7
go-ipfs-config: simplify DNS config
vyzo f264de4
go-ipfs-config: update comments
vyzo c932e6b
go-ipfs-config: add default empty config for DNS, rename struct from …
vyzo 4b1ae41
go-ipfs-config: Merge pull request #126 from ipfs/feat/custom-resolver
vyzo 67456e2
go-ipfs-config: Add config for downloading repo migrations
gammazero 5e6df6f
go-ipfs-config: unit test for migration config
gammazero 98052e9
go-ipfs-config: Merge pull request #121 from RubenKelevra/patch-1
aschmahmann ec1659d
go-ipfs-config: Init migration config with empty values
gammazero dbb5fa7
go-ipfs-config: Fix comment
gammazero 4b778ce
go-ipfs-config: Removed Peers from migration config
gammazero f7b64b3
go-ipfs-config: Merge pull request #128 from ipfs/feat/migration-config
Stebalien 22d2b6b
go-ipfs-config: add option for Accelerated DHT Client experiment
aschmahmann fc761b1
go-ipfs-config: Merge pull request #125 from ipfs/feat/experimental-d…
aschmahmann e7bb833
go-ipfs-config: [LINT] error strings should not end with punctuation …
mburns b14afc2
go-ipfs-config: Merge pull request #131 from ipfs/fix-staticcheck
marten-seemann 8f09fa5
go-ipfs-config: run gofmt -s
web3-bot ea17b50
go-ipfs-config: Merge pull request #132 from ipfs/web3-bot/sync
marten-seemann c692e73
go-ipfs-config: fix: remove deprecated calls
Stebalien d00f8a1
go-ipfs-config: Merge pull request #138 from ipfs/fix/deprecation
Stebalien 7c1029c
go-ipfs-config: fix: make sure the Priority type properly implements …
aschmahmann ac81804
go-ipfs-config: feat: add an OptionalInteger type
aschmahmann 4429117
go-ipfs-config: feat: add Internal and Internal.Bitswap config options
petar 2cf170d
go-ipfs-config: feat: add an OptionalDuration type (#148)
marten-seemann 9eaf572
go-ipfs-config: feat: pubsub and ipns pubsub flags (#145)
jwh cdaa222
go-ipfs-config: feat: OptionalString type and UnixFSShardingSizeThres…
aschmahmann ba9d9f6
go-ipfs-config: fix: String method on the OptionalString (#153)
marten-seemann d226879
go-ipfs-config: feat: Swarm.RelayService (circuit v2) (#146)
marten-seemann dcf17eb
go-ipfs-config: improve AutoRelay configuration, add config option fo…
marten-seemann bf3a2ca
go-ipfs-config: set Swarm.EnableAutoRelay to omitempty
marten-seemann aefce5a
go-ipfs-config: refactor: AutoRelay → RelayClient
lidel 1b4502c
go-ipfs-config: Merge pull request #154 from ipfs/static-relays
aschmahmann 7fe155c
go-ipfs-config: feat: add a flag to enable the hole punching service …
marten-seemann 5ca8226
go-ipfs-config: chore: update comment to match struct
lidel d50960f
go-ipfs-config: chore: omitempty Experimental.ShardingEnabled (#158)
lidel ded27a5
go-ipfs-config: feat: omitempty Swarm.EnableRelayHop for circuit v1 m…
marten-seemann a6008f0
go-ipfs-config: feat: add Addresses.AppendAnnounce (#135)
Jorropo 9a0bd0f
go-ipfs-config: feat: add DNS.MaxCacheTTL for DNS-over-HTTPS resolver…
thibmeu 74e6436
go-ipfs-config: docs: updated flatfs/badger profile helptext (#167)
lidel 783092e
Merge remote-tracking branch 'config/master' into feat/add-back-ipfs-…
laurentsenta c9cf47d
config: remove go-ipfs-config code
laurentsenta 8d549f0
fix: rewrite dependencies over the go-ipfs-config package
laurentsenta 6379013
ci: tweak example testing to pass with internal config package
laurentsenta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package config | ||
|
||
// Addresses stores the (string) multiaddr addresses for the node. | ||
type Addresses struct { | ||
Swarm []string // addresses for the swarm to listen on | ||
Announce []string // swarm addresses to announce to the network, if len > 0 replaces auto detected addresses | ||
AppendAnnounce []string // similar to Announce but doesn't overwride auto detected addresses, they are just appended | ||
NoAnnounce []string // swarm addresses not to announce to the network | ||
API Strings // address for the local API (RPC) | ||
Gateway Strings // address to listen on for IPFS HTTP object gateway | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package config | ||
|
||
type API struct { | ||
HTTPHeaders map[string][]string // HTTP headers to return with the API. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package config | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// AutoNATServiceMode configures the ipfs node's AutoNAT service. | ||
type AutoNATServiceMode int | ||
|
||
const ( | ||
// AutoNATServiceUnset indicates that the user has not set the | ||
// AutoNATService mode. | ||
// | ||
// When unset, nodes configured to be public DHT nodes will _also_ | ||
// perform limited AutoNAT dialbacks. | ||
AutoNATServiceUnset AutoNATServiceMode = iota | ||
// AutoNATServiceEnabled indicates that the user has enabled the | ||
// AutoNATService. | ||
AutoNATServiceEnabled | ||
// AutoNATServiceDisabled indicates that the user has disabled the | ||
// AutoNATService. | ||
AutoNATServiceDisabled | ||
) | ||
|
||
func (m *AutoNATServiceMode) UnmarshalText(text []byte) error { | ||
switch string(text) { | ||
case "": | ||
*m = AutoNATServiceUnset | ||
case "enabled": | ||
*m = AutoNATServiceEnabled | ||
case "disabled": | ||
*m = AutoNATServiceDisabled | ||
default: | ||
return fmt.Errorf("unknown autonat mode: %s", string(text)) | ||
} | ||
return nil | ||
} | ||
|
||
func (m AutoNATServiceMode) MarshalText() ([]byte, error) { | ||
switch m { | ||
case AutoNATServiceUnset: | ||
return nil, nil | ||
case AutoNATServiceEnabled: | ||
return []byte("enabled"), nil | ||
case AutoNATServiceDisabled: | ||
return []byte("disabled"), nil | ||
default: | ||
return nil, fmt.Errorf("unknown autonat mode: %d", m) | ||
} | ||
} | ||
|
||
// AutoNATConfig configures the node's AutoNAT subsystem. | ||
type AutoNATConfig struct { | ||
// ServiceMode configures the node's AutoNAT service mode. | ||
ServiceMode AutoNATServiceMode `json:",omitempty"` | ||
|
||
// Throttle configures AutoNAT dialback throttling. | ||
// | ||
// If unset, the conservative libp2p defaults will be unset. To help the | ||
// network, please consider setting this and increasing the limits. | ||
// | ||
// By default, the limits will be a total of 30 dialbacks, with a | ||
// per-peer max of 3 peer, resetting every minute. | ||
Throttle *AutoNATThrottleConfig `json:",omitempty"` | ||
} | ||
|
||
// AutoNATThrottleConfig configures the throttle limites | ||
type AutoNATThrottleConfig struct { | ||
// GlobalLimit and PeerLimit sets the global and per-peer dialback | ||
// limits. The AutoNAT service will only perform the specified number of | ||
// dialbacks per interval. | ||
// | ||
// Setting either to 0 will disable the appropriate limit. | ||
GlobalLimit, PeerLimit int | ||
|
||
// Interval specifies how frequently this node should reset the | ||
// global/peer dialback limits. | ||
// | ||
// When unset, this defaults to 1 minute. | ||
Interval OptionalDuration `json:",omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package config | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
peer "github.com/libp2p/go-libp2p-core/peer" | ||
ma "github.com/multiformats/go-multiaddr" | ||
) | ||
|
||
// DefaultBootstrapAddresses are the hardcoded bootstrap addresses | ||
// for IPFS. they are nodes run by the IPFS team. docs on these later. | ||
// As with all p2p networks, bootstrap is an important security concern. | ||
// | ||
// NOTE: This is here -- and not inside cmd/ipfs/init.go -- because of an | ||
// import dependency issue. TODO: move this into a config/default/ package. | ||
var DefaultBootstrapAddresses = []string{ | ||
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN", | ||
"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa", | ||
"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb", | ||
"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt", | ||
"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", // mars.i.ipfs.io | ||
"/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", // mars.i.ipfs.io | ||
} | ||
|
||
// ErrInvalidPeerAddr signals an address is not a valid peer address. | ||
var ErrInvalidPeerAddr = errors.New("invalid peer address") | ||
|
||
func (c *Config) BootstrapPeers() ([]peer.AddrInfo, error) { | ||
return ParseBootstrapPeers(c.Bootstrap) | ||
} | ||
|
||
// DefaultBootstrapPeers returns the (parsed) set of default bootstrap peers. | ||
// if it fails, it returns a meaningful error for the user. | ||
// This is here (and not inside cmd/ipfs/init) because of module dependency problems. | ||
func DefaultBootstrapPeers() ([]peer.AddrInfo, error) { | ||
ps, err := ParseBootstrapPeers(DefaultBootstrapAddresses) | ||
if err != nil { | ||
return nil, fmt.Errorf(`failed to parse hardcoded bootstrap peers: %s | ||
This is a problem with the ipfs codebase. Please report it to the dev team`, err) | ||
} | ||
return ps, nil | ||
} | ||
|
||
func (c *Config) SetBootstrapPeers(bps []peer.AddrInfo) { | ||
c.Bootstrap = BootstrapPeerStrings(bps) | ||
} | ||
|
||
// ParseBootstrapPeer parses a bootstrap list into a list of AddrInfos. | ||
func ParseBootstrapPeers(addrs []string) ([]peer.AddrInfo, error) { | ||
maddrs := make([]ma.Multiaddr, len(addrs)) | ||
for i, addr := range addrs { | ||
var err error | ||
maddrs[i], err = ma.NewMultiaddr(addr) | ||
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
return peer.AddrInfosFromP2pAddrs(maddrs...) | ||
} | ||
|
||
// BootstrapPeerStrings formats a list of AddrInfos as a bootstrap peer list | ||
// suitable for serialization. | ||
func BootstrapPeerStrings(bps []peer.AddrInfo) []string { | ||
bpss := make([]string, 0, len(bps)) | ||
for _, pi := range bps { | ||
addrs, err := peer.AddrInfoToP2pAddrs(&pi) | ||
if err != nil { | ||
// programmer error. | ||
panic(err) | ||
} | ||
for _, addr := range addrs { | ||
bpss = append(bpss, addr.String()) | ||
} | ||
} | ||
return bpss | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package config | ||
|
||
import ( | ||
"sort" | ||
"testing" | ||
) | ||
|
||
func TestBoostrapPeerStrings(t *testing.T) { | ||
parsed, err := ParseBootstrapPeers(DefaultBootstrapAddresses) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
formatted := BootstrapPeerStrings(parsed) | ||
sort.Strings(formatted) | ||
expected := append([]string{}, DefaultBootstrapAddresses...) | ||
sort.Strings(expected) | ||
|
||
for i, s := range formatted { | ||
if expected[i] != s { | ||
t.Fatalf("expected %s, %s", expected[i], s) | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a smart failsafe, good to keep this around to detect any future regressions 👍