Skip to content

Commit

Permalink
chore: moved all example plugins to the boilerplate repository (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
heeckhau authored Aug 23, 2024
1 parent 737cc10 commit 08c4f74
Show file tree
Hide file tree
Showing 22 changed files with 1 addition and 778 deletions.
49 changes: 1 addition & 48 deletions plugins/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1 @@
# Plugin Development for the TLSNotary Browser Extension

This folder is dedicated to the development of plugins for the TLSNotary browser extension, utilizing the Extism framework. Currently, the folder includes a TypeScript-based plugin example, `twitter_profile`, with plans to add more plugins showcasing different programming languages and functionalities.

## Installation of Extism-js

1. **Download and Install Extism-js**: Begin by setting up `extism-js`, which enables you to compile and manage your plugins. Run these commands to download and install it:

```sh
curl -O https://raw.githubusercontent.com/extism/js-pdk/main/install.sh
sh install.sh
```

This script installs the Extism JavaScript Plugin Development Kit from its GitHub repository, preparing your environment for plugin compilation.

## Building the Twitter Profile Plugin

Navigate to the `twitter_profile` directory within this folder and run the following command to build the plugin:

```sh
extism-js index.js -i index.d.ts -o index.wasm
```
This command compiles the TypeScript code in index.js into a WebAssembly module, ready for integration with the TLSNotary extension.

### Running the Twitter Plugin Example:

1. Build the `twitter_profile` plugin as explained above.
2. Build and install the `tlsn-extension` as documented in the [main README.md](../README.md).
3. [Run a local notary server](https://github.com/tlsnotary/tlsn/blob/main/notary-server/README.md), ensuring `TLS` is disabled in the [config file](https://github.com/tlsnotary/tlsn/blob/main/notary-server/config/config.yaml#L18).
4. Install the plugin: Click the **Add a Plugin (+)** button and select the `index.wasm` file you built in step 1. A **Twitter Profile** button should then appear below the default buttons.
5. Click the **Twitter Profile** button. This action opens the Twitter webpage along with a TLSNotary sidebar.
6. Follow the steps in the TLSNotary sidebar.
7. Access the TLSNotary results by clicking the **History** button in the TLSNotary extension.

## Future Plugins

This directory will be expanded with more plugins designed to demonstrate the functionality of the TLSNotary extension. Plugins enable flexible use of the TLSNotary across a broad range of applications. The use of Extism facilitates plugin development in various languages, further enhancing flexibility.

## Create an icon

1. resize to 320x320 pixels:
```sh
convert icon.png -resize 320x320! icon_320.png
```
2. convert to base64
```sh
base64 -i icon_320.png -o icon_320.txt
```
You can find example plugins at https://github.com/tlsnotary/tlsn-plugin-boilerplate/tree/main/examples
3 changes: 0 additions & 3 deletions plugins/disclaimer.md

This file was deleted.

4 changes: 0 additions & 4 deletions plugins/hello/hello.d.ts

This file was deleted.

6 changes: 0 additions & 6 deletions plugins/hello/hello.js

This file was deleted.

Binary file removed plugins/hello/hello.wasm
Binary file not shown.
14 changes: 0 additions & 14 deletions plugins/reddit/index.d.ts

This file was deleted.

94 changes: 0 additions & 94 deletions plugins/reddit/index.js

This file was deleted.

Binary file removed plugins/reddit/index.wasm
Binary file not shown.
14 changes: 0 additions & 14 deletions plugins/twitter_dm/index.d.ts

This file was deleted.

127 changes: 0 additions & 127 deletions plugins/twitter_dm/index.js

This file was deleted.

15 changes: 0 additions & 15 deletions plugins/twitter_profile/index.d.ts

This file was deleted.

130 changes: 0 additions & 130 deletions plugins/twitter_profile/index.js

This file was deleted.

Binary file removed plugins/twitter_profile/index.wasm
Binary file not shown.
3 changes: 0 additions & 3 deletions plugins/twitter_profile_ts/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions plugins/twitter_profile_ts/README.md

This file was deleted.

Binary file removed plugins/twitter_profile_ts/assets/icon.png
Binary file not shown.
39 changes: 0 additions & 39 deletions plugins/twitter_profile_ts/config.json

This file was deleted.

85 changes: 0 additions & 85 deletions plugins/twitter_profile_ts/esbuild.js

This file was deleted.

17 changes: 0 additions & 17 deletions plugins/twitter_profile_ts/package.json

This file was deleted.

15 changes: 0 additions & 15 deletions plugins/twitter_profile_ts/src/index.d.ts

This file was deleted.

Loading

0 comments on commit 08c4f74

Please sign in to comment.