From 00fa22012bd221a5f98ea0d3d88c673dd2acc49b Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Wed, 22 Jan 2025 08:59:25 +0300 Subject: [PATCH 1/2] Updating readme --- README.md | 155 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 113 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 5334fdd..ea807dd 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,152 @@ -# ocean-protocol README +# Ocean Protocol VSCode Extension -This is the README for your extension "ocean-protocol". After writing up a brief description, we recommend including the following sections. +This VSCode extension enables you to interact with Ocean Protocol directly from your development environment. You can publish assets, run compute jobs, and manage Ocean Protocol operations without leaving VSCode. + +## Features + +- 🌊 **Ocean Protocol Integration**: Direct integration with Ocean Protocol's core functionality +- 📝 **Asset Publishing**: Publish datasets and algorithms with a simple interface +- 🔍 **Asset Discovery**: View details of published assets +- 💻 **Compute-to-Data**: Start and monitor compute jobs +- 🔄 **P2P Network**: View and interact with Ocean Protocol's P2P network +- ⬇️ **Asset Downloads**: Download assets directly through the extension + +## Prerequisites + +- Node.js (version specified in `.nvmrc`) +- VSCode version 1.93.0 or higher +- Git ## Running the extension locally -`npm i` +1. Clone the repository: -`npm run compile` +```bash +git clone https://github.com/your-username/ocean-protocol-vscode +cd ocean-protocol-vscode +``` -To start the extension in a local vscode window, press F5 or run the command Debug: Start Debugging from the Command Palette (Ctrl+Shift+P). +2. Install dependencies: -COnsult the [vscode extension documentation](https://code.visualstudio.com/api/get-started/your-first-extension) for more information. +```bash +npm install +``` -## Features +3. Build the extension: + +```bash +npm run compile +``` + +4. Open in VSCode: + +- Press F5 to start debugging +- This will open a new VSCode window with the extension loaded + +## Usage + +### Extension Layout -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. +The extension adds a new Ocean Protocol icon to the activity bar. Clicking it reveals several sections: -For example if there is an image subfolder under your extension project workspace: +1. **Setup** -\!\[feature X\]\(images/feature-x.png\) + - Configure RPC URL + - Set Ocean Node URL + - Enter private key for transactions -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. +2. **Get Asset Details** -## Requirements + - Enter an asset's DID to view its details + - View metadata and other asset information -If you have any requirements or dependencies, add a section describing those and how to install and configure them. +3. **Publish Asset** -## Extension Settings + - Select a JSON file containing asset metadata + - Publish new datasets or algorithms to Ocean Protocol -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. +4. **Start Compute Job** -For example: + - Select dataset and algorithm files + - Configure compute environment + - Start and monitor compute-to-data jobs -This extension contributes the following settings: +5. **P2P** -- `myExtension.enable`: Enable/disable this extension. -- `myExtension.thing`: Set to `blah` to do something. + - View your node's ID + - See connected Ocean peers + - Monitor P2P network status -## Known Issues +6. **Download Asset** + - Enter asset DID + - Specify download location + - Download assets directly through VSCode -Calling out known issues can help limit users opening duplicate issues against your extension. +### Basic Operations -## Release Notes +#### Publishing an Asset -Users appreciate release notes as you update your extension. +1. Click the Ocean Protocol icon in the activity bar +2. Open the "Publish Asset" section +3. Click "Select Asset File" to choose your metadata JSON file +4. Enter your private key in the setup section +5. Click "Publish Asset" -### 1.0.0 +#### Starting a Compute Job -Initial release of ... +1. Navigate to the "Start Compute Job" section +2. Select both dataset and algorithm files +3. Enter the compute environment URL +4. Click "Start Compute Job" -### 1.0.1 +#### Downloading Assets -Fixed issue #. +1. Open the "Download Asset" section +2. Enter the asset's DID +3. Specify the download path +4. Click "Download Asset" -### 1.1.0 +## Development -Added features X, Y, and Z. +### Project Structure ---- +``` +ocean-protocol-vscode/ +├── src/ +│ ├── extension.ts # Main extension entry point +│ ├── viewProvider.ts # WebView UI provider +│ ├── helpers/ # Helper functions +│ │ ├── download.ts +│ │ ├── freeCompute.ts +│ │ ├── oceanNode.ts +│ │ └── publish.ts +│ └── @types/ # TypeScript type definitions +├── test/ # Test files +└── package.json # Project configuration +``` -## Following extension guidelines +### Available Scripts -Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. +- `npm run compile`: Compile the TypeScript code +- `npm run watch`: Compile in watch mode +- `npm run lint`: Run ESLint +- `npm run test`: Run tests +- `npm run package`: Create VSIX package for distribution -- [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) +## Contributing -## Working with Markdown +1. Fork the repository +2. Create your feature branch (`git checkout -b feature/amazing-feature`) +3. Commit your changes (`git commit -m 'Add some amazing feature'`) +4. Push to the branch (`git push origin feature/amazing-feature`) +5. Open a Pull Request -You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: +## License -- Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). -- Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). -- Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. +This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. -## For more information +## Contact -- [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -- [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) +For bug reports and feature requests, please open an issue in the GitHub repository. -**Enjoy!** +For general questions about Ocean Protocol, join the [Ocean Protocol Discord](https://discord.gg/TnXjkR5). From c669a9b429ba1cc6f29fffebb8aad84d5d66df31 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Wed, 19 Feb 2025 15:29:58 +0300 Subject: [PATCH 2/2] Updating the readme to reflect the current set of features --- README.md | 75 +++++++++++++------------------------------------------ 1 file changed, 17 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index ea807dd..70fdafe 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,13 @@ # Ocean Protocol VSCode Extension -This VSCode extension enables you to interact with Ocean Protocol directly from your development environment. You can publish assets, run compute jobs, and manage Ocean Protocol operations without leaving VSCode. +This VSCode extension enables you to interact with Ocean Protocol directly from your development environment. You can run compute jobs and test algorithms without leaving VSCode. ## Features - 🌊 **Ocean Protocol Integration**: Direct integration with Ocean Protocol's core functionality -- 📝 **Asset Publishing**: Publish datasets and algorithms with a simple interface -- 🔍 **Asset Discovery**: View details of published assets -- 💻 **Compute-to-Data**: Start and monitor compute jobs -- 🔄 **P2P Network**: View and interact with Ocean Protocol's P2P network -- ⬇️ **Asset Downloads**: Download assets directly through the extension +- 💻 **Compute-to-Data**: Start and monitor compute jobs using JavaScript or Python algorithms +- 🔄 **Active File Integration**: Automatically detects and uses currently open .js or .py files as algorithms +- 📁 **Results Management**: Specify output locations and view computation results directly in VSCode ## Prerequisites @@ -51,60 +49,25 @@ The extension adds a new Ocean Protocol icon to the activity bar. Clicking it re 1. **Setup** - - Configure RPC URL - - Set Ocean Node URL - - Enter private key for transactions + - Optional: Configure RPC URL, or use the default. + - Optional: Set Ocean Node URL, or use the default. + - Optional: Enter private key for transactions, or use the default. -2. **Get Asset Details** - - - Enter an asset's DID to view its details - - View metadata and other asset information - -3. **Publish Asset** - - - Select a JSON file containing asset metadata - - Publish new datasets or algorithms to Ocean Protocol - -4. **Start Compute Job** - - - Select dataset and algorithm files +2. **Start Compute Job** + - Select algorithm file (automatically detects open .js or .py files) - Configure compute environment + - Select results folder location - Start and monitor compute-to-data jobs -5. **P2P** - - - View your node's ID - - See connected Ocean peers - - Monitor P2P network status - -6. **Download Asset** - - Enter asset DID - - Specify download location - - Download assets directly through VSCode - ### Basic Operations -#### Publishing an Asset - -1. Click the Ocean Protocol icon in the activity bar -2. Open the "Publish Asset" section -3. Click "Select Asset File" to choose your metadata JSON file -4. Enter your private key in the setup section -5. Click "Publish Asset" - #### Starting a Compute Job 1. Navigate to the "Start Compute Job" section -2. Select both dataset and algorithm files -3. Enter the compute environment URL -4. Click "Start Compute Job" - -#### Downloading Assets - -1. Open the "Download Asset" section -2. Enter the asset's DID -3. Specify the download path -4. Click "Download Asset" +2. Your currently open JavaScript or Python file will be automatically selected as the algorithm +3. Select a results folder for computation output +4. Enter the compute environment URL +5. Click "Start Compute Job" ## Development @@ -115,13 +78,9 @@ ocean-protocol-vscode/ ├── src/ │ ├── extension.ts # Main extension entry point │ ├── viewProvider.ts # WebView UI provider -│ ├── helpers/ # Helper functions -│ │ ├── download.ts -│ │ ├── freeCompute.ts -│ │ ├── oceanNode.ts -│ │ └── publish.ts -│ └── @types/ # TypeScript type definitions -├── test/ # Test files +│ └── helpers/ # Helper functions +│ └── compute.ts # Compute job functionality +├── test/ # Test files └── package.json # Project configuration ```