Skip to content

Commit 24c9c3c

Browse files
committed
add quick start for running Eliza in SGX
1 parent fae497c commit 24c9c3c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

packages/plugin-sgx/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,50 @@ When Eliza starts, the `sgxAttestationProvider` will generate SGX attestation in
4949
const sgxAttestationProvider = new SgxAttestationProvider();
5050
const sgxAttestation = await sgxAttestationProvider.generateAttestation(userReport);
5151
```
52+
53+
## Quick Start
54+
55+
First, you need to prepare a SGX enabled machine.
56+
57+
Then, you can use the following command to start a Gramine Docker container:
58+
59+
```bash
60+
sudo docker run -it --name eliza_sgx \
61+
--mount type=bind,source={your_eliza_path},target=/root/eliza \
62+
--device /dev/sgx/enclave \
63+
--device /dev/sgx/provision \
64+
gramineproject/gramine:stable-jammy
65+
```
66+
67+
After entering the docker, you can use the following command to prepare the Eliza environment:
68+
69+
```bash
70+
# Generate the private key for signing the SGX enclave
71+
gramine-sgx-gen-private-key
72+
73+
cd /root/eliza/
74+
75+
# Install nodejs and pnpm
76+
# Node.js will be installed at `/usr/bin/node`.
77+
# Gramine will utilize this path as the default Node.js location to run Eliza.
78+
# If you prefer to use nvm for installing Node.js, please ensure to specify the Node.js path in the Makefile, as the installation path for nvm is not `/usr/bin/node`.
79+
apt update
80+
apt install -y build-essential
81+
apt install -y curl
82+
curl -fsSL https://deb.nodesource.com/setup_23.x | bash -
83+
apt install -y nodejs=23.3.0-1nodesource1
84+
npm install -g pnpm
85+
86+
# Build Eliza
87+
pnpm i
88+
# The build may fail on the first attempt due to the missing `plugin-tee` dependency in `plugin-tee-log`. Simply run the build command again to resolve the issue.
89+
# TODO: fix the build issue
90+
pnpm build
91+
92+
# Copy the .env.example file to .env
93+
cp .env.example .env
94+
# Edit the .env file
95+
96+
# Start Eliza in SGX
97+
SGX=1 make start -- --character "character/c3po.character.json"
98+
```

0 commit comments

Comments
 (0)