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
45 changes: 45 additions & 0 deletions .github/workflows/attester-image-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push Images
on:
push:
tags:
- pyth-attester-v*
workflow_dispatch:
inputs:
dispatch_description:
description: "Dispatch description"
required: true
type: string
permissions:
contents: read
id-token: write
jobs:
p2w-attest-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set image tag to version of the git tag
if: ${{ startsWith(github.ref, 'refs/tags/pyth-attester-v') }}
run: |
PREFIX="refs/tags/pyth-attester-"
VERSION="${GITHUB_REF:${#PREFIX}}"
echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
- name: Set image tag to the git commit hash
if: ${{ !startsWith(github.ref, 'refs/tags/pyth-attester-v') }}
run: |
echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}"
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
with:
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
aws-region: eu-west-2
- uses: docker/login-action@v2
with:
registry: public.ecr.aws
env:
AWS_REGION: us-east-1
- run: |
DOCKER_BUILDKIT=1 docker build -f Dockerfile.client -t bridge-client .
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f third_party/pyth/Dockerfile.p2w-attest .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
env:
ECR_REGISTRY: public.ecr.aws
ECR_REPOSITORY: pyth-network/xc-attest
47 changes: 0 additions & 47 deletions .github/workflows/image-push.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/price-service-image-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push Images
on:
push:
tags:
- pyth-price-service-v*
workflow_dispatch:
inputs:
dispatch_description:
description: "Dispatch description"
required: true
type: string
permissions:
contents: read
id-token: write
jobs:
price-service-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set image tag to version of the git tag
if: ${{ startsWith(github.ref, 'refs/tags/pyth-price-service-v') }}
run: |
PREFIX="refs/tags/pyth-price-service-"
VERSION="${GITHUB_REF:${#PREFIX}}"
echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
- name: Set image tag to the git commit hash
if: ${{ !startsWith(github.ref, 'refs/tags/pyth-price-service-v') }}
run: |
echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}"
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
with:
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
aws-region: eu-west-2
- uses: docker/login-action@v2
with:
registry: public.ecr.aws
env:
AWS_REGION: us-east-1
- run: |
DOCKER_BUILDKIT=1 docker build -f Dockerfile.wasm -o type=local,dest=. .
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f third_party/pyth/price-service/Dockerfile.price_service .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
env:
ECR_REGISTRY: public.ecr.aws
ECR_REPOSITORY: pyth-network/xc-server
26 changes: 0 additions & 26 deletions Dockerfile.guardian

This file was deleted.

6 changes: 0 additions & 6 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ local_resource(
)


docker_build(
ref = "guardiand-image",
context = ".",
dockerfile = "Dockerfile.guardian",
)

def build_node_yaml():
node_yaml = read_yaml_stream("devnet/node.yaml")

Expand Down
2 changes: 1 addition & 1 deletion devnet/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
path: bigtable-key.json
containers:
- name: guardiand
image: guardiand-image
image: ghcr.io/certusone/guardiand:v2.8.8.1
volumeMounts:
- mountPath: /run/node
name: node-rundir
Expand Down
4 changes: 2 additions & 2 deletions devnet/spy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ spec:
terminationGracePeriodSeconds: 0
containers:
- name: spy
image: guardiand-image
image: ghcr.io/certusone/guardiand:v2.8.8.1
command:
- /guardiand
- spy
- --nodeKey
- /tmp/node.key
- /node.key
- --spyRPC
- "[::]:7072"
# Hardcoded devnet bootstrap (generated from deterministic key in guardiand)
Expand Down
25 changes: 9 additions & 16 deletions third_party/pyth/price-service/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
# Pyth Price Service

This service exposes a REST api to provide latest attestation message for a price feed id.
This service exposes a REST and WS api to provide latest attestation message for a price feed id.

## Build

To build the spy_guardian docker container:
To build the pyth_price_service docker container from the repo root:

```
$ docker build -f Dockerfile.spy_guardian -t spy_guardian .
```

To build the pyth_price_service docker container:

```
$ docker build -f Dockerfile.pyth_price_service -t pyth_price_service .
$ docker build -f third_party/pyth/price-service/Dockerfile.pyth_price_service -t pyth_price_service .
```

Run the spy_guardian docker container in TestNet:

```
$ docker run --platform linux/amd64 -d --network=host spy_guardian \
$ docker run --platform linux/amd64 -d --network=host ghcr.io/certusone/guardiand:v2.8.8.1 spy \
--nodeKey /node.key --spyRPC "[::]:7073" \
--bootstrap /dns4/wormhole-testnet-v2-bootstrap.certus.one/udp/8999/quic/p2p/12D3KooWBY9ty9CXLBXGQzMuqkziLntsVcyz4pk1zWaJRvJn6Mmt \
--network /wormhole/testnet/2/1 \
--spyRPC "[::]:7073"
--network /wormhole/testnet/2/1
```

Or run the spy_guardian docker container in MainNet:
For the MainNet gossip network parameters, see https://github.com/certusone/wormhole-networks/blob/master/mainnetv2/info.md

```
$ docker run --platform linux/amd64 -d --network=host spy_guardian \
$ docker run --platform linux/amd64 -d --network=host ghcr.io/certusone/guardiand:v2.8.8.1 spy \
--nodeKey /node.key --spyRPC "[::]:7073" \
--bootstrap <guardianNetworkBootstrapParameterForMainNet> \
--network <guardianNetworkPathForMainNet> \
--spyRPC "[::]:7073"

```

Then to run the pyth_price_service docker container using a config file called
Expand All @@ -43,7 +36,7 @@ following:
```
$ docker run \
--volume=${HOME}/pyth_price_service:/var/pyth_price_service \
-e pyth_price_service_CONFIG=/var/pyth_price_service/env \
-e PYTH_PRICE_SERVICE_CONFIG=/var/pyth_price_service/env \
--network=host \
-d \
pyth_price_service
Expand Down
12 changes: 6 additions & 6 deletions third_party/pyth/price-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion third_party/pyth/price-service/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@pythnetwork/price-service",
"name": "@pythnetwork/pyth-price-service",
"version": "1.0.0",
"description": "Pyth Price Service",
"main": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions third_party/pyth/price-service/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { RestAPI } from "./rest";
import { WebSocketAPI } from "./ws";

let configFile: string = ".env";
if (process.env.PYTH_RELAY_CONFIG) {
configFile = process.env.PYTH_RELAY_CONFIG;
if (process.env.PYTH_PRICE_SERVICE_CONFIG) {
configFile = process.env.PYTH_PRICE_SERVICE_CONFIG;
}

console.log("Loading config file [%s]", configFile);
Expand Down