pokt-network / poktroll

The official Shannon upgrade implementation of the Pocket Network Protocol implemented using the Cosmos SDK
MIT License
16 stars 8 forks source link

[Testing] Send shadow traffic to Shannon #747

Closed Olshansk closed 2 months ago

Olshansk commented 3 months ago

Objective

Send real traffic (from Portal on Morse) to Shannon TestNet.

Origin Document

Diagram

Used excalidraw natural language prompt w/ the following text:

The following is a system diagram for a network request:

1. A user sends a curl command to Portal
2. Portal forwards it to a Pocket Network (Morse) Node and gives a response
3. Portal sends a tiny subset of the traffic to AppGateServer
4. AppGateServer sends it to a Pocket Network (Shannon) Supplier
5. The Shannon Supplier uses Portal behind the scenes

Which created this mermaid diagram:

sequenceDiagram
    participant User
    participant Portal
    participant MorseNode as Morse Node
    participant AppGateServer
    participant ShannonSupplier as Shannon Supplier

    User->>Portal: Send curl command
    Portal->>MorseNode: Forward request
    MorseNode->>Portal: Respond
    Note right of Portal: Handle response
    Portal->>AppGateServer: Send subset of traffic
    AppGateServer->>ShannonSupplier: Send request
    ShannonSupplier->>Portal: Use Portal behind the scenes

And this image:

image

Goals

Deliverables


Creator: @Olshansk Co-Owners: @Gustavobelfort

Olshansk commented 2 months ago

This is my personal vultr server to use for this:

Olshansk commented 2 months ago

Discussion happening on internal discord: https://discord.com/channels/824324475256438814/1276262653668495533

Olshansk commented 2 months ago

Can be tested like so:

$ gcloud container clusters get-credentials portal-prd-asia-southeast1 --region asia-southeast1 --project portal-prd-gke-all

$ kubectl port-forward service/mirror-http-mirror 8080:8080 -n middleware

$ curl -vvv --resolve eth-mainnet.rpc.grove.city:8080:127.0.0.1      -H "Host: eth-mainnet.rpc.grove.city"      -H "Content-Type: application/json"      -X POST      -d '{"method": "eth_blockNumber", "params": [], "id": 1, "jsonrpc": "2.0"}'      http://eth-mainnet.rpc.grove.city:8080/v1/b9824cd4 | jq
Olshansk commented 2 months ago

Next steps are going to include:

Olshansk commented 2 months ago

For reference is in appofapps: https://github.com/pokt-foundation/appOfApps/commits/master/

Screenshot 2024-08-26 at 11 11 42 AM
Olshansk commented 2 months ago

https://github.com/pokt-foundation/appOfApps/blob/master/Portal/production/middleware/values/middleware.yaml#L167

Olshansk commented 2 months ago

Note that it is using @Olshansk's personal vultrserver:

  upstream mirror_backend {
      server 104.207.159.194:85;
  }
Olshansk commented 2 months ago

Closing this out w/ the instructions here: https://www.notion.so/buildwithgrove/Shannon-Shadow-Mirror-Traffic-k6-Testing-8ecb66a72adf4047b5601106ccb668d7?pvs=4