Elastic Provider Speed Test
Speed test for Elastic Provider vs IPFS Cluster.
How does it work?
- Starts a local IPFS node.
- Selects a random CID from the database.
- Ensures it is
pinned
on IPFS Cluster. - Ensures it is stored in the Elastic Provider S3 bucket.
- Connects the local node to an IPFS Cluster node.
- Transfers the data and measures the speed.
- Disconnects from the IPFS Cluster node.
- Connects the local node to the Elastic Provider node.
- Transfers the data and measures the speed.
- Disconnects from the Elastic Provider node.
- Appends the result to the NDJSON log.
- GOTO 2.
Usage
Install project dependencies:
npm install
Create a .env
file in the root of the project and populate with the following information:
DATABASE_CONNECTION=<postgres connection string>
ELASTIC_PROVIDER_ADDR=<multiaddr of EP node including peer ID>
ELASTIC_PROVIDER_S3_REGION=<EP S3 bucket region>
ELASTIC_PROVIDER_S3_BUCKET=<EP S3 bucket name>
ELASTIC_PROVIDER_S3_ACCESS_KEY_ID=<EP S3 bucket access key>
ELASTIC_PROVIDER_S3_SECRET_ACCESS_KEY=<EP S3 bucket secret>
CLUSTER_API_URL=<cluster API URL>
CLUSTER_BASIC_AUTH_TOKEN=<cluster basic auth token>
Start the speed test:
npm start
Notes
A good and simple tool to convert NDJSON to JSON: https://observablehq.com/@iosonosempreio/ndjson-sorceress