Skip to content

Commit 39d8f42

Browse files
authored
Merge pull request #23 from oasisprotocol/matevz/fix/compose-volumes
compose.yaml: Use built-in docker volumes
2 parents 3231e8e + ff89fb7 commit 39d8f42

4 files changed

Lines changed: 41 additions & 12 deletions

File tree

compose.localnet.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
ports:
55
- "11434:11434"
66
volumes:
7-
- ~/ollama-storage:/root/.ollama
7+
- ollama-storage:/root/.ollama
88
entrypoint: ["/usr/bin/bash", "-c", "/bin/ollama serve & sleep 5; ollama pull deepseek-r1:1.5b; wait"]
99

1010
sapphire-localnet:
@@ -47,3 +47,6 @@ services:
4747
depends_on:
4848
"sapphire-localnet":
4949
condition: service_healthy
50+
51+
volumes:
52+
ollama-storage:

compose.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
ports:
55
- "11434:11434"
66
volumes:
7-
- /storage/ollama:/root/.ollama
7+
- ollama-storage:/root/.ollama
88
entrypoint: ["/usr/bin/bash", "-c", "/bin/ollama serve & sleep 5; ollama pull deepseek-r1:1.5b; wait"]
99

1010
oracle:
@@ -16,3 +16,6 @@ services:
1616
restart: on-failure
1717
volumes:
1818
- /run/rofl-appd.sock:/run/rofl-appd.sock
19+
20+
volumes:
21+
ollama-storage:

contracts/README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Chat bot contracts
22

3-
To deploy on the Localnet run:
3+
## Localnet
44

5-
```bash
5+
Localnet has hardcoded accounts and ROFL app ids, so you can simply run:
6+
7+
```shell
68
forge create \
79
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
810
--rpc-url http://localhost:8545 \
@@ -13,8 +15,29 @@ forge create \
1315

1416
You can then submit a prompt from the CLI by issuing:
1517

16-
```bash
18+
```shell
1719
cast send 0x5FbDB2315678afecb367f032d93F642f64180aa3 \
1820
"appendPrompt(string)" "hello" \
19-
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
21+
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
22+
--rpc-url http://localhost:8545
23+
```
24+
25+
## Testnet and Mainnet
26+
27+
First convert your `rofl1` app ID to hex, for example by using
28+
https://slowli.github.io/bech32-buffer/
29+
30+
Then deploy the contract with your hex-encoded app ID and zero oracle account.
31+
The oracle account will be configured inside the ROFL TEE the first time it
32+
boots to ensure traceability:
33+
34+
```shell
35+
forge create --private-key YOUR_PRIVATE_KEY \
36+
--rpc-url https://testnet.sapphire.oasis.io \
37+
--broadcast \
38+
ChatBot \
39+
--constructor-args your-domain.com YOUR_APP_ID_IN_HEX 0x0000000000000000000000000000000000000000
2040
```
41+
42+
For Mainnet deployment, deploy with your Mainnet app ID, account, domain and
43+
`--rpc-url https://sapphire.oasis.io` parameter.

rofl.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ resources:
1212
kind: disk-persistent
1313
size: 10000
1414
artifacts:
15-
firmware: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/ovmf.tdx.fd#db47100a7d6a0c1f6983be224137c3f8d7cb09b63bb1c7a5ee7829d8e994a42f
16-
kernel: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/stage1.bin#06e12cba9b2423b4dd5916f4d84bf9c043f30041ab03aa74006f46ef9c129d22
17-
stage2: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/stage2-podman.tar.bz2#6f2487aa064460384309a58c858ffea9316e739331b5c36789bb2f61117869d6
15+
firmware: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/ovmf.tdx.fd#db47100a7d6a0c1f6983be224137c3f8d7cb09b63bb1c7a5ee7829d8e994a42f
16+
kernel: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/stage1.bin#23877530413a661e9187aad2eccfc9660fc4f1a864a1fbad2f6c7d43512071ca
17+
stage2: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/stage2-podman.tar.bz2#631349bef06990dd6ae882812a0420f4b35f87f9fe945b274bcfb10fc08c4ea3
1818
container:
19-
runtime: https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.5.0/rofl-containers#800be74e543f1d10d12ef6fadce89dd0a0ce7bc798dbab4f8d7aa012d82fbff1
19+
runtime: https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.5.2/rofl-containers#3abac3e7519588c1a4e250f1bf5cbbbd58c4e4c8ee817070031b9e0e3d4e0095
2020
compose: compose.yaml
2121
deployments:
2222
default:
@@ -34,8 +34,8 @@ deployments:
3434
min_tcb_evaluation_data_number: 17
3535
tdx: {}
3636
enclaves:
37-
- id: r73zDIRsJ23opSYJ1r9LXhpivvM4QFAAJKcgmjQLaTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
38-
- id: yvZEDsBeQ4pERD7zi9zcnMWFN04gB7YYuaGfPB8TAhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
37+
- id: XIJYBT4EHM7v5a4x7D+F9QgL88m+CpNPCItYvZ4tALsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
38+
- id: rTTY+55JXK7uYtyjeZGP7qirmtbiJmx6cO1EY+mYLhUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
3939
endorsements:
4040
- any: {}
4141
fees: endorsing_node

0 commit comments

Comments
 (0)