Skip to content

Commit

Permalink
Refactor and reorganize configuration documentation
Browse files Browse the repository at this point in the history
Moved custom PostgreSQL setup instructions and peer configuration to more appropriate sections for better readability. Updated example commands to include persistent peers configuration, ensuring consistency and clarity in the documentation.
  • Loading branch information
outerlook committed Aug 16, 2024
1 parent c850576 commit 9f93b90
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions docs/creating-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ docker run -p 5432:5432 --name kwil-postgres -e "POSTGRES_HOST_AUTH_METHOD=trust
kwildb/postgres:latest
```

If using a custom PostgreSQL setup, configure these parameters:

```
--app.pg-db-host string PostgreSQL host address (default "127.0.0.1")
--app.pg-db-name string Database name (default "kwild")
--app.pg-db-pass string Database password
--app.pg-db-port string Database port (default "5432")
--app.pg-db-user string Database user name (default "kwild")
```

## Network Configuration

### Genesis File
Expand All @@ -38,7 +28,9 @@ You should use this option to specify the genesis file provided in the `configs/
Example usage:

```bash
kwil-admin setup peer -g ./configs/network/staging/genesis.json [other options]
kwil-admin setup peer -g ./configs/network/staging/genesis.json \
--chain.p2p.persistent-peers c6d2ea1e573d207cc31b7e17c771ab8ca2091b22@staging.node-1.tsn.test.truflation.com:26656,34599966ce4b67628f4cfa99fdca74ea2d039018@staging.node-2.tsn.test.truflation.com:26656 \
[other options]
```

### Listening Addresses
Expand All @@ -55,15 +47,29 @@ Important:
- Ensure the P2P external address is reachable by other peers.
- `hostname` and `p2p.external-address` can be the same or different based on your setup.

## Peer Configuration
### Peer Configuration

```
--chain.p2p.persistent-peers string Persistent P2P peers
--chain.p2p.seeds string Seed nodes for peer discovery
```

Recommendations:
- Use the node list provided in `configs/network/<network_name>/network-nodes.csv` as seeds for initial peer discovery.- Set critical nodes as persistent peers for constant connectivity.
- Set critical nodes as persistent peers for constant connectivity. We recommend that you add our TSN nodes as persistent peers.
For example: `--chain.p2p.persistent-peers c6d2ea1e573d207cc31b7e17c771ab8ca2091b22@staging.node-1.tsn.test.truflation.com:26656,34599966ce4b67628f4cfa99fdca74ea2d039018@staging.node-2.tsn.test.truflation.com:26656`
- Use the node list provided in `configs/network/<network_name>/network-nodes.csv` as seeds for initial peer discovery

### Custom Database Configuration

If using a custom PostgreSQL setup, configure these parameters:

```
--app.pg-db-host string PostgreSQL host address (default "127.0.0.1")
--app.pg-db-name string Database name (default "kwild")
--app.pg-db-pass string Database password
--app.pg-db-port string Database port (default "5432")
--app.pg-db-user string Database user name (default "kwild")
```

## Additional Configuration

Expand Down Expand Up @@ -97,10 +103,9 @@ Remember to review and adjust these settings based on your specific requirements
```bash
kwil-admin setup peer \
-g ./configs/network/staging/genesis.json \
--app.pg-db-host node-postgres \
--chain.p2p.persistent-peers c6d2ea1e573d207cc31b7e17c771ab8ca2091b22@staging.node-1.tsn.test.truflation.com:26656,34599966ce4b67628f4cfa99fdca74ea2d039018@staging.node-2.tsn.test.truflation.com:26656
--app.hostname mynode.mycompany.com \
--chain.p2p.external-address http://mynode.mycompany.com:26656 \
--chain.p2p.seeds [email protected]:26656,[email protected]:26656 \
--root-dir ./tsn-config \
--app.db-read-timeout 60s
```

0 comments on commit 9f93b90

Please sign in to comment.