Skip to content

Commit

Permalink
added a cid to the output on and updated README with more info and a …
Browse files Browse the repository at this point in the history
…curl example
  • Loading branch information
developersteve committed May 17, 2024
1 parent a5e94cd commit 3f4fca4
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 794 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,4 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
node_modules
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ 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, 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"}'
```

Alternatively run `node src/run.js` or `node src/stream.js` with one of the following scripts

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

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


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

0 comments on commit 3f4fca4

Please sign in to comment.