Add documentation for spr

This commit is contained in:
Arnaud 2024-09-13 19:25:02 +02:00
parent 83c2e142e8
commit 3b3fc6794d
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663

View File

@ -55,7 +55,7 @@ const codex = new Codex("http://localhost:3000");
To use a module, you need to use the await syntax. If the module is not loaded yet, it will be imported first and then cached in memory.
```js
const marketplace = await codex.marketplace();
const marketplace = await codex.marketplace;
```
### Error handling
@ -214,7 +214,7 @@ The following API assume that you have already a data module loaded, example:
```js
const codex = new Codex("http://localhost:3000");
const data = await codex.data();
const data = await codex.data;
```
#### cids
@ -261,13 +261,13 @@ const upload = await data.upload(file, (loaded: number, total: number) => {
await upload.result();
```
### Node
### Debug
The following API assume that you have already a node module loaded, example:
```js
const codex = new Codex("http://localhost:3000");
const data = await codex.node();
const data = await codex.debug;
```
#### setLogLevel
@ -294,3 +294,24 @@ Example:
```js
const info = await debug.info();
```
### Node
The following API assume that you have already a node module loaded, example:
```js
const codex = new Codex("http://localhost:3000");
const node = await codex.node;
```
#### spr
Get Node's SPR
- returns Promise<string>
Example:
```js
const spr = await node.spr();
```