Skip to content

Commit

Permalink
docs: running helia-101 examples (#217)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Potsides <[email protected]>
  • Loading branch information
dozyio and achingbrain authored Mar 15, 2024
1 parent 8547a4f commit 3136c50
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Empty file modified examples/helia-101/101-basics.js
100755 → 100644
Empty file.
16 changes: 12 additions & 4 deletions examples/helia-101/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
- [About The Project](#about-the-project)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation and Running example](#installation-and-running-example)
- [Installation](#installation)
- [Running examples](#running-examples)
- [Usage](#usage)
- [101 - Basics](#101---basics)
- [201 - Storage](#201---storage)
Expand Down Expand Up @@ -56,11 +57,18 @@ Make sure you have installed all of the following prerequisites on your developm
- Git - [Download & Install Git](https://git-scm.com/downloads). OSX and Linux machines typically have this already installed.
- Node.js - [Download & Install Node.js](https://nodejs.org/en/download/) and the npm package manager.

### Installation and Running example
### Installation

```console
> npm install
> node ./101-basics.js
```

### Running Examples

```console
> npm run 101-basics
> npm run 201-storage
> npm run 301-networking
```

## Usage
Expand Down Expand Up @@ -225,7 +233,7 @@ const libp2p = await createLibp2p({
Since your Helia node is configured with a libp2p node, you can go to an IPFS Gateway and load the printed hash. Go ahead and try it!

```bash
> node 301-networking.js
> npm run 301-networking

Added file: bafkreife2klsil6kaxqhvmhgldpsvk5yutzm4i5bgjoq6fydefwtihnesa
# Copy that hash and load it on the gateway, here is a prefilled url:
Expand Down
5 changes: 3 additions & 2 deletions examples/helia-101/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"license": "MIT",
"main": "index.js",
"scripts": {
"start": "node 101-basics.js",
"serve": "npm run start",
"101-basics": "node 101-basics.js",
"201-storage": "node 201-storage.js",
"301-networking": "node 301-networking.js",
"test": "test-node-example test/*"
},
"dependencies": {
Expand Down

0 comments on commit 3136c50

Please sign in to comment.