{"id":21643957,"url":"https://github.com/application-research/whypfs-core","last_synced_at":"2025-04-11T18:21:59.923Z","repository":{"id":63692698,"uuid":"569492288","full_name":"application-research/whypfs-core","owner":"application-research","description":"Lightweight IPFS-network peer embeddable library","archived":false,"fork":false,"pushed_at":"2023-09-20T07:57:04.000Z","size":168,"stargazers_count":10,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T18:21:42.402Z","etag":null,"topics":["blockstore","datastore","network","node","peer","whypfs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/application-research.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-23T00:21:10.000Z","updated_at":"2023-11-29T00:41:39.000Z","dependencies_parsed_at":"2023-02-09T12:16:38.721Z","dependency_job_id":null,"html_url":"https://github.com/application-research/whypfs-core","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/application-research%2Fwhypfs-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/application-research%2Fwhypfs-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/application-research%2Fwhypfs-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/application-research%2Fwhypfs-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/application-research","download_url":"https://codeload.github.com/application-research/whypfs-core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456387,"owners_count":21106607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockstore","datastore","network","node","peer","whypfs"],"created_at":"2024-11-25T05:37:05.490Z","updated_at":"2025-04-11T18:21:59.877Z","avatar_url":"https://github.com/application-research.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WhyPFS Core\n\n![go build](https://github.com/application-research/whypfs-core/actions/workflows/go.yml/badge.svg)\n![code ql](https://github.com/application-research/whypfs-core/actions/workflows/codeql.yml/badge.svg)\n\nA lightweight importable library to run a WhyPFS node.\n\nEasiest way to setup an WhyPFS / Estuary core node that peers with any nodes within the IPFS network. This core library decouples the\nnode initialization setup based on the Why's https://github.com/whyrusleeping/whypfs\n\n# Features\n- Significantly improved default Bitswap parameters\n- Default usage of the accelerated DHT client\n- Default flatfs parameters work well at large scales on good filesystems (ext4, xfs, probably others)\n\n\n# Setup a new WhyPFS node\nUsing the default will give the most optimal configuration based on whyPFS. It'll also use the default\nboostrap nodes.\n\n```shell\ngo get github.com/application-research/whypfs-core\n```\n\n## Setup a node\n```\npeer, err := NewNode(NewNodeParams{Ctx: context.Background()})\t\nif err != nil {\n    t.Fatal(err)\n}\n```\n\n## Set up a node with your own config\n```\n// initialize a node parameter\nparams := NewNodeParams{\n    Ctx:       context.Background(),\n    Datastore: NewInMemoryDatastore(),\n}\n\n// create a new config of your own\nnewConfig := \u0026Config{\n    Offline:           true,\n    ReprovideInterval: 0,\n    Libp2pKeyFile:     \"mykey\",\n    ListenAddrs:       []string{\"/ip4/127.0.0.1/tcp/0\"},\n    AnnounceAddrs:     nil,\n    DatastoreDir: struct {\n        Directory string\n        Options   leveldb.Options\n    }{},\n    Blockstore:              \"\",\n    NoBlockstoreCache:       false,\n    NoAnnounceContent:       false,\n    NoLimiter:               false,\n    BitswapConfig:           BitswapConfig{},\n    ConnectionManagerConfig: ConnectionManager{},\n}\n\n// set it\nparams.Config = params.ConfigurationBuilder(newConfig)\nmyNode, err := NewNode(params)\nif err1 != nil {\n    t.Fatal(err)\n}\n```\n\n## Add/Pin and Get a file\n```\nnode, err := peer.AddPinFile(context.Background(), bytes.NewReader([]byte(\"letsrebuildtolearnnewthings!\")), nil)\ncontent, err := peer.GetFile(context.Background(), node.Cid())\n```\n\n## Add/Pin Directory and Get the ipld.Node of the directory\n```\nnode, err := peer.AddPinDirectory(context.Background(), \"./test/test_directory\")\nmainDirNode, err := peer.GetDirectory(context.Background(), node)\n```\n\n## Provides\n- An ipld.DAGService.\n- AddPinFile method to add a file to a node\n- AddPinDirectory function to add a directory to a node\n- GetFile function to get a file using a CID\n- GetDirectory function to retrieve an entire directory from a ipld.Node\n- Custom bootstrap nodes\n\n## Examples\nThere are a few examples on how to utilize the node which includes\n- how to create a running peer node.\n- how to create a CAR file and add it to the peer node\n- how to add a file / dir to the peer node.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplication-research%2Fwhypfs-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapplication-research%2Fwhypfs-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplication-research%2Fwhypfs-core/lists"}