Skip to main content

Core Configuration

WASP uses a JSON standard format as a config file. If you are unsure about JSON syntax, you can find more information in the official JSON specs.

You can change the path of the config file by using the -c or --config argument while executing wasp executable.

For example:

wasp -c config_defaults.json

You can always get the most up-to-date description of the config parameters by running:

wasp -h --full

1. Application

NameDescriptionTypeDefault value
checkForUpdatesWhether to check for updates of the application or notbooleantrue
shutdownConfiguration for shutdownobject

Shutdown

NameDescriptionTypeDefault value
stopGracePeriodThe maximum time to wait for background processes to finish during shutdown before terminating the appstring"5m"
logConfiguration for Shutdown Logobject

Shutdown Log

NameDescriptionTypeDefault value
enabledWhether to store self-shutdown events to a log filebooleantrue
filePathThe file path to the self-shutdown logstring"shutdown.log"

Example:

{
"app": {
"checkForUpdates": true,
"shutdown": {
"stopGracePeriod": "5m",
"log": {
"enabled": true,
"filePath": "shutdown.log"
}
}
}
}

2. Logger

NameDescriptionTypeDefault value
levelThe minimum enabled logging levelstring"info"
disableCallerStops annotating logs with the calling function's file name and line numberbooleantrue
disableStacktraceDisables automatic stacktrace capturingbooleanfalse
stacktraceLevelThe level stacktraces are captured and abovestring"panic"
encodingThe logger's encoding (options: "json", "console")string"console"
encodingConfigConfiguration for encodingConfigobject
outputPathsA list of URLs, file paths or stdout/stderr to write logging output toarraystdout
disableEventsPrevents log messages from being raced as eventsbooleantrue

EncodingConfig

NameDescriptionTypeDefault value
timeEncoderSets the logger's timestamp encoding. (options: "nanos", "millis", "iso8601", "rfc3339" and "rfc3339nano")string"rfc3339"

Example:

{
"logger": {
"level": "info",
"disableCaller": true,
"disableStacktrace": false,
"stacktraceLevel": "panic",
"encoding": "console",
"encodingConfig": {
"timeEncoder": "rfc3339"
},
"outputPaths": ["stdout"],
"disableEvents": true
}
}

3. INX

NameDescriptionTypeDefault value
addressThe INX address to which to connect tostring"localhost:9029"
maxConnectionAttemptsThe amount of times the connection to INX will be attempted before it fails (1 attempt per second)uint30
targetNetworkNameThe network name on which the node should operate on (optional)string""

Example:

{
"inx": {
"address": "localhost:9029",
"maxConnectionAttempts": 30,
"targetNetworkName": ""
}
}

4. Database

NameDescriptionTypeDefault value
engineThe used database engine (rocksdb/mapdb)string"rocksdb"
chainStateConfiguration for chainStateobject
debugSkipHealthCheckIgnore the check for corrupted databasesbooleantrue

ChainState

NameDescriptionTypeDefault value
pathThe path to the chain state databases folderstring"waspdb/chains/data"

Example:

{
"db": {
"engine": "rocksdb",
"chainState": {
"path": "waspdb/chains/data"
},
"debugSkipHealthCheck": true
}
}

5. P2p

NameDescriptionTypeDefault value
identityConfiguration for identityobject
dbConfiguration for Databaseobject

Identity

NameDescriptionTypeDefault value
privateKeyPrivate key used to derive the node identity (optional)string""
filePathThe path to the node identity PEM filestring"waspdb/identity/identity.key"

Database

NameDescriptionTypeDefault value
pathThe path to the p2p databasestring"waspdb/p2pstore"

Example:

{
"p2p": {
"identity": {
"privateKey": "",
"filePath": "waspdb/identity/identity.key"
},
"db": {
"path": "waspdb/p2pstore"
}
}
}

6. Registries

