Skip to content

Commit

Permalink
update init command and docs examples
Browse files Browse the repository at this point in the history
  • Loading branch information
hazelnutcloud committed Apr 5, 2023
1 parent 1d58b43 commit 252ae35
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
13 changes: 7 additions & 6 deletions cli/init/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ import { transferHandler } from "./handlers/transfer.ts";
const manifest = new Manifest("my-arkive");
manifest
.addEntity(Balance)
.addChain("avalanche")
.addContract(erc20)
.addSource("0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", 27347402n)
.addEventHandler("Transfer", transferHandler);
.chain("avalanche")
.contract(erc20)
.addSources({ "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664": 27347402n })
.addEventHandlers({ "Transfer": transferHandler });
export default manifest.build();`;
export default manifest
.addEntity(Balance)
.build();`;

writeFile(newDir, "manifest.ts", manifest, options.overwrite);

Expand Down
21 changes: 13 additions & 8 deletions docs/docs/reference/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ sidebar_position: 2

# Manifest

The `Manifest` class serves as the central configuration for your Arkive, allowing you to define data sources from various blockchains, map them to their respective handler functions, and set up your database schema using entity classes. By chaining method calls, you can create a comprehensive, easy-to-read manifest that outlines your entire Arkive configuration.
The `Manifest` class serves as the central configuration for your Arkive,
allowing you to define data sources from various blockchains, map them to their
respective handler functions, and set up your database schema using entity
classes. By chaining method calls, you can create a comprehensive, easy-to-read
manifest that outlines your entire Arkive configuration.

## Example manifest

Expand All @@ -16,11 +20,12 @@ import { transfer } from "./handlers/transfer.ts";
const manifest = new Manifest("my-arkive");

manifest
.addEntity(Balance)
.addChain("avalanche")
.addContract(erc20)
.addSource("0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", 27347402n)
.addEventHandler("Transfer", transferHandler);
.chain("avalanche")
.contract(erc20)
.addSources({ "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664": 27347402n })
.addEventHandlers({ "Transfer": transferHandler });

export default manifest.build();
```
export default manifest
.addEntity(Balance)
.build();
```

1 comment on commit 252ae35

@vercel
Copy link

@vercel vercel bot commented on 252ae35 Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.