|
| 1 | +Wormhole Node |
| 2 | +================================================================================ |
| 3 | + |
| 4 | +Pyth Node is a highly available and versatile software that defines the Pyth |
| 5 | +P2P network, Pyth API, and connects with the Pyth Geyser node software to |
| 6 | +listen for PythNet events. It offers both REST and Websocket APIs for ease of |
| 7 | +integration and interaction with the Pyth network stack. |
| 8 | + |
| 9 | +The Node can be run by anyone who wishes to participate / observe the PythNet |
| 10 | +network operations. |
| 11 | + |
| 12 | +Overview |
| 13 | +-------------------------------------------------------------------------------- |
| 14 | + |
| 15 | +Pyth was initially designed as a simple "Price Service" with a REST API. |
| 16 | +However, as the project evolved, its architecture has been rethought and |
| 17 | +improved to be a more general node software that incorporates the Price Service |
| 18 | +as one of its components. |
| 19 | + |
| 20 | +The new architecture is more in line with other well-known projects in the |
| 21 | +blockchain and P2P space, such as Solana, Bitcoin, and Cosmos chains, where |
| 22 | +users who run the node can also act as observers with specific features |
| 23 | +disabled. In our case, the node software can be run with or without a PythNet |
| 24 | +validator running. |
| 25 | + |
| 26 | +Pyth Node has several responsibilities: |
| 27 | + |
| 28 | +- Offering a REST and Websocket API to interact with the Pyth network. |
| 29 | +- Connecting to the Wormhole P2P network and listening for Pyth-related VAAs/Messages. |
| 30 | +- Connecting to the Pyth P2P network and sharing Pyth-specific Account Updates. |
| 31 | +- Connecting to PythNet itself via our Geyser plugin to allow for a fully |
| 32 | + decentralised PythNet. |
| 33 | + |
| 34 | +The node is designed to fetch updates from either Pyth or Geyser networks for |
| 35 | +high availability. |
| 36 | + |
| 37 | +Architecture |
| 38 | +-------------------------------------------------------------------------------- |
| 39 | + |
| 40 | +The Pyth Node software consists of the following components: |
| 41 | + |
| 42 | +- *Wormhole P2P Connector*: Responsible for connecting to the Wormhole P2P network and listening for VAAs. |
| 43 | +- *Pyth P2P Connector*: Responsible for connecting to the Pyth P2P network and listening for Account Updates. |
| 44 | +- *Geyser Connector*: Responsible for connecting to the Geyser node software and listening for Account Updates. It can be disabled if desired to run the node as an observer, only listening to the Pyth P2P network. |
| 45 | +- *REST API*: Provides an interface for external applications to interact with the node and retrieve information from the connected networks. |
| 46 | +- *Websocket API*: Offers real-time data streaming and interaction with the node, enabling efficient updates and communication. |
| 47 | + |
| 48 | +Justification for the New Architecture |
| 49 | +-------------------------------------------------------------------------------- |
| 50 | + |
| 51 | +The new architecture allows for increased flexibility and high availability by |
| 52 | +incorporating multiple components that can be enabled or disabled based on |
| 53 | +specific use cases. |
| 54 | + |
| 55 | +In particular this allows user's to run the node in order to participate in the |
| 56 | +Pyth P2P network to observe prices and serve their own API/RPC. It also allows |
| 57 | +a better data ownership model that allow's the Node software to be the main |
| 58 | +source of responsibility when interacting with Pyth. |
| 59 | + |
| 60 | +Getting Started |
| 61 | +-------------------------------------------------------------------------------- |
| 62 | + |
| 63 | +To set up and run a Pyth Node, follow the steps below: |
| 64 | + |
| 65 | +1. Install Rust: If you haven't already, you'll need to install Rust. You can |
| 66 | + do so by following the official instructions here. |
| 67 | +2. Clone the repository: Clone the Wormhole Node repository to your local |
| 68 | + machine using the following command: |
| 69 | + ```bash |
| 70 | + git clone https://github.com/yourusername/wormhole-node.git |
| 71 | + ``` |
| 72 | +3. Build the project: Navigate to the project directory and run the following command to build the project: |
| 73 | + ```bash |
| 74 | + cd wormhole-node |
| 75 | + cargo build --release |
| 76 | + ``` |
| 77 | + This will create a binary in the target/release directory. |
| 78 | +4. Run the node: To run the Wormhole Node, use the following command, replacing |
| 79 | + ```bash |
| 80 | + ./target/release/pyth-node run |
| 81 | + ``` |
| 82 | + The Wormhole Node will now start and connect to the specified networks. You |
| 83 | + can interact with the node using the REST and Websocket APIs as described |
| 84 | + in the [API Documentation](). |
| 85 | + ``` |
0 commit comments