https://github.com/zkitter/zkitter-js
https://github.com/zkitter/zkitter-js
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zkitter/zkitter-js
- Owner: zkitter
- Created: 2023-01-30T21:55:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-25T14:49:26.000Z (about 3 years ago)
- Last Synced: 2025-03-28T18:09:03.614Z (about 1 year ago)
- Language: TypeScript
- Size: 4.06 MB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ZkitterJS
Javascript implementation of a standalone Zkitter node
## CLI Usage
To install CLI:
```sh
npm i -g zkitter-js
```
To sync:
```sh
# either https or wss provider will work
zkitter init -a wss://arb-mainnet.g.alchemy.com/v2/[api-key]
zkitter sync
zkitter timeline --limit=5
```
CLI options:
```
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
init [options] initialize zkitter
status display status
timeline [options] display timeline
sync [options] sync with arbitrum and group
fetch [options] fetch historical data (30 days max) from waku
whois
sync with arbitrum and group
up start zkitter and subscribe to all global events
write [options] publish a post
list [options] list all groups or users
help [command] display help for command
```
## NPM Usage
```ts
import { Zkitter } from 'zkitter-js';
const zkitter = await Zkitter.initialize({
arbitrumHttpProvider: 'https://...',
});
// Sync with arbitrum registrar
await zkitter.syncUsers();
// Sync with zk groups on zkitter
await zkitter.syncGroup();
// Get all historical messages (30 days) from Waku store
await zkitter.queryAll();
// Subscribe to all future messages from everyone
await zkitter.subscribe();
```
## Development
```sh
# node v16
npm install
# build a dev cli to build/cli.js
npm run dev
```