Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 46 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
# Ocean Protocol VSCode Extension

Run compute jobs on Ocean Protocol directly from VS Code. The extension automatically detects your active algorithm file and streamlines job submission, monitoring, and results retrieval. Simply open a python or javascript file and click **Start Compute Job**.
Run Compute-to-Data jobs on Ocean Protocol directly from VS Code.

The extension streamlines project creation, job submission, monitoring, and results retrieval.

Create a new project with built-in algorithm templates and dependencies, then click **Start FREE Compute Job**.

![Ocean Protocol VSCode Extension](./screenshots/main-screenshot.png)

## Features

### 🚀 One-Click Compute Jobs

Select your algorithm, choose a dataset, and run compute jobs with a single click.
Create new compute projects with automatic Dockerfile and dependencies setup. Choose between Python or JavaScript templates.

### 💰 Free Compute Jobs

Start with free compute jobs, then upgrade to paid compute for more power.

### 📊 Real-Time Monitoring

Track job progress and view algorithm logs directly in VS Code.
Track job progress and view algorithm logs directly in VS Code's Output console.

### 📁 Automatic Results Handling

Results are automatically saved and opened when your job completes.
Results and logs are automatically saved in your project folder when your job completes.

## Getting Started

1. Install the extension from the VS Code Marketplace
2. Open the Ocean Protocol panel from the activity bar
3. Configure your compute settings:
- Node URL (pre-filled with default Ocean compute node)
- Optional private key for your wallet
4. Select your files:
- Algorithm file (JS or Python)
- Optional dataset file (JSON)
- Results folder location
5. Click **Start Compute Job**
6. Monitor the job status and logs in the output panel
7. Once completed, the results file will automatically open in VSCode
3. Create a new project folder:
- Choose a parent directory for your project
- Name your project (default: `new-compute-job`)
- Select your language: Python or JavaScript
4. Explore your project structure:
- Algorithm file (`.py` or `.js`)
- Dockerfile with environment setup
- Dependencies file (`requirements.txt` or `package.json`)
5. Click **Start FREE Compute Job**
6. Monitor job status and logs in the Output console
7. Check results and logs in your project's `results` folder

### Requirements

Expand All @@ -41,33 +50,38 @@ VS Code 1.96.0 or higher

The extension adds a dedicated Ocean Protocol section to the activity bar. Here you can:

- Configure compute settings (Ocean Node URL, Private Key).
- Optionally select a dataset file.
- Choose a folder to store compute results.
- Start a compute job with the current algorithm file automatically detected.
- Create new project folders or select existing ones
- View compute resources under the Setup dropdown
- Configure compute settings (accessible via Configure Compute)
- Start free or paid compute jobs

### Starting a Compute Job

1. Navigate to the "Start Compute Job" section.
2. Ensure your active file is either a JavaScript or Python algorithm.
3. Optionally select a dataset file.
4. Choose a folder for saving results.
5. Click **Start Compute Job**.
6. Monitor the job status and logs in the output panel.
7. Once completed, the results file will automatically open in VSCode.
1. Create a new project folder or select an existing one
2. Review your algorithm, Dockerfile, and dependencies
3. Click **Start FREE Compute Job** (or upgrade to paid for more resources)
4. Monitor job status and logs in the Output console
5. Check results in your project folder under `results/`

## Optional Setup
## Advanced Setup

- Custom Compute Node: Enter your own node URL or use the default Ocean Protocol node
- Wallet Integration: Use auto-generated wallet or enter private key for your own wallet
- Custom Docker Images. If you need a custom environment with your own dependencies installed, you can use a custom docker image. Default is oceanprotocol/algo_dockers (Python) or node (JavaScript)
- Docker Tags: Specify version tags for your docker image (like python-branin or latest)
- Algorithm: The vscode extension automatically detects open JavaScript or Python files. Or alternatively you can specify the algorithm file manually here.
- Dataset: Optional JSON file for input data
- Results Folder: Where computation results will be saved
- **Custom Docker Image/Tag**: Use your own docker image and tag (only if no Dockerfile is provided in your project folder)
- **Auth Token**: Auto-generated when you configure your compute settings
- **Custom Compute Node**: Enter your own node URL or use the default Ocean Protocol node
- **Compute Resources**: Free compute uses minimal resources. View available resources under the Setup dropdown
- **Paid Compute**: Upgrade from free to paid compute for more computational power
- **Node Status Check**: Use the Check button under Setup dropdown to verify node availability

![Ocean Protocol VSCode Extension](./screenshots/setup-screenshot.png)

## Troubleshooting

- **Job cannot start** → Check node status (under Setup dropdown, press the Check button)
- **Job not running** → Verify your Node URL in Configure Compute
- **Not enough funds** → Use Configure Compute to adjust your settings or switch to free compute
- **General issues** → Check extension logs in the Output console. Logs are also saved in your project folder under `logs/`

## Development & Contributing

Refer to the project structure and available scripts for local development. Contributions are always welcome—please check our guidelines in the repository.
Expand Down
74 changes: 74 additions & 0 deletions cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 🌊 Ocean Protocol VS Code Extension — User Cheatsheet

Run **Compute-to-Data jobs** directly from VS Code.

---

## ✅ Requirements

- VS Code **v1.96.0 or higher**

---

## 📦 Installation

1. Install from [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=OceanProtocol.ocean-protocol-vscode-extension).
2. Open the **Ocean Protocol** panel (left Activity Bar).

---

## ▶️ Run your first compute job

1. Create a **new project folder**.
2. Pick a **parent directory** for your project. This is where your algo and compute results will be saved.
3. Find a name for your new project. Default is `new-compute-job`.
4. Pick your favorite language for your algorithm. At the moment, we support **Python** and **JavaScript**.
5. Explore your newly created project. It will have a `Dockerfile`, dependencies file and an algorithm.
6. Run your first compute job by clicking **Start FREE Compute Job**.
7. Watch logs & job status in the **Output console**.
8. When finished, results and logs will be saved in your project folder under the `results` folder.

---

## ⚡ Tips

- **Free compute** uses an environment with minimal resources.
- Resources are displayed under the **Setup** dropdown.
- Whenever you want to get more resources, you can upgrade to a paid compute job.
- Go to **Configure Compute** to change your compute settings.
- Logs & errors show up in the **Output console**.
- If no dockerfile is provided, you can use your own docker image and tag.

---

## 🛠️ Troubleshooting

- ❌ Job cannot start → check node status. (Under the **Setup** dropdown, press the **Check** button)
- ❌ Job not running → check Node URL.
- ❌ Not enough funds → use **Configure Compute** to change your compute settings.
- Always check **extension logs** in Output. Logs are also saved in your project folder under the `logs` folder.

---

## 📦 Advanced Setup

- Custom Docker image/tag. Only if no dockerfile is provided in your project folder.
- Auth Token. This is auto-generated once you configure your compute settings.

---

## 🔄 Workflow Summary

| Step | Action |
| ---- | ------------------------------------------------------------ |
| 1 | Create a new project folder / Select existing project folder |
| 2 | Click **Start Compute Job** |
| 3 | Monitor logs & job status |
| 4 | Check results in your project folder |

---

## 📚 Resources

- [Ocean Protocol Docs](https://docs.oceanprotocol.com/developers/vscode)
- [GitHub Repo](https://github.com/oceanprotocol/vscode-extension)
Binary file modified screenshots/main-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/setup-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading