Skip to content

Commit

Permalink
Add max wasm size option on env (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 authored Mar 18, 2024
1 parent 3c57f97 commit c919d23
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export DENOM="urax"
export MONIKER="$ROLLAPP_CHAIN_ID-sequencer"
```

if you want to change the max wasm size:

```shell
export MAX_WASM_SIZE=YOUR_MAX_WASM_SIZE
```

And initialize the rollapp:

```shell
Expand Down
8 changes: 8 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/http"
"os"
"path/filepath"
"strconv"
"strings"

"github.com/gorilla/mux"
Expand Down Expand Up @@ -284,6 +285,13 @@ func NewRollapp(
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)

if maxSize := os.Getenv("MAX_WASM_SIZE"); maxSize != "" {
// https://github.com/CosmWasm/wasmd#compile-time-parameters
val, _ := strconv.ParseInt(maxSize, 10, 32)
wasmtypes.MaxWasmSize = int(val)
wasmtypes.MaxProposalWasmSize = int(val)
}

// load state streaming if enabled
if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, keys); err != nil {
panic("failed to load state streaming services: " + err.Error())
Expand Down

0 comments on commit c919d23

Please sign in to comment.