Skip to content

Commit

Permalink
chore: disable API, GRPC, and GRPC web by default (#2761)
Browse files Browse the repository at this point in the history
Closes #2758

## Testing
```
./scripts/single-node.sh
cat ~/.celestia-app/config/app.toml
```

Verified that 

```toml
[api]

# Enable defines if the API server should be enabled.
enable = false
```

```toml
[grpc]

# Enable defines if the gRPC server should be enabled.
enable = false
```

```toml
[grpc-web]

# GRPCWebEnable defines if the gRPC-web should be enabled.
# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op.
enable = false
```
  • Loading branch information
rootulp committed Oct 25, 2023
1 parent 3a80960 commit b786b08
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/default_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ func DefaultConsensusConfig() *tmcfg.Config {

func DefaultAppConfig() *serverconfig.Config {
cfg := serverconfig.DefaultConfig()
cfg.API.Enable = true
cfg.API.Enable = false
cfg.GRPC.Enable = false
cfg.GRPCWeb.Enable = false

// the default snapshot interval was determined by picking a large enough
// value as to not dramatically increase resource requirements while also
Expand Down
12 changes: 12 additions & 0 deletions app/default_overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ func TestDefaultGenesis(t *testing.T) {
assert.Equal(t, distributiontypes.DefaultParams().WithdrawAddrEnabled, distributionGenesisState.Params.WithdrawAddrEnabled)
assert.Equal(t, distributiontypes.DefaultParams().CommunityTax, distributionGenesisState.Params.CommunityTax)
}

func TestDefaultAppConfig(t *testing.T) {
cfg := DefaultAppConfig()

assert.False(t, cfg.API.Enable)
assert.False(t, cfg.GRPC.Enable)
assert.False(t, cfg.GRPCWeb.Enable)

assert.Equal(t, uint64(1500), cfg.StateSync.SnapshotInterval)
assert.Equal(t, uint32(2), cfg.StateSync.SnapshotKeepRecent)
assert.Equal(t, "0.1utia", cfg.MinGasPrices)
}
4 changes: 3 additions & 1 deletion scripts/single-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,6 @@ sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' "${CELESTIA_APP
echo "Starting celestia-app..."
celestia-appd start \
--home ${CELESTIA_APP_HOME} \
--api.enable
--api.enable \
--grpc.enable \
--grpc-web.enable

0 comments on commit b786b08

Please sign in to comment.