NameDescriptionTypeDefault value
chainsConfiguration for chainsobject
dkSharesConfiguration for dkSharesobject
trustedPeersConfiguration for trustedPeersobject
consensusStateConfiguration for consensusStateobject

Chains

NameDescriptionTypeDefault value
filePathThe path to the chain registry filestring"waspdb/chains/chain_registry.json"

DkShares

NameDescriptionTypeDefault value
pathThe path to the distributed key shares registries folderstring"waspdb/dkshares"

TrustedPeers

NameDescriptionTypeDefault value
filePathThe path to the trusted peers registry filestring"waspdb/trusted_peers.json"

ConsensusState

NameDescriptionTypeDefault value
pathThe path to the consensus state registries folderstring"waspdb/chains/consensus"

Example:

{
"registries": {
"chains": {
"filePath": "waspdb/chains/chain_registry.json"
},
"dkShares": {
"path": "waspdb/dkshares"
},
"trustedPeers": {
"filePath": "waspdb/trusted_peers.json"
},
"consensusState": {
"path": "waspdb/chains/consensus"
}
}
}

7. Peering

NameDescriptionTypeDefault value
peeringURLNode host address as it is recognized by other peersstring"0.0.0.0:4000"
portPort for Wasp committee connection/peeringint4000

Example:

{
"peering": {
"peeringURL": "0.0.0.0:4000",
"port": 4000
}
}

8. Chains

NameDescriptionTypeDefault value
broadcastUpToNPeersNumber of peers an offledger request is broadcasted toint2
broadcastIntervalTime between re-broadcast of offledger requestsstring"5s"
apiCacheTTLTime to keep processed offledger requests in api cachestring"5m"
pullMissingRequestsFromCommitteeWhether or not to pull missing requests from other committee membersbooleantrue
deriveAliasOutputByQuorumFalse means we propose own AliasOutput, true - by majority vote.booleantrue
pipeliningLimit-1 -- infinite, 0 -- disabled, X -- build the chain if there is up to X transactions unconfirmed by L1.int-1
consensusDelayMinimal delay between consensus runs.string"500ms"

Example:

{
"chains": {
"broadcastUpToNPeers": 2,
"broadcastInterval": "5s",
"apiCacheTTL": "5m",
"pullMissingRequestsFromCommittee": true,
"deriveAliasOutputByQuorum": true,
"pipeliningLimit": -1,
"consensusDelay": "500ms"
}
}

9. StateManager

NameDescriptionTypeDefault value
blockCacheMaxSizeHow many blocks may be stored in cache before old ones start being deletedint1000
blockCacheBlocksInCacheDurationHow long should the block stay in block cache before being deletedstring"1h"
blockCacheBlockCleaningPeriodHow often should the block cache be cleanedstring"1m"
stateManagerGetBlockRetryHow often get block requests should be repeatedstring"3s"
stateManagerRequestCleaningPeriodHow often requests waiting for response should be checked for expired contextstring"1s"
stateManagerTimerTickPeriodHow often timer tick fires in state managerstring"1s"
pruningMinStatesToKeepThis number of states will always be available in the store; if 0 - store pruning is disabledint10000
pruningMaxStatesToDeleteOn single store pruning attempt at most this number of states will be deletedint1000

Example:

{
"stateManager": {
"blockCacheMaxSize": 1000,
"blockCacheBlocksInCacheDuration": "1h",
"blockCacheBlockCleaningPeriod": "1m",
"stateManagerGetBlockRetry": "3s",
"stateManagerRequestCleaningPeriod": "1s",
"stateManagerTimerTickPeriod": "1s",
"pruningMinStatesToKeep": 10000,
"pruningMaxStatesToDelete": 1000
}
}

10. Validator

NameDescriptionTypeDefault value
addressBech32 encoded address to identify the node (as access node on gov contract and to collect validator fee payments)string""

Example:

{
"validator": {
"address": ""
}
}

