Skip to content

Commit

Permalink
Merge pull request #559 from Chia-Network/misc_issue_resolutions
Browse files Browse the repository at this point in the history
Misc issue resolutions
  • Loading branch information
BrandtH22 committed May 15, 2024
2 parents b79fce8 + 7af3ac6 commit 14d3bc8
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 17 deletions.
17 changes: 17 additions & 0 deletions docs/cli-reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ Command: `chia start {service}`

`-r, --restart`: Restart of running processes

| | Full Node | Wallet | Farmer | Harvester | Timelord | Timelord Launcher | Timelord-Only | Introducer | Full Node Simulator |
| ----------------- | --------- | ------ | ------ | --------- | -------- | ----------------- | ------------- | ---------- | ------------------- |
| all | X | X | X | X | X | X | | | |
| node | X | | | | | | | | |
| harvester | | | | X | | | | | |
| farmer | X | X | X | X | | | | | |
| farmer-no-wallet | X | | X | X | | | | | |
| farmer-only | | | X | | | | | | |
| timelord | X | | | | X | X | | | |
| timelord-only | | | | | X | | X | | |
| timelord-launcher | | | | | | X | | | |
| wallet | X | X | | | | | | | |
| wallet-only | | X | | | | | | | |
| introducer | | | | | | | | X | |
| simulator | | | | | | | | | X |

# plotters

In 2.1.0 the option to use different plotters including compressed plotter was introduced. Each plotter has slightly different hardware requirements and may need slightly different options specified.
Expand Down Expand Up @@ -347,6 +363,7 @@ Options:
Commands:
completion Generate shell completion
configure Modify configuration
dao Create, manage or show state of DAOs
data Manage your data
db Manage the blockchain database
dev Developer commands and tools
Expand Down
2 changes: 2 additions & 0 deletions docs/protocol/harvester-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Harvester Protocol
slug: /harvester-protocol
---

[Harvester protocol source](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/harvester_protocol.py)

The harvester protocol defines the messages sent between a farmer service and a harvester service. These tend to
be on the same machine for small farmers, but for medium or large farmers they can be in multiple machines.

Expand Down
2 changes: 2 additions & 0 deletions docs/protocol/networking-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Networking Protocol
slug: /networking-protocol
---

[Shared networking protocol source](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/shared_protocol.py)

The Chia protocol is asynchronous and peer-to-peer. It runs on top of WebSockets on port 8444 (or other ports for farmers and timelords). All nodes act as both clients and servers, and can maintain long-term connections with other peers.

Every message in the Chia protocol is composed of bytes, using the Streamable format, and sent as a WebSocket message. Each message is composed of three parts:
Expand Down
2 changes: 2 additions & 0 deletions docs/protocol/peer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Peer Protocol
slug: /peer-protocol
---

[Peer protocol source](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/full_node_protocol.py)

This protocol is a bidirectional protocol for communication between full nodes in the Chia system.
The sender is the full node sending the message, and the recipient is the full node that is receiving the message.

Expand Down
20 changes: 14 additions & 6 deletions docs/protocol/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ The Chia protocol is composed of a few different sub-protocols. All protocol mes

The protocol is asynchronous and bidirectional, that is, each end of the connection can send messages, and receive a response, multiple responses, or no response for each message.

1. Harvester protocol (harvester \<-> farmer)
2. Farmer protocol (farmer \<-> full node)
3. Timelord protocol (timelord \<-> full node)
4. Peer protocol (full node \<-> full node)
5. Pool protocol (pool \<-> farmer)
6. Wallet protocol (wallet/light client \<-> full node)
1. [Harvester protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/harvester_protocol.py) (harvester \<-> farmer)
2. [Farmer protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/farmer_protocol.py) (farmer \<-> full node)
3. [Timelord protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/timelord_protocol.py) (timelord \<-> full node)
4. [Peer protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/full_node_protocol.py) (full node \<-> full node)
5. [Pool protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/pool_protocol.py) (pool \<-> farmer)
6. [Wallet protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/wallet_protocol.py) (wallet/light client \<-> full node)
7. [Introducer protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/introducer_protocol.py) (introducer \<-> full node)

In addition to the sub-protocols that are specific to services, a few protocols are shared across all or most services.

1. [Shared networking protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/shared_protocol.py)
2. [Timing protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/protocol_timing.py)
3. [Message types protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/protocol_message_types.py)
4. [State machine protocol](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/protocol_state_machine.py)
2 changes: 2 additions & 0 deletions docs/protocol/wallet-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Wallet Protocol
slug: /wallet-protocol
---

[Wallet protocol source](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/wallet_protocol.py)

This protocol is a bidirectional protocol for communication between full nodes and wallets in the Chia system.
This is also sometimes referred to as the light client protocol.

Expand Down
29 changes: 19 additions & 10 deletions docs/rpc-reference/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ wsapp.close()

#### WebSockets Example Output

(Long strings have been replace with `XxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`.)
(Long strings have been replaced with `XxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`.)

