Skip to content

Commit f2a17df

Browse files
committed
docs: update schema and setup documentation
1 parent fa8d780 commit f2a17df

File tree

4 files changed

+35
-34
lines changed

4 files changed

+35
-34
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ To deploy Chaingraph locally, see the instructions in the [Contributing Guide](.
2323

2424
### Create a Cluster
2525

26-
As of late 2021, DigitalOcean is the most cost-effective cloud provider for Chaingraph deployments (differentiated primarily by pricing of egress bandwidth and persistent volume SSD storage).
26+
As of 2023, DigitalOcean is the most cost-effective cloud provider for Chaingraph deployments (differentiated primarily by pricing of egress bandwidth and persistent volume SSD storage).
2727

28-
To set up a new cluster, **consider using [Chaingraph's referral code for a $100
29-
credit](https://m.do.co/c/522a68c96ba3)** (supports `demo.chaingraph.cash`); this should cover a production-ready BCH mainnet deployment for ~30 days (approximately $85/month for SSD storage, one $10/month droplet, and $10/month for the load balancer and egress bandwidth).
28+
To set up a new cluster, **consider using [Chaingraph's referral code for a $200
29+
credit](https://m.do.co/c/cb25573fbfe7)** (supports `demo.chaingraph.cash`); this should cover a basic, production-ready BCH mainnet deployment for ~60 days (approximately $85/month for SSD storage, one $12/month droplet, and $12/month for the load balancer and egress bandwidth).
3030

3131
Whichever cloud provider you choose, for the below testnet deployment, provision at least 1 Kubernetes node of the least expensive type.
3232

@@ -44,7 +44,7 @@ If you have previously added the `bitauth` repo, run `helm repo update` to fetch
4444

4545
### Deploy a Release
4646

47-
Using the default configuration, Chaingraph will be installed with a single `testnet4` [BCHN](https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node) full node, an internally-managed Postgres instance, and no load balancer.
47+
Using the default configuration, Chaingraph will be installed with one `chipnet` and one `testnet4` [BCHN](https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node) full node, an internally-managed Postgres instance, and no load balancer.
4848

4949
This is an ideal configuration for experimenting with Chaingraph, as it can be deployed on very low-powered clusters (often even within the free tier provided by many cloud Kubernetes providers). See the [chart readme](./charts/chaingraph/readme.md) for information about other options.
5050

charts/chaingraph/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Chaingraph currently supports internal management of mainnet and testnet BCHN no
2121
A [BCHN](https://bitcoincashnode.org/) node configured to connect to `mainnet` is disabled by default. It can be enabled with the following option:
2222

2323
```sh
24-
--set bitcoinCashNode.enable=true # --set postgres.volumeSize=625Gi
24+
--set bitcoinCashNode.enable=true # --set postgres.volumeSize=730Gi
2525
```
2626

2727
When enabling mainnet, ensure the volume assigned to Postgres is large enough to hold the database with additional space for indexing (see [Approximate Space Usage](../../docs/schema.md#approximate-space-usage)). If using the internally-managed Postgres instance, this can be configured with the `postgres.volumeSize` value. (See also: [Expanding Volumes](#expanding-volumes).)
@@ -158,7 +158,7 @@ spec:
158158
- ReadWriteOnce
159159
resources:
160160
requests:
161-
storage: 625Gi # <- edit this value
161+
storage: 730Gi # <- edit this value
162162
```
163163
164164
If the specified volume size is larger than the existing volumes, the volumes will be automatically expanded by supporting Kubernetes systems. (Note: volume sizes cannot be reduced using this method.)

docs/schema.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,31 @@ Multi-node, multi-chain deployments share common history, so only divergent bloc
5151

5252
This section is periodically updated to provide approximate storage usage information for all default tables and indexes. Actual storage usage will be affected by file system compression and Postgres vacuuming progress. (Vacuuming frees wasted space in the database, so storage usage will fall in the hours/days after initial sync as the database reclaims unused space. The Postgres `VACUUM FULL` command locks the table and performs this compression immediately.)
5353

54-
The below table is derived from the [`/space` view in `pgHero`](../.github/CONTRIBUTING.md#using-pghero) on a recently-vacuumed Chaingraph Postgres database synced with only a single, mainnet BCH node.
54+
The below table is derived from the [`/space` view in `pgHero`](../.github/CONTRIBUTING.md#using-pghero) on a recently-synced Chaingraph Postgres database with a single, mainnet BCH node.
5555

56-
_**Last Update**: 2021-11-11_
56+
_**Last Update**: 2023-01-23_
5757

5858
| Relation | Size |
5959
| ----------------------------- | ------------------ |
60-
| input | 176 GB |
61-
| output | 100 GB |
62-
| output_pkey | 78.3 GB |
63-
| spent_by_index | 52 GB |
64-
| transaction | 35.3 GB |
65-
| input_pkey | 32.2 GB |
66-
| transaction_hash_key | 24.8 GB |
67-
| output_search_index | 19.7 GB |
68-
| block_transaction | 16.9 GB |
69-
| block_transaction_pkey | 10.9 GB |
70-
| block_inclusions_index | 7.26 GB |
71-
| transaction_pkey | 7.25 GB |
72-
| block | 131 MB |
73-
| block_hash_key | 52.9 MB |
74-
| node_block | 33.5 MB |
75-
| node_block_pkey | 21.5 MB |
76-
| block_height_index | 15.3 MB |
77-
| block_internal_id_key | 15.3 MB |
78-
| block_pkey | 15.3 MB |
60+
| input | 189 GB |
61+
| output | 108 GB |
62+
| output_pkey | 84.2 GB |
63+
| spent_by_index | 56.3 GB |
64+
| transaction | 37.2 GB |
65+
| input_pkey | 33.6 GB |
66+
| transaction_hash_key | 26.1 GB |
67+
| output_search_index | 20.7 GB |
68+
| block_transaction | 17.8 GB |
69+
| block_transaction_pkey | 11.5 GB |
70+
| block_inclusions_index | 7.64 GB |
71+
| transaction_pkey | 7.64 GB |
72+
| block | 168 MB |
73+
| block_hash_key | 67.9 MB |
74+
| node_block | 44.2 MB |
75+
| node_block_pkey | 32.1 MB |
76+
| block_internal_id_key | 19.9 MB |
77+
| block_pkey | 19.9 MB |
78+
| block_height_index | 19.1 MB |
7979
| node | 16 KB |
8080
| node_internal_id_key | 16 KB |
8181
| node_name_key | 16 KB |
@@ -87,9 +87,9 @@ _**Last Update**: 2021-11-11_
8787
| node_block_history | varies<sup>3</sup> |
8888
| node_block_history_pkey | varies<sup>3</sup> |
8989

90-
- Average Transactions Per Day (Jan - Nov 2021): **~168,000 transactions/day**
91-
- Average Transaction Size (Jan - Nov 2021): **439 bytes**
92-
- Average Transaction Throughput Per Day (Jan - Nov 2021): **~74 MB**
90+
- Average Transactions Per Day (Jan 2023): **~12,000 transactions/day**
91+
- Average Transaction Size (Jan 2023): **838 bytes**
92+
- Average Transaction Throughput Per Day (Jan 2023): **~10 MB**
9393

9494
<details><summary>SQL</summary>
9595

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"dev-cluster:upgrade:local": "yarn dev-cluster:upgrade:local-postgres --set bitcoinCashNodeTestnet.enable=false --set bitcoinCashNodeChipnet.enable=false",
4848
"dev-cluster:bchn:sh": "echo 'Some useful commands:\n\n chain info>> bitcoin-cli -datadir=/data getblockchaininfo\n peer versions>> bitcoin-cli -datadir=/data getpeerinfo | grep subver\n quit>> exit\n' && kubectl exec bitcoin-cash-node-0 -it -- /bin/bash",
4949
"dev-cluster:bounce:postgres": "yarn dev-cluster:spin-down:postgres && kubectl rollout status statefulset/postgres && yarn dev-cluster:spin-up:postgres",
50+
"dev-cluster:prod-sim:restart:agent": "echo 'Restarting chaingraph-agent - the existing pod will begin shutdown, and a new pod will be created immediately. If both are logging to the same file, the logs may overlap momentarily.' && kubectl rollout restart deployment chaingraph-agent",
5051
"dev-cluster:spin-down:bchn:mainnet": "kubectl scale statefulsets bitcoin-cash-node --replicas=0",
5152
"dev-cluster:spin-up:bchn:mainnet": "kubectl scale statefulsets bitcoin-cash-node --replicas=1",
5253
"dev-cluster:spin-down:bchn:testnet": "kubectl scale statefulsets bitcoin-cash-node-testnet --replicas=0",
@@ -79,10 +80,10 @@
7980
"dev-cluster:hasura:console:prod-sim": "cd images/hasura/hasura-data && hasura console --console-port=8013 --api-port=31933 --endpoint=http://localhost:31933/ --admin-secret=$(yarn dev-cluster:secret:hasura-admin-secret-key)",
8081
"dev-cluster:hasura:init-migrations": "cd images/hasura/hasura-data && hasura migrate create 'init' --from-server --admin-secret=$(yarn dev-cluster:secret:hasura-admin-secret-key)",
8182
"dev-cluster:hasura:squash-migrations": "cd images/hasura/hasura-data && hasura migrate squash --admin-secret=$(yarn dev-cluster:secret:hasura-admin-secret-key)",
82-
"local:bchn:mainnet": "bitcoin-bchn -datadir=$PWD/data/bchn-local",
83-
"local:bchn:pruned": "bitcoin-bchn -datadir=$PWD/data/bchn-local-pruned",
84-
"local:bchn:testnet": "bitcoin-bchn -datadir=$PWD/data/bchn-testnet-local",
85-
"local:bchn:chipnet": "bitcoin-bchn -datadir=$PWD/data/bchn-chipnet-local",
83+
"local:bchn:mainnet": "bitcoin-bchn -datadir=$PWD/data/bitcoin-cash-node-local",
84+
"local:bchn:pruned": "bitcoin-bchn -datadir=$PWD/data/bitcoin-cash-node-pruned-local",
85+
"local:bchn:testnet": "bitcoin-bchn -datadir=$PWD/data/bitcoin-cash-node-testnet-local",
86+
"local:bchn:chipnet": "bitcoin-bchn -datadir=$PWD/data/bitcoin-cash-node-chipnet-local",
8687
"local:postgres": "postgres -D $PWD/data/postgres-local",
8788
"local:postgres:init": "bash -c 'initdb --username=chaingraph --auth=scram-sha-256 --pwfile=<(echo \"very_insecure_postgres_password\") --no-locale --encoding UTF-8 $PWD/data/postgres-local'",
8889
"local:postgres:tune": "yarn local:postgres:psql -c \"ALTER SYSTEM SET shared_buffers = '2048MB'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET effective_cache_size = '6144MB'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET maintenance_work_mem = '128MB'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET checkpoint_completion_target = '0.9'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET min_wal_size = '4GB'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET max_wal_size = '16GB'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET default_statistics_target = '500'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET random_page_cost = '1.1'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET max_connections = '50'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET work_mem = '8MB'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET max_worker_processes = '8'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET max_parallel_workers_per_gather = '4'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET max_parallel_workers = '8'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET max_parallel_maintenance_workers = '4'\" && yarn local:postgres:psql -c \"ALTER SYSTEM SET effective_io_concurrency = '200'\" || echo '\n(no need to set effective_io_concurrency on macOS, tuning complete. 👍)'",

0 commit comments

Comments
 (0)