-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
title: Setting Up Your Local Editor | ||
--- | ||
# Setting Up Your Local Editor | ||
|
||
Hiro Platform now supports local development, allowing you to use your preferred local editor (Emacs, Vim, VSCode, etc.) to develop smart contracts. This guide will walk you through the steps to set up your local editor for Hiro Platform. | ||
|
||
## Step 1: Find or Generate your SSH Key | ||
|
||
First, you need to check if you already have an existing SSH key on your device. This is often located in `~/.ssh/id_ed25519.pub`. You can view your SSH keys by running the following command in your terminal: | ||
|
||
```bash | ||
ls -al ~/.ssh | ||
``` | ||
|
||
Look for the file ending in `.pub`, which contains your public key. | ||
|
||
If you don't have an SSH key, you can generate one by running the following command in your terminal: | ||
|
||
```bash | ||
ssh-keygen -t ed25519 | ||
``` | ||
|
||
You'll then be prompted to enter a passphrase. You can choose to leave that blank. You should now have a `id_ed25519.pub` file which contains your new public SSH key. | ||
|
||
## Step 2: Save your SSH Key | ||
|
||
Next, you'll provide your public key to the Hiro Platform. You can do this by copying your public key and pasting it into the SSH Public Key field in the Hiro Platform. | ||
|
||
You'll also need to provide a nickname for your connected device, such as 'MacBook Pro'. This will help you identify the device in the future. | ||
|
||
## Step 3: Enable Port Forwarding | ||
|
||
To run authenticated Git operations from within your Hiro Platform workspace, you'll need to enable SSH port forwarding. If you don't plan to use Git, you can skip this step. | ||
|
||
Open the file at `~/.ssh/config` with a text editor, or create it if it doesn't exist. Enter the following text into the file: | ||
|
||
```bash | ||
Host <your-workspace-url> | ||
ForwardAgent yes | ||
``` | ||
|
||
Replace `<your-workspace-url>` with the actual URL of your pod, which should look something like this: https://4a1b57d0c473.platform.hiro.so/ | ||
|
||
|
||
## Step 4: Connection Complete! | ||
Check warning on line 46 in docs/platform/setting-up-local-editor.md GitHub Actions / Vale[warning] Google.Exclamation
|
||
|
||
Now you can access your Hiro Platform projects directly from your local setup. Use an SSH client or editor with SSH support to open your projects. | ||
|
||
## Configuring Visual Studio Code | ||
|
||
Visual Studio Code (VSCode) has built-in support for SSH connections, allowing you to connect to and work on your remote server directly from your local VSCode environment. Here's how to set it up: | ||
|
||
1. Open VSCode on your local machine. | ||
|
||
2. Open the Command Palette by pressing `F1` or `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS). | ||
|
||
3. Type "Remote-SSH: Connect to Host..." and select it from the dropdown list. | ||
|
||
4. Click on "Add New SSH Host...". | ||
Check warning on line 60 in docs/platform/setting-up-local-editor.md GitHub Actions / Vale[warning] Google.Ellipses
|
||
|
||
5. Enter your SSH connection command, for example `ssh hiro@<your-workspace-url>`, replacing `<your-workspace-url>` with your workspace url. | ||
Check warning on line 62 in docs/platform/setting-up-local-editor.md GitHub Actions / Vale[warning] Google.WordList
|
||
|
||
6. Select the SSH configuration file to update. This is usually `~/.ssh/config`. | ||
|
||
7. Once the configuration file is updated, you can click on "Connect to Host" again and you should see your new SSH host. Click on it to connect. | ||
|
||
8. A new VSCode window will open, connected to your remote server. You can now open folders and files on the server and work on them as if they were local. | ||
|
||
Remember to replace `hiro@<your-workspace-url>` with your actual SSH username and workspace url. | ||
Check warning on line 70 in docs/platform/setting-up-local-editor.md GitHub Actions / Vale[warning] Hiro.Spellcheck
|
||
|
||
That's it! You've now set up your local editor for Hiro Platform. Happy coding! | ||
Check warning on line 72 in docs/platform/setting-up-local-editor.md GitHub Actions / Vale[warning] Google.Exclamation
|
||
|
||
## Configuring Emacs | ||
|
||
Emacs has built-in support for SSH through the Tramp mode. To open a file over SSH, use the following command: | ||
|
||
```bash | ||
C-x C-f /ssh:hiro@<your-workspace-url>:/path/to/project | ||
``` | ||
|
||
Replace `hiro@<your-workspace-url>` with your workspace url, and `/path/to/project` with the path to the project you want to open. | ||
Check warning on line 82 in docs/platform/setting-up-local-editor.md GitHub Actions / Vale[warning] Google.WordList
|