Skip to main content

Step 3: Deploy the EIF using Oyster CVM

Step 3.1: Upload the EIF using Oyster CVM

  • Upload the EIF to Oyster CVM.
  • This will require a PINATA_API_KEY and PINATA_API_SECRET as mentioned in the Oyster CVM Tutorials.
PINATA_API_KEY=<api_key> PINATA_API_SECRET=<api_secret> oyster-cvm upload --file result/image.eif
  • Save the URL you get from the output of the above command.
  • Pinata is free upto 1GB of storage. If you need more, you can use any other storage service, like Filebase, Drive, etc. You just need to ensure that the URL you enter in the step below contains the file and can be downloaded using the wget command.

Step 3.2: Deploy the EIF using Oyster CVM

  • Deploy the EIF using Oyster CVM.

Note: Wallet should contain 0.001 ETH and 1 USDC on the Arbitrum One network.

Note: Due to the hugepage memory requirements of building and running the Eliza agent inside an enclave, only instances that do not contain NUMA nodes are supported (usually instances with memory <64 GBs).

  • Some supported instance types are:

    • r6a.2xlarge
    • r6a.4xlarge
    oyster-cvm deploy --wallet-private-key <wallet_private_key> --image-url <pinata_image_url> --instance-type r6a.2xlarge --region ap-south-1 --operator 0xe10Fa12f580e660Ecd593Ea4119ceBC90509D642 --duration-in-minutes 60
  • This should take a few minutes to complete.

  • The output will contain the Job ID and the IP address of the instance.

Step 3.3: Adding secrets to the Eliza agent

  • Run the Pulse Client built in Step 2.3 with the respective arguments.

    ./target/release/pulse-client --endpoint <ip_address>:1600 \
    --pcr0 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \
    --pcr1 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \
    --pcr2 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \
    --max-age 1200000 \
    --root-public-key fc0254eba608c1f36870e29ada90be46383292736e894bfff672d989444b5051e534a4b1f6dbe3c0bc581a32b7b176070ede12d69a3fea211b66e752cf7dd1dd095f6f1370f4170843d9dc100121e4cf63012809664487c9796284304dc53ff4 \
    --filepath /path/to/your/.env

    Note:

    • Update the endpoint with the IP address of the instance.
    • Update the PCR values with the ones you got from the EIF build logs. If using debug mode, the PCR values will be all zeros.
    • Use the same root-public-key mentioned above.
    • Update the filepath with the path to your .env file.

    Note: Adding the secrets to the Eliza agent is a one time operation and an important step. The enclave will not build and deploy the Eliza agent without adding the secrets via this step.

  • The response should be -

    Response: 200 OK: b"success"

    Note: After the secrets are added, the deployment of the Eliza agent will take another 8-10 minutes.

🎉Congratulations! You've successfully deployed the Eliza agent server.

Deploying in Debug Mode

  • Debug mode is also available for the Eliza agent. You just need to add the --debug flag to the deploy command.
oyster-cvm deploy --wallet-private-key <wallet_private_key> --image-url <pinata_image_url> --instance-type r6a.2xlarge --region ap-south-1 --operator 0xe10Fa12f580e660Ecd593Ea4119ceBC90509D642 --duration-in-minutes 30 --debug
  • You can view the logs of the enclave by running the following command only in debug mode.
oyster-cvm logs --ip <ip_address> --start-from 0

Note:

  • Logs are only available in debug mode.
  • --start-from is an optional arg to set the starting point of the log tail.