Docker configuration

Installation and execution of docker smart contracts configures in the docker-engine of the node configuration file.

  # Docker smart contracts settings
  docker-engine {
  # Docker smart contracts enabled flag
  enable = no
  # Basic auth credentials for docker host
   docker-auth {
     username = "some user"
     password = "some password"
   }
  # Optional connection string to docker host
  # docker-host = "unix:///var/run/docker.sock"
  # Optional string to node REST API if we use remote docker host
  # node-rest-api = "https://clinton.wavesenterprise.com/node-0"
  # Use node docker host
  use-node-docker-host = no
  # Execution settings
  execution-limits {
    # gRPC contract startup timeout
    startup-timeout = 10s
    # Contract execution timeout
    timeout = 60s
    # Memory limit in Megabytes
    memory = 512
    # Memory swap value in Megabytes (see https://docs.docker.com/config/containers/resource_constraints/)
    memory-swap = 0
  }
  # Reuse once created container on subsequent executions
  reuse-containers = yes
  # Remove container with contract after specified duration passed
  remove-container-after = 10m
  # Remote registries auth information
  remote-registries = [
   {
     domain = "myregistry.com:5000"
     username = "user"
     password = "password"
   }
   ]
  # Check registry auth on node startup
  check-registry-auth-on-startup = yes
  #Authorization timeout for the contract
  contract-auth-expires-in = 1m
  # Contract execution messages cache settings
  contract-execution-messages-cache {
    # Time to expire for messages in cache
    expire-after = 60m
    # Max number of messages in buffer. When the limit is reached, the node processes all messages in batch
    max-buffer-size = 10
    # Max time for buffer. When time is out, the node processes all messages in batch
    max-buffer-time = 100ms
  }
  remove-container-on-fail = yes
  grpc-server {
    # host = "192.168.65.2"
    port = 6865
    akka-http-settings {
      akka {
        http.server.idle-timeout = infinite
        http.client.idle-timeout = infinite
        http.host-connection-pool.idle-timeout = infinite
        http.host-connection-pool.client.idle-timeout = infinite
      }
    }
  }
}

Parameters:

  • enable - the Docker smart contracts option activation (yes/no).

  • docker-auth - the authorization parameters with login/password section.

  • docker-host - a path to the local Docker host. For UNIX systems the default value is - docker-host = «unix:///var/run/docker.sock».

  • node-rest-api - the REST API address if you are using the remote Docker host.

  • use-node-docker-host - using the Docker host on the node (yes/no). If you enable this parameter, you should also use the parameter for the local Docker host docker-host = «unix:///var/run/docker.sock».

  • execution-limits - the Docker contracts run limits section:

    • startup-timeout - a timeout for creating a gRPC contract container and registering it in the node (in seconds);

    • timeout - a timeout for the smart contract execution;

    • memory - a memory limit for a smart contract in megabytes;

    • memory-swap - a memory swap value in megabytes.

  • reuse-containers - reuse option for the existing Docker contract.

  • remove-container-after - container remove option after contract execution (yes/no).

  • remote-registries - a list of remote registry repositories with credentials.

  • check-registry-auth-on-startup - the option which checks the registry repositories authorization during the node start (yes/no).

  • contract-auth-expires-in - a timeout for the Docker contract authorization token.

  • contract-execution-messages-cache - the contract execution messages cache settings section. When the limit is reached, the node processes all messages in batch:

    • expire-after - a time period to expire for messages in cache;

    • max-buffer-size - a maximum number of messages in buffer;

    • max-buffer-time - a maximum time period in milliseconds of messages in buffer.

  • remove-container-on-fail – deleting the container if an error occurred when starting it. This parameter can be useful during searching for errors when working with contracts (yes/no).

gRPC server

Section of gRPC server settings for working with smart contracts with the gRPC API.

  • host – a node network address (optional parameter).

  • port – a gRPC server port.

  • akka-http-settings - a section of settings for the Akka HTTP framework used for the gRPC server.