pyth2wormhole: rename p2w-client service to p2w-attest
Change-Id: I34a53146919c12ab41b958cc8cd57108ee509faa
This commit is contained in:
parent
19c475e4a6
commit
05edb3d14f
20
Tiltfile
20
Tiltfile
|
@ -198,30 +198,20 @@ if pyth:
|
||||||
|
|
||||||
# pyth2wormhole client autoattester
|
# pyth2wormhole client autoattester
|
||||||
docker_build(
|
docker_build(
|
||||||
ref = "p2w-client",
|
ref = "p2w-attest",
|
||||||
context = ".",
|
context = ".",
|
||||||
only = ["./solana", "./third_party"],
|
only = ["./solana", "./third_party"],
|
||||||
dockerfile = "./third_party/pyth/Dockerfile.p2w-client",
|
dockerfile = "./third_party/pyth/Dockerfile.p2w-attest",
|
||||||
ignore = ["./solana/*/target"],
|
ignore = ["./solana/*/target"],
|
||||||
)
|
)
|
||||||
|
|
||||||
k8s_yaml_with_ns("devnet/p2w-client.yaml")
|
k8s_yaml_with_ns("devnet/p2w-attest.yaml")
|
||||||
|
|
||||||
k8s_resource(
|
k8s_resource(
|
||||||
"p2w-client",
|
"p2w-attest",
|
||||||
resource_deps = ["solana-devnet", "pyth"],
|
resource_deps = ["solana-devnet", "pyth", "guardian"],
|
||||||
port_forwards = [],
|
port_forwards = [],
|
||||||
)
|
)
|
||||||
|
|
||||||
# pyth2wormhole JS SDK test
|
|
||||||
local_resource(
|
|
||||||
name = "p2w-sdk-test",
|
|
||||||
resource_deps = ["wasm-gen"],
|
|
||||||
deps = ["third_party/pyth", "ethereum", "sdk"],
|
|
||||||
cmd = "tilt docker build -- -f ./third_party/pyth/p2w-sdk/Dockerfile .",
|
|
||||||
env = {"DOCKER_BUILDKIT": "1"},
|
|
||||||
)
|
|
||||||
|
|
||||||
k8s_yaml_with_ns("devnet/eth-devnet.yaml")
|
k8s_yaml_with_ns("devnet/eth-devnet.yaml")
|
||||||
|
|
||||||
k8s_resource("eth-devnet", port_forwards = [
|
k8s_resource("eth-devnet", port_forwards = [
|
||||||
|
|
|
@ -2,38 +2,38 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: p2w-client
|
name: p2w-attest
|
||||||
labels:
|
labels:
|
||||||
app: p2w-client
|
app: p2w-attest
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- port: 8001
|
- port: 4343
|
||||||
name: http
|
name: p2w-attest
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
clusterIP: None
|
clusterIP: None
|
||||||
selector:
|
selector:
|
||||||
app: p2w-client
|
app: p2w-attest
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: p2w-client
|
name: p2w-attest
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: p2w-client
|
app: p2w-attest
|
||||||
serviceName: p2w-client
|
serviceName: p2w-attest
|
||||||
replicas: 1
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: p2w-client
|
app: p2w-attest
|
||||||
spec:
|
spec:
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
terminationGracePeriodSeconds: 0
|
terminationGracePeriodSeconds: 0
|
||||||
containers:
|
containers:
|
||||||
- name: p2w-client
|
- name: p2w-attest
|
||||||
image: p2w-client
|
image: p2w-attest
|
||||||
command:
|
command:
|
||||||
- python3
|
- python3
|
||||||
- /usr/src/pyth/p2w_autoattest.py
|
- /usr/src/pyth/p2w_autoattest.py
|
||||||
|
@ -43,3 +43,7 @@ spec:
|
||||||
port: 2000
|
port: 2000
|
||||||
periodSeconds: 1
|
periodSeconds: 1
|
||||||
failureThreshold: 300
|
failureThreshold: 300
|
||||||
|
ports:
|
||||||
|
- containerPort: 4343
|
||||||
|
name: p2w-attest
|
||||||
|
protocol: TCP
|
|
@ -0,0 +1,41 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: p2w-relay
|
||||||
|
labels:
|
||||||
|
app: p2w-relay
|
||||||
|
spec:
|
||||||
|
clusterIP: None
|
||||||
|
selector:
|
||||||
|
app: p2w-relay
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: p2w-relay
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: p2w-relay
|
||||||
|
serviceName: p2w-relay
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: p2w-relay
|
||||||
|
spec:
|
||||||
|
restartPolicy: Always
|
||||||
|
terminationGracePeriodSeconds: 0
|
||||||
|
containers:
|
||||||
|
- name: p2w-relay
|
||||||
|
image: p2w-relay
|
||||||
|
command:
|
||||||
|
- node
|
||||||
|
- /usr/src/third_party/pyth/p2w-sdk/lib/autorelayer.js
|
||||||
|
tty: true
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 2000
|
||||||
|
periodSeconds: 1
|
||||||
|
failureThreshold: 300
|
|
@ -10,9 +10,6 @@ spec:
|
||||||
selector:
|
selector:
|
||||||
app: pyth
|
app: pyth
|
||||||
ports:
|
ports:
|
||||||
- port: 8898
|
|
||||||
name: pyth-tx
|
|
||||||
protocol: TCP
|
|
||||||
- port: 4242
|
- port: 4242
|
||||||
name: pyth-accounts
|
name: pyth-accounts
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
|
|
@ -76,6 +76,7 @@ COPY --from=build /usr/src/bridge/pyth2wormhole/program/bundler third_party/pyth
|
||||||
COPY --from=build /usr/src/bridge/bridge/program/bundler explorer/wasm/core
|
COPY --from=build /usr/src/bridge/bridge/program/bundler explorer/wasm/core
|
||||||
COPY --from=build /usr/src/bridge/modules/token_bridge/program/bundler explorer/wasm/token
|
COPY --from=build /usr/src/bridge/modules/token_bridge/program/bundler explorer/wasm/token
|
||||||
COPY --from=build /usr/src/bridge/modules/nft_bridge/program/bundler explorer/wasm/nft
|
COPY --from=build /usr/src/bridge/modules/nft_bridge/program/bundler explorer/wasm/nft
|
||||||
|
COPY --from=build /usr/src/bridge/bridge/program/bundler third_party/pyth/p2w-sdk/src/solana/wormhole-core
|
||||||
|
|
||||||
COPY --from=build /usr/src/bridge/bridge/program/nodejs sdk/js/src/solana/core-node
|
COPY --from=build /usr/src/bridge/bridge/program/nodejs sdk/js/src/solana/core-node
|
||||||
COPY --from=build /usr/src/bridge/modules/token_bridge/program/nodejs sdk/js/src/solana/token-node
|
COPY --from=build /usr/src/bridge/modules/token_bridge/program/nodejs sdk/js/src/solana/token-node
|
||||||
|
|
|
@ -13,5 +13,6 @@ RUN --mount=type=cache,target=/root/.cache \
|
||||||
chmod a+rx /usr/src/pyth/*.py
|
chmod a+rx /usr/src/pyth/*.py
|
||||||
|
|
||||||
ENV P2W_OWNER_KEYPAIR="/usr/src/solana/keys/p2w_owner.json"
|
ENV P2W_OWNER_KEYPAIR="/usr/src/solana/keys/p2w_owner.json"
|
||||||
|
ENV P2W_ATTESTATIONS_PORT="4343"
|
||||||
ENV PYTH_PUBLISHER_KEYPAIR="/usr/src/solana/keys/pyth_publisher.json"
|
ENV PYTH_PUBLISHER_KEYPAIR="/usr/src/solana/keys/pyth_publisher.json"
|
||||||
ENV PYTH_PROGRAM_KEYPAIR="/usr/src/solana/keys/pyth_program.json"
|
ENV PYTH_PROGRAM_KEYPAIR="/usr/src/solana/keys/pyth_program.json"
|
|
@ -12,9 +12,15 @@ ADD sdk/js/ .
|
||||||
RUN --mount=type=cache,target=/home/node/.npm \
|
RUN --mount=type=cache,target=/home/node/.npm \
|
||||||
npm ci
|
npm ci
|
||||||
|
|
||||||
# Build p2w-sdk
|
# Build p2w-sdk in dir preserving directory structure
|
||||||
|
WORKDIR /usr/src/third_party/pyth/p2w-sdk
|
||||||
|
COPY third_party/pyth/p2w-sdk/package.json third_party/pyth/p2w-sdk/package-lock.json .
|
||||||
|
RUN --mount=type=cache,target=/root/.cache \
|
||||||
|
--mount=type=cache,target=/root/.npm \
|
||||||
|
npm ci
|
||||||
|
|
||||||
WORKDIR /usr/src/third_party/pyth/p2w-sdk
|
WORKDIR /usr/src/third_party/pyth/p2w-sdk
|
||||||
COPY third_party/pyth/p2w-sdk .
|
COPY third_party/pyth/p2w-sdk .
|
||||||
RUN --mount=type=cache,target=/root/.cache \
|
RUN --mount=type=cache,target=/root/.cache \
|
||||||
--mount=type=cache,target=/root/.npm \
|
--mount=type=cache,target=/root/.npm \
|
||||||
npm ci && npm run build-test && npm run test
|
npm run build-test
|
||||||
|
|
Loading…
Reference in New Issue