Skip to content

Commit

Permalink
Integrated AWS EC2 and Digital Ocean tutorials directly into Farcaste…
Browse files Browse the repository at this point in the history
…r site (#268)

Fixes issue #267 
My Warpcast username: pashu777

 ### Why is this change needed?

Previously, the AWS EC2 and Digital Ocean tutorials redirected users to
external Notion pages. This change integrates these tutorials directly
into the Farcaster documentation site. By doing so, users can now access
all relevant setup instructions without needing to navigate away from
the Farcaster.xyz site, improving the overall user experience.

### Change Summary

- Added `aws-ec2.md` with the complete setup guide for AWS EC2.
- Added `digital-ocean.md` with the complete setup guide for Digital
Ocean.
- Included all necessary images for the tutorials and updated their
paths.
- Updated `tutorials.md` to include links to the new tutorials.

### Merge Checklist

*Choose all relevant options below by adding an `x` now or at any time
before submitting for review:*

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a [changeset](https://github.com/atlassian/changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://docs.github.com/en/github/building-a-strong-community/setting-guidelines-for-repository-contributors)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to update the Hubble setup guides for AWS EC2,
Digital Ocean, and Google Cloud Platform (GCP) with new file structures
and content improvements.

### Detailed summary
- Renamed and restructured Hubble setup guides for AWS EC2 and Digital
Ocean
- Updated Google Cloud Platform (GCP) setup guide with new content and
images
- Improved clarity and consistency across all cloud provider setup
guides

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
intls authored Jul 23, 2024
1 parent 9db09a2 commit c515b7d
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 26 deletions.
Binary file added docs/assets/aws_allow_ssh.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 added docs/assets/aws_click_edit.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 added docs/assets/aws_inbound_rules.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 added docs/assets/aws_instance_id.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 added docs/assets/aws_instances.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 added docs/assets/aws_key_pair.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 added docs/assets/aws_launch_instance.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 added docs/assets/aws_m5_xlarge.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 added docs/assets/aws_ports.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 added docs/assets/aws_security_groups.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 added docs/assets/aws_storage.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 added docs/assets/aws_ubuntu_server.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 added docs/assets/digital_ocean_console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/hubble/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Guides to set up a Hubble instance using various cloud providers.

- [AWS EC2](https://warpcast.notion.site/Set-up-Hubble-on-EC2-Public-23b4e81d8f604ca9bf8b68f4bb086042)
- [Digital Ocean](https://warpcast.notion.site/Set-up-Hubble-on-DigitalOcean-Public-e38173c487874c91828665e73eac94c1)
- [Google Cloud Platform (GCP)](tutorials/gcp.md)
- [AWS EC2](aws-ec2.md)
- [Digital Ocean](digital-ocean.md)
- [Google Cloud Platform (GCP)](gcp.md)
66 changes: 66 additions & 0 deletions docs/hubble/tutorials/aws-ec2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Set up Hubble on EC2 [Public]

## Launch EC2 Instance

*You should expect to pay roughly $100 / month for an EC2 instance that can run Hubble.*

1. In AWS, go to EC2 > **Instances** > **Launch Instances**

<figure><img src="../assets/aws_instances.png" /></figure>

2. Give it a name and select ***Ubuntu Server 22.04 LTS (HVM), SSD Volume Type*** and ***64-bit (x86)***

<figure><img src="../assets/aws_ubuntu_server.png" /></figure>

3. Choose **m5.xlarge** for instance type (~$70/mo)

<figure><img src="../assets/aws_m5_xlarge.png" /></figure>

4. In **Key pair (login)**, select **Create a new key pair** , then select RSA and *.pem* format, and save it

<figure><img src="../assets/aws_key_pair.png" /></figure>

5. In **Network settings**, select **Allow SSH traffic** from **Anywhere**

<figure><img src="../assets/aws_allow_ssh.png" /></figure>

6. In **Configure storage**, select **20 GiB** of gp3 storage ($30/mo)

<figure><img src="../assets/aws_storage.png" /></figure>

7. Click **Launch Instance** on the righthand side menu

<figure><img src="../assets/aws_launch_instance.png" /></figure>

## Configure Network Permissions

1. Go to **EC2 → Instances** and Click on the **Instance ID**

<figure><img src="../assets/aws_instance_id.png" /></figure>

2. Click on **Security** > **Security groups** > (**Security Group ID**)

<figure><img src="../assets/aws_security_groups.png" /></figure>

3. Click on **Edit inbound rules** and **Edit outbound rules** on the group page

<figure><img src="../assets/aws_click_edit.png" /></figure>

4. Add rules until they match the screenshot below

<figure><img src="../assets/aws_inbound rules.png" /></figure>

5. Add port 2281 to the inbound rules if you wish to use the HTTP API

<figure><img src="../assets/aws_ports.png" /></figure>

## Connect to your Instance

1. Find your *.pem* file from earlier and run `chmod 400 key.pem`
2. Go to EC2 → Instances, click on the Instance ID and copy the IPv4 Address
3. Connect with `ssh ubuntu@<ipv4 address> -i key.pem`

## Setup and run Hubble

Follow the remaining instructions on [installing Hubble](http://localhost:5173/operators/install.html)

23 changes: 23 additions & 0 deletions docs/hubble/tutorials/digital-ocean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Set up Hubble on DigitalOcean [Public]

## 1. **Launch Droplet**

*You should expect to pay roughly $70 / month for a Droplet instance that can run Hubble.*

1. In DigitalOcean **Create > Droplet**
2. Choose Image **Ubuntu**
3. Choose version **22.10 x64**
4. Choose size **General Purpose 8GB / 2 CPUs / 25GB SSD**
5. Choose preferred Authentication Method
6. Enter your preferred Hostname

## 2. **Connect to your Instance**

1. Launch a Console

<figure><img src="../assets/digital_ocean_console.png" /></figure>

## 3. **Setup and run Hubble**

Follow the remaining instructions on [running hubble in the cloud](https://github.com/farcasterxyz/hub-monorepo/tree/main/apps/hubble#2-set-up-the-environment)

37 changes: 14 additions & 23 deletions docs/hubble/tutorials/gcp.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
# Run a Hubble on GCP

## Intro

This is a step-by-step guide to setting up Hubble on GCP.
This is a step-by-step guide to setting up Hubble on GCP.
It usually takes less than 30 minutes to complete the whole process.

### Requirements

- [GCP](https://console.cloud.google.com/) account
- [Alchemy](https://www.alchemy.com/) account

### Costs

- GCP setup recommended in this tutorial may cost up to $70/month
- Alchemy usage should stay within the free tier


## Create GCP VM

Open **Google Cloud Shell** and execute the following commands:

<figure><img src="/assets/google_cloud_shell.png" alt=""><figcaption><p>Click on Google Cloud Shell Icon</p></figcaption></figure>
<figure><img src="../assets/images/google_cloud_shell.png" alt=""><figcaption><p>Click on Google Cloud Shell Icon</p></figcaption></figure>

Execute the below commands in the cloud shell:

Expand All @@ -28,10 +26,10 @@ Execute the below commands in the cloud shell:
nano main.tf
</code></pre>

Now paste the content of below into your main.tf \
Now paste the content of below into your main.tf \
Replace "$YOUR_PROJECT_ID" with your personal ID.

<figure><img src="/assets/gcp_project_id.png" /></figure>
<figure><img src="../assets/images/gcp_project_id.png" /></figure>

This is the configuration of your GCP virtual machine that will be created.

Expand All @@ -40,44 +38,36 @@ provider "google" {
project = "$YOUR_PROJECT_ID"
region = "us-central1"
}
resource "google_compute_instance" "farcaster-hub-vm" {
name = "farcaster-hub-vm"
machine_type = "e2-standard-4" # 4 vCPUs, 16 GB memory
zone = "us-central1-a" # Specify the zone here
boot_disk {
initialize_params {
image = "ubuntu-2004-focal-v20231213" # Ubuntu 20.04 LTS image URL
size = 160 # 160 GB disk size
}
}
network_interface {
network = "default"
access_config {
// This will assign a public IP address to the instance
}
}
tags = ["allow-farcaster-p2p-ports"] # For firewall rule
metadata = {
# You can add any additional metadata here if needed
}
}
resource "google_compute_firewall" "farcaster-p2p-ports" {
name = "farcaster-p2p-ports"
network = "default"
# allow incoming traffic for ports 2282-2285
allow {
protocol = "tcp"
ports = ["2282-2285"]
}
source_ranges = ["0.0.0.0/0"]
}
```
Expand All @@ -96,31 +86,32 @@ terraform plan # this will simulate your terraform configuration & check if it i

Example output:

<figure><img src="/assets/gcp_terraform_plan.png" alt=""><figcaption><p>Example output of terraform plan</p></figcaption></figure>
<figure><img src="../assets/images/gcp_terraform_plan.png" alt=""><figcaption><p>Example output of terraform plan</p></figcaption></figure>

Enable Compute Engine API

<figure><img src="/assets/gcp_compute_engine_api.png" /></figure>
<figure><img src="../assets/images/gcp_compute_engine_api.png" /></figure>

Now execute this command:

```bash
terraform apply
```

<figure><img src="/assets/gcp_terraform_apply.png" alt=""><figcaption><p>Example output of Terraform apply</p></figcaption></figure>
<figure><img src="../assets/images/gcp_terraform_apply.png" alt=""><figcaption><p>Example output of Terraform apply</p></figcaption></figure>

It will take a few minutes before the VM is created. Time to enjoy your :coffee:

<figure><img src="/assets/gcp_vm_overview.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../assets/images/gcp_vm_overview.png" alt=""><figcaption></figcaption></figure>

Now you should be able to connect to your VM by clicking on the **SSH** button.

\
Now Install Docker as described here [https://docs.docker.com/engine/install/ubuntu/](https://docs.docker.com/engine/install/ubuntu/)

Now follow the steps as described on [Install page](../install.md) \

Now follow the steps as described on [Install page](../intro/install.md) \
\
Your Hubble is up and running when you see below :white_check_mark:
Your Hubble is up and running when you see below :white\_check\_mark:

<figure><img src="/assets/gcp_hubble_running.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../assets/images/gcp_hubble_running.png" alt=""><figcaption></figcaption></figure>

0 comments on commit c515b7d

Please sign in to comment.