Skip to content

Repository files navigation

FriendlyIntents

Project initialized using @stackr/sdk

Presentation: https://drive.google.com/drive/folders/1AnQq3-L6scJ5i2VFYQ-_oLemnFttZijj?usp=sharing

Tech used: Avail + Stackr Chronicle used as Oracle on-chain XMTP Message Lit queries Stackr for the intents, broadcasts it to friends (with decryption key) Lit protocol for key management, onboarding, etc LayerZero for cross chain communication

Step by step:

  1. Users use Lit protocol to encrypt messages
  2. Encryted message sent to stackr (using Avail DA) chain
  3. Message propogated to other chains (Rootstock) using LayerZero
  4. Friends get told about the decryption key via MessageKit group chat
  5. Any friend (using Lit decryption) can fill the intent!

Project structure

.
├── .env.example
├── .gitignore
├── Dockerfile
├── genesis-state.json
├── package-lock.json
├── package.json
├── src
│   ├── index.ts ## -> starting point, everything gets imported here.
│   ├── server.ts ## -> server setup if any in the example.
│   ├── cli.ts ## -> CLI interaction setup if any in the example.
│   ├── contract ## -> place to keep your utility Contracts (like Bridge contract)
│   │   └──Contract.sol
│   ├── stackr
│       ├── machine.ts ## -> preferred place to keep your State Machine(s) and export from
│       ├── mru.ts ## -> place to initialize your MicroRollup
│       ├── state.ts ## -> file to define your State class, can be omitted if state is trivial.
│       └── transitions.ts ## -> one place to store all your transitions & hooks _(hooks can have separate hooks.ts file too.)_
├── stackr.config.ts
├── tests
│   └── some.test.ts
└── tsconfig.json

Note: Some files are specific to certain examples, as mentioned in the tree above.

How to run?

Run using Node.js 🚀

npm start

Run using Docker 🐳

  • Build the image using the following command:
# For Linux
docker build -t FriendlyIntents:latest .

# For Mac with Apple Silicon chips
docker buildx build --platform linux/amd64,linux/arm64 -t FriendlyIntents:latest .
  • Run the Docker container using the following command:
# If using SQLite as the datastore
docker run --env-file .env -v ./db.sqlite:/app/db.sqlite -p <HOST_PORT>:<CONTAINER_PORT> --name=FriendlyIntents -it FriendlyIntents:latest

# If using other URI based datastores
docker run --env-file .env -p <HOST_PORT>:<CONTAINER_PORT> --name=FriendlyIntents -it FriendlyIntents:latest

Playground Plugin

To leverage examples and test the SDK, you can use Stackr's Playground hosted at: https://playground.stackrlabs.xyz.

In you application, add Playground by importing the following:

import { Playground } from "@stackr/sdk/plugins";

const rollup = ...
await rollup.init();

Playground.init(rollup);
// this will start a server at http://localhost:42069, which is taken as input by the Playground

Full instructions can be found at here

Vulcan Explorer

To explore your submitted blocks and batches, you can use the Vulcan Explorer hosted at: https://explorer.vulcan.stf.xyz/.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages