P2W Focused README/DEVELOP.md (#220)

* readme: Update README to reflect P2W structure

* readme: fix URLs
This commit is contained in:
Reisen 2022-05-23 08:48:34 +02:00 committed by GitHub
parent 2c1e987b31
commit 2eb0ed7d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 84 deletions

View File

@ -113,79 +113,3 @@ of your choice to control access. For GCP, we ship a script that automatically r
scripts/tilt-gcp-up.sh scripts/tilt-gcp-up.sh
If something breaks, just run `minikube delete` and start from scratch by running `start-recommended-minikube`. If something breaks, just run `minikube delete` and start from scratch by running `start-recommended-minikube`.
### VSCode remote development
VSCode's SSH remote development plugin is known to work well with the workflow described above.
### IntelliJ remote development
IntelliJ's [remote development backend](https://www.jetbrains.com/remote-development/gateway/) is reported to work as well. Just install Jetbrains Gateway on your local machine, connect it to your remote VM via SSH, and pick the latest IntelliJ release. Your local license, keymap and theme - if any - will be used automatically.
[Projector](https://lp.jetbrains.com/projector/) should also work for clients that can't run the native UI locally
(if you want to code on your VR headset, smart toaster or Chromebook - this is the way!).
## Tips and tricks
### Call gRPC services
tools/bin/grpcurl -protoset <(tools/bin/buf build -o -) -plaintext localhost:7072 spy.v1.SpyRPCService/SubscribeSignedVAA
With parameters (using proto json encoding):
tools/bin/grpcurl -protoset <(tools/bin/buf build -o -) \
-d '{"filters": [{"emitter_filter": {"emitter_address": "574108aed69daf7e625a361864b1f74d13702f2ca56de9660e566d1d8691848d", "chain_id": "CHAIN_ID_SOLANA"}}]}' \
-plaintext localhost:7072 spy.v1.SpyRPCService/SubscribeSignedVAA
### Post messages
To Solana:
kubectl exec solana-devnet-0 -c setup -- client post-message Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o 1 confirmed ffff
To Solana as CPI instruction:
kubectl exec solana-devnet-0 -c setup -- client post-message --proxy CP1co2QMMoDPbsmV7PGcUTLFwyhgCgTXt25gLQ5LewE1 Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o 1 confirmed ffff
### Observation Requests
kubectl exec -it guardian-0 -- /guardiand admin send-observation-request --socket /tmp/admin.sock 1 4636d8f7593c78a5092bed13dec765cc705752653db5eb1498168c92345cd389
### IntelliJ Protobuf Autocompletion
Locally compile protos to populate the buf cache:
make generate
Set the include path:
![](https://i.imgur.com/bDij6Cu.png)
### BigTable event persistence
Guardian events can be persisted to a cloud BigTable instance by passing a GCP project and service account key to Tilt.
Launch the devnet with flags supplying your database info to forward events to your cloud BigTable, rather than the local devnet BigTable emulator:
tilt up -- --num=1 --gcpProject=your-project-id --bigTableKeyPath=./your-service-account-key.json
### bridge UI
Run the bridge UI in devnet by supplying the `--bridge_ui` flag:
tilt up -- --bridge_ui
### Algorand
Node logs:
kubectl exec -c algod algorand-0 -- tail -f /network/Node/node.log
kubectl exec -c algod algorand-0 -- tail -f /network/Primary/node.log
Account list:
kubectl exec -c goal-kmd algorand-0 -- ./goal account list
Get yourself a working shell:
kubectl exec -c goal-kmd algorand-0 -it shell-demo -- /bin/bash

View File

@ -1,16 +1,58 @@
# Wormhole v2 # Pyth2Wormhole
This repository contains Certus One's reference node implementation for the Wormhole project. This repository acts as a monorepo for the various components that make up
Pyth2Wormhole. The base repository is a fork from Certus One's reference
[Wormhole][] implementation in order to take advantage of the existing tooling
for building projects based on Wormhole's various SDKs. Much of the existing
documentation from there will also apply to this repository.
[Wormhole]: https://github.com/certusone/wormhole
Within this monorepo you will find the following subprojects:
## Pyth2Wormhole Solana
> solana/pyth2wormhole
The main Pyth implementation currently exists as an [on-chain contract][] on
Solana. In order to expose these prices cross-chain, the Pyth2Wormhole Solana
contract acts as a sender for Pyth prices. At regular intervals the Pyth
contract will observe the current Pyth price for selected products, and produce
an attestation which is then relayed over Wormhole to be consumed by the
various P2W receiver contracts.
[on-chain contract]: https://github.com/pyth-network/pyth-client
## Pyth2Wormhole Ethereum
> ethereum/contracts/pyth
The Ethereum P2W contract acts as a receiver for Pyth prices relayed from the
P2W Solana contract. It also provides a public API for other Ethereum contracts
that can be used to consume Pyth prices. For a guide on using this API to
consume Pyth price feeds see [pyth-evm-sdk][] which contains documented
examples.
[pyth-evm-sdk]: https://github.com/pyth-network/pyth-sdk-solidity
## Pyth2Wormhole Price Service
> third_party/pyth
The P2W Price Service is an off-chain service which constantly observes the
Wormhole network watching for price attestations emitted from the Pyth Solana
contract. It exposes all observed attestations via a public API over HTTPS/WSS
which can be consumed by client-side applications that wish to use Pyth pricing
data.
For a guide on utilising this service in your project, see the documentation in
the [pyth-js][] repository.
[pyth-js]: https://github.com/pyth-network/pyth-js
--------------------------------------------------------------------------------
See [DEVELOP.md](DEVELOP.md) for instructions on how to set up a local devnet, and See [DEVELOP.md](DEVELOP.md) for instructions on how to set up a local devnet, and
[CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to contribute to this project. [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to contribute to this project.
See [docs/operations.md](docs/operations.md) for node operator instructions.
![](docs/images/overview.svg)
**Wormhole v2 is in active development - see "main" branch for the v1 mainnet version**
### Audit / Feature Status ### Audit / Feature Status
⚠ **This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ⚠ **This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or