-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: major rework of trin book (#1556)
Introduction is more focused on first-time users. It pushes back some of the conceptual stuff, tries to explain several things more clearly, and updates some stale info. Also, it adds an overall Portal benefits page. It's just a rough first stab, to have something in place to update as we move forward.
- Loading branch information
Showing
13 changed files
with
311 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Portal vs Standard Clients | ||
|
||
This page is not trying to be an unbiased comparison. Obviously we think Portal is cool. Below is why we think so. Of course, we still identify known drawbacks of using the Portal Network. | ||
|
||
## What are standard clients? | ||
|
||
These are also known as Execution Layer clients. The [top three by usage](https://clientdiversity.org/) are Geth, Nethermind, and Besu. There are more great ones out there. | ||
|
||
You would use standard clients if you want to stake ether, or access on-chain contracts or generate transactions without using a third-party service. | ||
|
||
## Standard client challenges | ||
|
||
In general, the following are challenges with all standard clients: | ||
|
||
- First-time sync: can take days or more | ||
- High storage needs: 2 Terabytes or more | ||
- Connectivity sensitivity: going offline overnight means spending a while to catch up | ||
- Non-trivial CPU usage: you'll notice it running on your laptop | ||
|
||
## Portal benefits | ||
|
||
In contrast, Portal Network was designed to overcome these challenges. For example: | ||
|
||
### Sync | ||
|
||
First-time sync is very fast. You can be up and running in minutes. | ||
|
||
All Portal needs to do is download data for the Consensus Layer to identify the tip of the chain signed by stakers. The client can then validate all past Execution Layer data. | ||
|
||
### Storage | ||
|
||
The amount you store is fully configurable. You could run with 10 MB, if you want. | ||
|
||
You will help yourself and the network by storing more, like 1-100 Gigabytes. That means you'll get faster local requests and you'll be able to serve more data to others. But it is fully your choice. | ||
|
||
### Connectivity | ||
|
||
Going offline and coming back online is no big deal. You'll be able to sync up again quickly. | ||
|
||
### CPU | ||
|
||
Portal is designed to be very light on CPU. The goal is to make it so you can run it on a Raspberry Pi, or even forget that it's running on your laptop, because it's so light. | ||
|
||
Since we're still in early days, users may experience some fluctuations in CPU usage. We will continue to optimize! | ||
|
||
## Joint Benefits of Portal & Standard Clients | ||
|
||
Some things are great about standard clients, so Portal keeps those features, like: | ||
|
||
### Standard JSON-RPC Endpoint | ||
|
||
Portal clients can act as a server for Ethereum data. They do this by hosting the standardized JSON-RPC endpoint. Portal clients are a drop-in replacement for you Web3 script or wallet. | ||
|
||
Note that not every endpoint is supported in Portal clients yet, but coverage is expanding over time. | ||
|
||
### Fully-validated | ||
|
||
Whenever Portal clients request data from a peer, they also generate internal cryptographic proofs that the provided content matches the canonical chain. | ||
|
||
This happens recursively until the source of consensus. For example, if you request contract storage, Portal clients will: | ||
1. generate merkle proofs back to the state root | ||
2. verify the state root against a header | ||
3. verify that the header was signed/attested by Ethereum stakers | ||
|
||
### Privacy | ||
|
||
There is no single third party that collects every request you make about the Ethereum network. | ||
|
||
An individual peer knows if you request data from them, but they don't know what your original RPC query is. | ||
|
||
## Portal Drawbacks | ||
|
||
There are some drawbacks to using Portal clients. Here are some known ones: | ||
|
||
### Latency | ||
|
||
When making a request that requires many different pieces of data under the hood, that requires many network round trips. This can be slow. Reading data out of a contract might take many seconds, instead of milliseconds. | ||
|
||
### Partial view | ||
|
||
The essense of Portal is that you only store a small slice of the total data. | ||
|
||
There are some use cases that involve seeing all the data in the network at once. For those, it will often be better to just load a standard client and have all the data locally for analysis. | ||
|
||
*Caveat:* There are still some cases that it might be faster to use Portal, even if you need a wide spread of data. You might be able to enumerate every account on the network faster than it takes a standard client to sync up from scratch, for example. | ||
|
||
### Offline access | ||
|
||
A Portal client is not very useful while offline. Clients depends on requesting missing data from peers. In contrast, standard clients that are offline can still serve all data up until their latest sync point. | ||
|
||
### Uptime | ||
|
||
The primary Ethereum network is maniacal about uptime. If you run a standard client, and have an internet connection, you will be getting network updates. | ||
|
||
There are more opportunities for downtime or lag in Portal clients. You might expect something more like 99.5% uptime. *(No promises, just a guess. Of course we will aim higher)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# All Command Line Flags | ||
|
||
> See our guide on [how to run trin](startup.md) for the most common flags. | ||
Below is the current list of all command line flags. | ||
|
||
Note that these flags may change over time, so run `trin --help` to get the most up-to-date information for your version. | ||
|
||
```text | ||
Usage: trin [OPTIONS] [COMMAND] | ||
Commands: | ||
create-dashboard | ||
help Print this message or the help of the given subcommand(s) | ||
Options: | ||
--web3-transport <WEB3_TRANSPORT> | ||
select transport protocol to serve json-rpc endpoint [default: ipc] | ||
--web3-http-address <WEB3_HTTP_ADDRESS> | ||
address to accept json-rpc http connections [default: http://127.0.0.1:8545/] | ||
--web3-ipc-path <WEB3_IPC_PATH> | ||
path to json-rpc endpoint over IPC [default: /tmp/trin-jsonrpc.ipc] | ||
--discovery-port <DISCOVERY_PORT> | ||
The UDP port to listen on. [default: 9009] | ||
--bootnodes <BOOTNODES> | ||
One or more comma-delimited base64-encoded ENR's or multiaddr strings of peers to initially add to the local routing table [default: default] | ||
--external-address <EXTERNAL_ADDR> | ||
(Only use this if you are behind a NAT) The address which will be advertised to peers (in an ENR). Changing it does not change which port or address trin binds to. Port number is required, ex: 127.0.0.1:9001 | ||
--no-stun | ||
Do not use STUN to determine an external IP. Leaves ENR entry for IP blank. Some users report better connections over VPN. | ||
--no-upnp | ||
Do not use UPnP to determine an external port. | ||
--unsafe-private-key <PRIVATE_KEY> | ||
Hex encoded 32 byte private key (with 0x prefix) (considered unsafe as it's stored in terminal history - keyfile support coming soon) | ||
--trusted-block-root <TRUSTED_BLOCK_ROOT> | ||
Hex encoded block root from a trusted checkpoint | ||
--network <NETWORK> | ||
Choose mainnet or angelfood [default: mainnet] | ||
--portal-subnetworks <PORTAL_SUBNETWORKS> | ||
Comma-separated list of which portal subnetworks to activate [default: history] | ||
--storage.total <storage.total> | ||
Maximum storage capacity (in megabytes), shared between enabled subnetworks [default: 1000] | ||
--storage.beacon <storage.beacon> | ||
Maximum storage capacity (in megabytes) used by beacon subnetwork | ||
--storage.history <storage.history> | ||
Maximum storage capacity (in megabytes) used by history subnetwork | ||
--storage.state <storage.state> | ||
Maximum storage capacity (in megabytes) used by state subnetwork | ||
--enable-metrics-with-url <ENABLE_METRICS_WITH_URL> | ||
Enable prometheus metrics reporting (provide local IP/Port from which your Prometheus server is configured to fetch metrics) | ||
--data-dir <DATA_DIR> | ||
The directory for storing application data. If used together with --ephemeral, new child directory will be created. Can be alternatively set via TRIN_DATA_PATH env variable. | ||
-e, --ephemeral | ||
Use new data directory, located in OS temporary directory. If used together with --data-dir, new directory will be created there instead. | ||
--disable-poke | ||
Disables the poke mechanism, which propagates content at the end of a successful content query. Disabling is useful for network analysis purposes. | ||
--ws | ||
Used to enable WebSocket rpc. | ||
--ws-port <WS_PORT> | ||
The WebSocket port to listen on. [default: 8546] | ||
--utp-transfer-limit <UTP_TRANSFER_LIMIT> | ||
The limit of max background uTP transfers for any given channel (inbound or outbound) for each subnetwork [default: 50] | ||
-h, --help | ||
Print help (see more with '--help') | ||
-V, --version | ||
Print version | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.