Skip to content

Commit

Permalink
feat: add platform ssh docs
Browse files Browse the repository at this point in the history
  • Loading branch information
beguene committed Sep 20, 2023
1 parent 0c1b56b commit 7b30e4f
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
82 changes: 82 additions & 0 deletions docs/platform/setting-up-local-editor.md
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

Check warning on line 4 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Headings

'Setting Up Your Local Editor' should use sentence-style capitalization.

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.

Check warning on line 6 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Will

Avoid using 'will'.

## Step 1: Find or Generate your SSH Key

Check warning on line 8 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Headings

'Step 1: Find or Generate your SSH Key' should use sentence-style capitalization.

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:

Check warning on line 10 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.WordList

Use 'select' instead of 'check'.

```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.

Check warning on line 30 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Will

Avoid using 'will'.

## Step 3: Enable Port Forwarding

Check warning on line 32 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Headings

'Step 3: Enable Port Forwarding' should use sentence-style capitalization.

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

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Exclamation

Don't use exclamation points in text.

Check warning on line 46 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Headings

'Step 4: Connection Complete!' should use sentence-style capitalization.

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.

Check warning on line 58 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Ellipses

In general, don't use an ellipsis.

4. Click on "Add New SSH Host...".

Check warning on line 60 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Ellipses

In general, don't use an ellipsis.

Check failure on line 60 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[error] Google.Quotes

Commas and periods go inside quotation marks.

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

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.WordList

Use 'URL' instead of 'url'.

Check warning on line 62 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Hiro.Spellcheck

Verify the spelling of 'url'

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.

Check warning on line 66 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.WordList

Use 'click' or 'click in' instead of 'click on'.

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.

Check warning on line 68 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Will

Avoid using 'will'.

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

View workflow job for this annotation

GitHub Actions / Vale

[warning] Hiro.Spellcheck

Verify the spelling of 'url'

Check warning on line 70 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.WordList

Use 'URL' instead of 'url'.

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

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Exclamation

Don't use exclamation points in text.

Check warning on line 72 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Exclamation

Don't use exclamation points in text.

## Configuring Emacs

Check warning on line 74 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.Headings

'Configuring Emacs' should use sentence-style capitalization.

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

View workflow job for this annotation

GitHub Actions / Vale

[warning] Google.WordList

Use 'URL' instead of 'url'.

Check warning on line 82 in docs/platform/setting-up-local-editor.md

View workflow job for this annotation

GitHub Actions / Vale

[warning] Hiro.Spellcheck

Verify the spelling of 'url'
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ module.exports = {
'platform/create-project',
'platform/build-contract',
'platform/create-chainhooks',
'platform/local-development',
'platform/deployment-plans',
'platform/deploy-project',
'platform/archive-project',
Expand Down

0 comments on commit 7b30e4f

Please sign in to comment.