11. Write-Ahead Logging

NameDescriptionTypeDefault value
enabledWhether the "write-ahead logging" is enabledbooleantrue
pathThe path to the "write-ahead logging" folderstring"waspdb/wal"

Example:

{
"wal": {
"enabled": true,
"path": "waspdb/wal"
}
}

12. Web API

NameDescriptionTypeDefault value
enabledWhether the web api plugin is enabledbooleantrue
bindAddressThe bind address for the node web apistring"0.0.0.0:9090"
authConfiguration for authobject
limitsConfiguration for limitsobject
debugRequestLoggerEnabledWhether the debug logging for requests should be enabledbooleanfalse

Auth

NameDescriptionTypeDefault value
schemeSelects which authentication to choosestring"jwt"
jwtConfiguration for JWT Authobject
basicConfiguration for Basic Authobject
ipConfiguration for IP-based Authobject

JWT Auth

NameDescriptionTypeDefault value
durationJwt token lifetimestring"24h"

Basic Auth

NameDescriptionTypeDefault value
usernameThe username which grants access to the servicestring"wasp"

IP-based Auth

NameDescriptionTypeDefault value
whitelistA list of ips that are allowed to access the servicearray0.0.0.0

Limits

NameDescriptionTypeDefault value
timeoutThe timeout after which a long running operation will be canceledstring"30s"
readTimeoutThe read timeout for the HTTP request bodystring"10s"
writeTimeoutThe write timeout for the HTTP response bodystring"1m"
maxBodyLengthThe maximum number of characters that the body of an API call may containstring"2M"
maxTopicSubscriptionsPerClientDefines the max amount of subscriptions per client. 0 = deactivated (default)int0
confirmedStateLagThresholdThe threshold that define a chain is unsynchronizeduint2

Example:

{
"webapi": {
"enabled": true,
"bindAddress": "0.0.0.0:9090",
"auth": {
"scheme": "jwt",
"jwt": {
"duration": "24h"
},
"basic": {
"username": "wasp"
},
"ip": {
"whitelist": ["0.0.0.0"]
}
},
"limits": {
"timeout": "30s",
"readTimeout": "10s",
"writeTimeout": "1m",
"maxBodyLength": "2M",
"maxTopicSubscriptionsPerClient": 0,
"confirmedStateLagThreshold": 2
},
"debugRequestLoggerEnabled": false
}
}

13. Profiling

NameDescriptionTypeDefault value
enabledWhether the profiling component is enabledbooleanfalse
bindAddressThe bind address on which the profiler listens onstring"localhost:6060"

Example:

{
"profiling": {
"enabled": false,
"bindAddress": "localhost:6060"
}
}

14. ProfilingRecorder

NameDescriptionTypeDefault value
enabledWhether the ProfilingRecorder plugin is enabledbooleanfalse

Example:

{
"profilingRecorder": {
"enabled": false
}
}

15. Prometheus

NameDescriptionTypeDefault value
enabledWhether the prometheus plugin is enabledbooleantrue
bindAddressThe bind address on which the Prometheus exporter listens onstring"0.0.0.0:2112"

Example:

{
"prometheus": {
"enabled": true,
"bindAddress": "0.0.0.0:2112"
}
}
  • 1. Application
    • Shutdown
    • Shutdown Log
  • 2. Logger
    • EncodingConfig
  • 3. INX
  • 4. Database
    • ChainState
  • 5. P2p
    • Identity
    • Database
  • 6. Registries
    • Chains
    • DkShares
    • TrustedPeers
    • ConsensusState
  • 7. Peering
  • 8. Chains
  • 9. StateManager
  • 10. Validator
  • 11. Write-Ahead Logging
  • 12. Web API
    • Auth
    • JWT Auth
    • Basic Auth
    • IP-based Auth
    • Limits
  • 13. Profiling
  • 14. ProfilingRecorder
  • 15. Prometheus