```json
Starting Something
Expand Down Expand Up @@ -163,12 +163,21 @@ namespace ChiaExamples

## Services

The service RPC APIs are documented in the following sections:
TODO: add links here and create the other sections

- Shared: RPCs that all services share
- Full Node
- Farmer
- Harvester
- Timelord
- Wallet (This API is still a WIP and likely to change soon)
| Service | Managed Objects | Associated API | Associated RPC API |
| ----------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| FarmerService | [Farmer](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/farmer/farmer.py) | [FarmerAPI](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/farmer/farmer_api.py) | [FarmerRpcApi](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/farmer_rpc_api.py) |
| FullNodeService | [FullNode](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/full_node/full_node.py) | [FullNodeAPI](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/full_node/full_node_api.py) | [FullNodeRpcApi](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/full_node_rpc_api.py) |
| HarvesterService | [Harvester](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/harvester/harvester.py) | [HarvesterAPI](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/harvester/harvester_api.py) | [HarvesterRpcApi](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/harvester_rpc_api.py) |
| IntroducerService | [Introducer](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/introducer/introducer.py) | [IntroducerAPI](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/introducer/introducer_api.py) | [FullNodeRpcApi](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/full_node_rpc_api.py) |
| CrawlerService | [Crawler](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/seeder/crawler.py) | [CrawlerAPI](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/seeder/crawler_api.py) | [CrawlerRpcApi](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/crawler_rpc_api.py) |
| DataLayerService | [DataLayer](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/data_layer/data_layer.py) | [DataLayerAPI](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/data_layer/data_layer_api.py) | [DataLayerRpcApi](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/data_layer_rpc_api.py) |
| TimelordService | [Timelord](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/timelord/timelord.py) | [TimelordAPI](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/timelord/timelord_api.py) | [TimelordRpcApi](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/timelord_rpc_api.py) |
| WalletService | [WalletNode](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/wallet/wallet_node.py) | [WalletNodeAPI](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/wallet/wallet_node_api.py) | [WalletRpcApi](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/wallet_rpc_api.py) |

**Explanation:**
Each service is composed of a managed object, an API for control, and an RPC API for remote control. The combination of these into the service is controlled by the [service alias](https://github.com/Chia-Network/chia-blockchain/blob/main/chia/types/aliases.py) types.

- **Service**: This column lists the different manager services within the Chia system.
- **Managed Objects**: This column details the core entities or components that each service oversees.
- **Associated API**: This column specifies the API class associated with each service. This API class defines the interface for interacting with the corresponding managed objects.
- **Associated RPC API**: This column lists the RPC API class associated with each service. This RPC API class allows for remote control of the managed objects through Remote Procedure Calls (RPC).
29 changes: 28 additions & 1 deletion docs/rpc-reference/wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,19 @@ Request Parameters:
| :------------- | :--- | :------- | :--------------------------------------------------------------------------------------------------------------------------- |
| transaction_id | TEXT | True | The ID of the transaction to obtain. This is listed as `name` in the output of the [get_transactions](#get_transactions) RPC |

<details>
<summary>Notes about transactions</summary>
The transaction history is not deterministic due to heuristics we use to counter privacy features of the blockchain. This means, a couple of details cannot be fetched fully:
- The transaction IDs can and will change if you resync the wallet
- Transactions of assets other than xch (cat, nft, ...) which include a fee will cause a second fee-transaction in the xch currency wallet (wallet 1)
- Offers are split into multiple transactions on the corresponding wallets
- Transactions of one Offer do not share the same id`s. To match them up, it is best to keep the offer files
- The transaction time is a rough estimate. When an offer is accepted, the individual transactions of one offer can/will have slightly differing transaction times
- For your offers which were accepted by a 3rd Party , the incoming coins are beeing marked as incoming transaction, not as incoming trade
- When cancelling offers, the cancellation Transactions are beeing shown as transaction, not as trade
For accurate records, you should keep a local record of transactions (TXs) and the Offer files made.
</details>

<details>
<summary>Example</summary>

Expand Down Expand Up @@ -1768,9 +1781,23 @@ Request Parameters:
| reverse | BOOLEAN | False | Set to `true` to sort the results in reverse order [Default: false] |
| to_address | STRING | False | Only include transactions with this `to_address` [Default: None] |

Note: By default, the function lists the oldest transactions first. This is recommended for building a transaction history due to pagination.
<details>
<summary>Notes about transactions</summary>
By default, the function lists the oldest transactions first. This is recommended for building a transaction history due to pagination.
If reverse is set to true, it lists the newest transactions first. This is most useful for fetching recent transactions.

The transaction history is not deterministic due to heuristics we use to counter privacy features of the blockchain. This means, a couple of details cannot be fetched fully:

- The transaction IDs can and will change if you resync the wallet
- Transactions of assets other than xch (cat, nft, ...) which include a fee will cause a second fee-transaction in the xch currency wallet (wallet 1)
- Offers are split into multiple transactions on the corresponding wallets
- Transactions of one Offer do not share the same id`s. To match them up, it is best to keep the offer files
- The transaction time is a rough estimate. When an offer is accepted, the individual transactions of one offer can/will have slightly differing transaction times
- For your offers which were accepted by a 3rd Party , the incoming coins are beeing marked as incoming transaction, not as incoming trade
- When cancelling offers, the cancellation Transactions are beeing shown as transaction, not as trade
For accurate records, you should keep a local record of transactions (TXs) and the Offer files made.
</details>

<details>
<summary>Example 1: List a single XCH transaction</summary>

Expand Down

0 comments on commit 14d3bc8

Please sign in to comment.