Instructions in this document assume the environment variable
PDO_SOURCE_ROOT
points to the PDO source directory.
PDO uses a number of environment variables to control build, installation and operation. While PDO should build and run with only the default values, four variables are commonly set to reflect specifics of the installation:
PDO_INSTALL_ROOT
-- the path to the directory where PDO is installedPDO_LEDGER_TYPE
-- the ledger type to be used (ccf)PDO_LEDGER_URL
-- the URL for the ledgerPDO_LEDGER_KEY_ROOT
-- the path to a directory containing ledger keys
In addition, if you run in SGX HW mode you will generally define
PDO_SGX_KEY_ROOT
as well. See below for information on these variables
and others you could override from defaults.
The script build/common-config.sh can be used to set values for all of the environment variables that are used in the build, installation & execution process.
The default usage of this script is to be sourced. For example, local configuration file may be constructed as:
export PDO_INSTALL_ROOT=${PDO_SOURCE_ROOT}/build/_dev
export PDO_LEDGER_KEY_ROOT=${PDO_INSTALL_ROOT}/opt/pdo/etc/keys/ledger
export PDO_LEDGER_URL=http://127.0.0.1:6600
and before building it you call the configuration script as
source ${PDO_SOURCE_ROOT}/build/common-config.sh
If passed the parameter --evalable-export
the script will return a
list of export commands of the variables instead of directly exporting
them to the environment.
(default: ${PDO_SOURCE_ROOT}/build/_dev
):
PDO_INSTALL_ROOT
is the root of the directory in which the virtual
enviroment will be built; generally PDO_HOME
will point to
PDO_INSTALL_ROOT/opt/pdo
(default: wawaka
):
PDO_INTERPRETER
contains the name of the interpreter to use for
processing contracts. wawaka
is the default interpreter that
executes WASM-based contracts. wawaka-opt
enables optimizations
in Wawaka's WASM interpreter.
For more information on the configuration
and use of wawaka
, see the interpreter
README.
(default: ${PDO_INSTALL_ROOT}/opt/pdo
):
PDO_HOME
is the directory where PDO-specific files are stored for
operation. These files include configuration files, data files, compiled
contracts, contract user keys and service scripts.
(default: ${HOSTNAME}
):
PDO_HOSTNAME
identifies the hostname where service interfaces
will be exported. Defaults to HOSTNAME.
(default: 1)
PDO_DEBUG_BUILD
builds PDO modules for debugging. This includes
compile flags, logging statements in the enclave, etc. Since
PDO_DEBUG_BUILD
potentially exposes information about what is
happening inside a contract, do not use with confidential contracts.
(default: ${PDO_SOURCE_ROOT}/interpreters/wasm-micro-runtime
)
WASM_SRC
points to the installation of the wasm-micro-runtime. This
is used to build the WASM interpreter for the wawaka contract interpreter.
The git submodule points to the latest tagged commit of WAMR we have validated:
WAMR-1.1.2
.
(default: MEDIUM
)
PDO_MEMORY_CONFIG
indicates the memory configuration for the enclave
and WASM runtime: the runtime's global memory pool size, the WASM
module's heap size, and the size of module's operand stack. When the
variable is set to SMALL
, the runtime's global memory pool size is
set to 4MB. If the variable is set to MEDIUM
, the runtime's memory
pool size is set to 8MB. When the variable is set to LARGE
, the
runtime's memory pool size is set to 16MB.
(default: SIM
)
SGX_MODE
determines the SGX mode of operation. When the variable is
set to SIM
, then the SGX enclaves will be compiled for simulator
mode. When the variable is set to HW
, the enclaves will be compiled to
run in a real SGX enclave.
(default: ${PDO_SOURCE_ROOT}/build/keys/sgx_mode_${SGX_MODE,,}/
):
PDO_SGX_KEY_ROOT
is the root directory where SGX and IAS related keys
are stored. If SGX_MODE=SIM, the default folder contains mock files that
are good for simulation mode. If SGX_MODE=HW, the default (or custom)
folder must be filled with legitimate SGX & IAS keys.
See SGX section of the BUILD document
for more information.
(default: ccf
):
PDO_LEDGER_TYPE
is the ledger to be used with PDO.
PDO supports ccf (Microsoft) based ledgers.
(default: http://127.0.0.1:6600/
):
PDO_LEDGER_URL
is the URL used to submit transactions to the
ledger. This should be the URL for the REST API component.
(default: ${PDO_INSTALL_ROOT}/opt/pdo/etc/keys/ledger
):
PDO_LEDGER_KEY_ROOT
is the root directory where the system keys are
stored for ledger integration; files in this directory are not
automatically generated.