Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

feat: added support for pinning service configs #104

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootstrap_peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var DefaultBootstrapAddresses = []string{
"/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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously missed go fmt

"/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
}

Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Config struct {
AutoNAT AutoNATConfig
Pubsub PubsubConfig
Peering Peering
Pinning Pinning

Provider Provider
Reprovider Reprovider
Expand Down
13 changes: 13 additions & 0 deletions pinning.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package config

// Pinning configures the pinning services.
type Pinning struct {
// Services lists the pinning services
Services []PinningServices
Copy link
Member

@lidel lidel Sep 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aschmahmann @jacobheun Q: How are we going to store automated policy per Pinning service?

IIUC we will have the default which is manual (null and/or explicit manual?) and there will be opt-in mfs-root policy, which enables remote pin on every MFS root change.

Do we need to add an array PinningService.Policies?

Copy link
Member

@lidel lidel Nov 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aschmahmann @petar
I believe we need array. For now it will be either "manual" or "all in MFS", but I can imagine the future when one can have both MFS and local pins mirrored to remote service:

Policies: ["mfs-root", "local-pins"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I think there should be an array of policies per service. I think @petar wasn't sure if we wanted Pinning.RemoteServices to be an array or a map indexed by the service name.

aschmahmann marked this conversation as resolved.
Show resolved Hide resolved
}

type PinningServices struct {
aschmahmann marked this conversation as resolved.
Show resolved Hide resolved
Name string
ApiEndpoint string
ApiKey string
lidel marked this conversation as resolved.
Show resolved Hide resolved
}