Skip to content

Commit

Permalink
Merge pull request #1 from Lilypad-Tech/developersteve/cid
Browse files Browse the repository at this point in the history
Updated README & added the additional CID as part of the json output
  • Loading branch information
developersteve authored May 20, 2024
2 parents a5e94cd + d72dcc0 commit 7078b06
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 794 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ An API endpoint that wraps using the Lilypad cli.

## Usage

`node src/run.js` or `node src/stream.js`
Run `node src/index.js` to create a local endpoint using the js wrapper with either `src/run.js` or `src/stream.js`, then send a post request containing json with your funded `WEB3_PRIVATE_KEY` key set, see the quick start for more on [getting started](https://docs.lilypad.tech/lilypad/lilypad-milky-way-testnet/quick-start)

The endpoint can then be tested using curl
```
curl -X POST http://localhost:3000 \
-H "Content-Type: application/json" \
-d '{"pk": "'"$WEB3_PRIVATE_KEY"'", "module": "github.com/lilypad-tech/lilypad-module-lilysay:0.1.0", "inputs": "Message=test"}'
```

```js
// run.js
Expand All @@ -18,7 +25,9 @@ run(
).then((res) => {
console.log(res)
})
```

```js
// stream.js
const { stream } = require("./")

Expand All @@ -30,8 +39,9 @@ stream(
).then(() => {
console.log("Result in ./output/result")
})
```


```js
// index.js
const fetch = require("node-fetch")
const fs = require("fs")
Expand Down Expand Up @@ -74,4 +84,4 @@ function run(pk, module, inputs) {
}

module.exports = { run, stream }
```
```
Loading

0 comments on commit 7078b06

Please sign in to comment.