-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99bb7f7
commit 49ed9ce
Showing
11 changed files
with
163 additions
and
38 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/data-preservation-programs/RetrievalBot/pkg/env" | ||
"github.com/ipfs/go-cid" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestInitializeCidsToRetrieve(t *testing.T) { | ||
challenge4 := initializeCidsToRetrieve(4, cid.Cid{}) | ||
|
||
assert.Equal(t, 1, len(challenge4)) | ||
} | ||
|
||
func TestValidateGetMaxChallengesPerLevel(t *testing.T) { | ||
t.Setenv("MAX_CHALLENGES_PER_LEVEL", "5") | ||
var challenges = env.GetInt(env.MaxChallengesPerLevel, 5) | ||
assert.Equal(t, 5, challenges) | ||
|
||
t.Setenv("MAX_CHALLENGES_PER_LEVEL", "50") | ||
challenges = env.GetInt(env.MaxChallengesPerLevel, 50) | ||
assert.Equal(t, 50, challenges) | ||
} |
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
6 changes: 6 additions & 0 deletions
6
...box/bafybeib62b4ukyzjcj7d2h4mbzjgg7l6qiz3ma4vb4b2bawmcauf5afvua/@AggregateManifest.ndjson
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,6 @@ | ||
{"RecordType":"DagAggregatePreamble","Version":1} | ||
{"RecordType":"DagAggregateSummary","EntryCount":4,"EntriesSortedBy":"DagCidV1","Description":"Aggregate of non-related DAGs, produced by github.com/filecoin-project/go-dagaggregator-unixfs"} | ||
{"RecordType":"DagAggregateEntry","DagCidV1":"bafkreialad2qaplrgjs2x2rs4fycwmwmpmocantoho3doxulmbmlrg6qea","PathPrefixes":["baf...ea","baf...6qea"],"PathIndexes":[1,0,0]} | ||
{"RecordType":"DagAggregateEntry","DagCidV1":"bafkreiarcpog7fgb3cvs4iznh6jcqtxgyyk5rbsmk4dvxuty5tylof6qea","PathPrefixes":["baf...ea","baf...6qea"],"PathIndexes":[1,0,1]} | ||
{"RecordType":"DagAggregateEntry","DagCidV1":"bafkreihjji2ny4zwyh7ubc3bmdb5tj455vi5fhsbwf2uvcw6l75z446qea","PathPrefixes":["baf...ea","baf...6qea"],"PathIndexes":[1,0,2]} | ||
{"RecordType":"DagAggregateEntry","DagCidV1":"bafybeibhbx3y6tnn7q4gpsous6apnobft5jybvroiepdsmvps2lmycjjxu","DagCidV0":"QmQy6xmJhrcC5QLboAcGFcAE1tC8CrwDVkrHdEYJkLscrQ","DagSize":42,"NodeCount":1,"PathPrefixes":["baf...xu","baf...jjxu"],"PathIndexes":[2,0,0]} |
Binary file added
BIN
+65.2 KB
...auf5afvua/baf...ea/baf...6qea/bafkreialad2qaplrgjs2x2rs4fycwmwmpmocantoho3doxulmbmlrg6qea
Binary file not shown.
Binary file added
BIN
+99.3 KB
...auf5afvua/baf...ea/baf...6qea/bafkreiarcpog7fgb3cvs4iznh6jcqtxgyyk5rbsmk4dvxuty5tylof6qea
Binary file not shown.
Binary file added
BIN
+170 KB
...auf5afvua/baf...ea/baf...6qea/bafkreihjji2ny4zwyh7ubc3bmdb5tj455vi5fhsbwf2uvcw6l75z446qea
Binary file not shown.
53 changes: 53 additions & 0 deletions
53
...auf5afvua/baf...xu/baf...jjxu/bafybeibhbx3y6tnn7q4gpsous6apnobft5jybvroiepdsmvps2lmycjjxu
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,53 @@ | ||
|
||
IPFS -- Inter-Planetary File system | ||
|
||
IPFS is a global, versioned, peer-to-peer filesystem. It combines good ideas | ||
from Git, BitTorrent, Kademlia, SFS, and the Web. It is like a single bit- | ||
torrent swarm, exchanging git objects. IPFS provides an interface as simple | ||
as the HTTP web, but with permanence built-in. You can also mount the world | ||
at /ipfs. | ||
|
||
IPFS is a protocol: | ||
- defines a content-addressed file system | ||
- coordinates content delivery | ||
- combines Kademlia + BitTorrent + Git | ||
|
||
IPFS is a filesystem: | ||
- has directories and files | ||
- mountable filesystem (via FUSE) | ||
|
||
IPFS is a web: | ||
- can be used to view documents like the web | ||
- files accessible via HTTP at `http://ipfs.io/<path>` | ||
- browsers or extensions can learn to use `ipfs://` directly | ||
- hash-addressed content guarantees the authenticity | ||
|
||
IPFS is modular: | ||
- connection layer over any network protocol | ||
- routing layer | ||
- uses a routing layer DHT (kademlia/coral) | ||
- uses a path-based naming service | ||
- uses BitTorrent-inspired block exchange | ||
|
||
IPFS uses crypto: | ||
- cryptographic-hash content addressing | ||
- block-level deduplication | ||
- file integrity + versioning | ||
- filesystem-level encryption + signing support | ||
|
||
IPFS is p2p: | ||
- worldwide peer-to-peer file transfers | ||
- completely decentralized architecture | ||
- **no** central point of failure | ||
|
||
IPFS is a CDN: | ||
- add a file to the filesystem locally, and it's now available to the world | ||
- caching-friendly (content-hash naming) | ||
- BitTorrent-based bandwidth distribution | ||
|
||
IPFS has a name service: | ||
- IPNS, an SFS inspired name system | ||
- global namespace based on PKI | ||
- serves to build trust chains | ||
- compatible with other NSes | ||
- can map DNS, .onion, .bit, etc to IPNS |