{"id":15811341,"url":"https://github.com/jgantunes/ipfs-testbed","last_synced_at":"2025-08-29T01:31:28.246Z","repository":{"id":79598248,"uuid":"171580033","full_name":"JGAntunes/ipfs-testbed","owner":"JGAntunes","description":"An IPFS testbed for Kubernetes using Toxiproxy","archived":false,"fork":false,"pushed_at":"2021-09-24T08:07:02.000Z","size":4974,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-06T04:01:30.817Z","etag":null,"topics":["elk","ipfs","js","kubernetes","testbed","toxiproxy"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JGAntunes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-20T01:39:26.000Z","updated_at":"2024-05-30T12:24:42.000Z","dependencies_parsed_at":"2023-05-12T23:30:43.388Z","dependency_job_id":null,"html_url":"https://github.com/JGAntunes/ipfs-testbed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JGAntunes%2Fipfs-testbed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JGAntunes%2Fipfs-testbed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JGAntunes%2Fipfs-testbed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JGAntunes%2Fipfs-testbed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JGAntunes","download_url":"https://codeload.github.com/JGAntunes/ipfs-testbed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231311646,"owners_count":18356593,"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":["elk","ipfs","js","kubernetes","testbed","toxiproxy"],"created_at":"2024-10-05T04:01:08.963Z","updated_at":"2024-12-26T05:13:07.473Z","avatar_url":"https://github.com/JGAntunes.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JS IPFS Testbed\n\nA testbed for [JS-IPFS](https://github.com/ipfs/js-ipfs) built using [Toxiproxy](https://github.com/shopify/toxiproxy) and [Kubernetes](kubernetes.io). It's designed to work locally in your Minkube setup or it can be deployed in any current K8s cluster you have and scale it up as much as you like.\n\n![dashboard](./images/dashboard.png)\n\n![discovery](./images/discovery.png)\n\n## Goals\n\nThe purpose of this testbed is to run tests for my [M.Sc. Thesis project, Pulsarcast](https://github.com/JGAntunes/pulsarcast). What I was looking for initially was:\n\n- Configure and deploy a large amount of IPFS nodes in an automated and predictable way\n- Scale as much as our wallet can afford :money_with_wings::money_with_wings:\n- Interaction with the nodes should:\n  - Be simple and allow automation/scripts to be built on top of it\n  - Allow to target commands to a specific node\n  - Allow to target commands at a random node\n- Allow to simulate network failures, latency and other relevant issues\n- Continuously monitor and collect relevant data from the IPFS deployments and the resources used (network, disk, memory, CPU)\n\n## How it works\n\n### IPFS and Toxiproxy\n\nWe deploy using [Helm](https://helm.sh) and use a [specific chart](https://github.com/JGAntunes/helm-charts/tree/master/ipfs-testbed) that deploys in a single pod an IPFS node and a Toxiproxy container as a sidecar, through where all the libp2p-swarm communication flows. Each deployment exposes the IPFS HTTP API, the Toxiproxy HTTP API and the libp2p-swarm TCP port proxied by toxiproxy.\n\nA service of type [`NodePort`](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) is created for each deployment, exposing each IPFS Node in a random port at each K8s Node (in the future ingreses might be considered). This also makes each [IPFS node discoverable using the DNS records created by K8s for each service](https://kubernetes.io/docs/concepts/services-networking/service/#dns).\n\nReadiness and liveness probes are configured by default, as well as the proxy setup for [libp2p-swarm default TCP port](https://github.com/ipfs/js-ipfs/blob/master/src/core/runtime/config-nodejs.js#L6).\n\nYou can fine tune the config of both Toxiproxy and IPFS, including even the docker images used, using the [available options at the Helm chart](https://github.com/JGAntunes/helm-charts/blob/master/ipfs-testbed/values.yaml).\n\n### Test and interaction\n\nThe deployment described above gives you two HTTP APIs that allow you to run [toxics](https://github.com/shopify/toxiproxy#toxics) (network interferance) and IPFS commands at each node.\n\nWith this in mind we've build a CLI utility to cut down the burden of interacting with any specific node, running IPFS commands, or create/delete toxics.\n\n### Monitoring and collecting data/results\n\nThe final component of the testbed is an ELK setup ([Elasticsearch](https://www.elastic.co/products/elasticsearch), [Logstash](https://www.elastic.co/products/logstash) and [Kibana](https://www.elastic.co/products/kibana)), also deployed in Kubernetes, used to monitor and collect data from your IPFS nodes. [Filebeat](https://www.elastic.co/products/beats/filebeat) and [Metricbeat](https://www.elastic.co/products/beats/metricbeat) are used to read the logs and metrics from your k8s cluster, forward these to logstash for processing which finally stores it in Elasticsearch. Kibana provides an UI from where you can query your data and build visualizations with it (some are already available in this repo, but you're of course free to add more).\n\n**Note:** There's a set of Kibana dashboards you can reuse under the [dashboards directory](./dashboards)\n\n## Requirements\n\nIn order to use and run everything in here you'll need:\n\n- `kubernetes` cluster  `\u003e=v1.9`\n- `kubectl`\n- `helm`\n- `bash`\n- `jq`\n- `make`\n- `nodejs` `\u003e=8` in order to use the cli\n\n**IMPORTANT**: both the CLI and the `Makefiles` will use your current kube context, so make sure to have the right cluster selected before jumping on this.\n\n## Install\n\nClone the repo:\n\n```\ngit clone git@github.com:JGAntunes/ipfs-testbed.git\n```\n\nAll the Kubernetes setup we use is modularised and prepared to be installed using `make` so that you're free to setup and use what you feel fits your needs.\n\nIf you want to, you can deploy everything ofc.\n\nRun thtough the sub dirs in `./kubernetes` and run `make` (except for `ipfs-testbed`, that will be the next and final deployment step)\n\nFinally, deploy `ipfs-testbed` selecting the option that best suits you:\n\n```\n# Deploy 10 nodes, two of which will act as bootstrap nodes\n# to which every other node will connect\nNODE_NUMBER=10 BOOTSTRAP_NUMBER=2 make install_bootstraped\n\n# Deploy 10 nodes, with each node connecting by default with\n# the previous one\nNODE_NUMBER=10 make install_linked\n```\n\nIn order to use the CLI run npm install in the root dir:\n\n```\nnpm install\n```\n\n## CLI Usage\n\nOnce installed, you can use the cli to interact with the testbed.\n\nCheck the [CLI Repo](https://github.com/JGAntunes/ipfs-testbed-cli) for more info.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgantunes%2Fipfs-testbed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgantunes%2Fipfs-testbed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgantunes%2Fipfs-testbed/lists"}