Skip to main content

Server Configuration

To configure your DeWeb server, create a YAML configuration file named deweb_server_config.yaml and store it alongside the server binary. Below is an example configuration file:

Example Configuration

domain: "massa.network"
network_node_url: "https://mainnet.massa.net/api/v2"
api_port: 8080
allow_list:
- "massaNameService"
- "AS1S...19b3"
block_list:
- "massaNameService"
- "AS1S...4x3o"
misc_public_info: {
"tips": {
"BTC": "1PMyg9yJe9Y8zS3bD2N4e6w2F7K6Rmyt7B",
"ETH": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"MAS": "AU1wfDH3BNBiFF9Nwko6g8q5gMzHW8KUHUL2YysxkZKNZHq37AfX"
}
}

Default Configuration

If no configuration file is provided, the server will use the following default settings:

domain: "localhost"
network_node_url: "https://mainnet.massa.net/api/v2"
api_port: 8080

Configuration Fields

  • Domain: The domain the website is running on. For example, set this to massa.network if your server is running on massa.network. The default value is localhost.

  • NetworkNodeURL: The node DeWeb server will connect to. By default, this is set to https://mainnet.massa.net/api/v2. You can use any node address for the JSON public API, such as those listed in the Massa API Documentation (Default port: 33035).

    tip

    To access a website that has been deployed on buildnet, set the node address to https://buildnet.massa.net/api/v2.

  • APIPort: The port the server will run on. The default value is 8080.

  • AllowList: A list of domains or smart contract addresses that are explicitly allowed. By default, this list is empty. If specified, only the websites in this list will be accessible.

  • BlockList: A list of domains or smart contract addresses that are explicitly blocked. By default, this list is empty. Websites in this list will be inaccessible.

  • misc_public_info: Optional, arbitrary raw JSON returned as the misc section of JSON object returned by the /__deweb_info public endpoint of the provider. It is useful in particular for allowing front-ends to tip the provider to incentivize quality of service. The tips section should be a dictionary of uppercase currency symbols as keys and the corresponding addresses that you own as values.