-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
537 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Usage | ||
|
||
## Simulation mode | ||
|
||
### Bulid and run docker containers | ||
|
||
```bash | ||
$ cd mercurylayer | ||
$ docker compose -f docker-compose-sim.yml up --build | ||
``` | ||
### Add mmnemonics | ||
|
||
```bash | ||
$ docker exec -it mercurylayer-enclave-sgx-1 bash | ||
$ curl -X POST http://0.0.0.0:18080/add_mnemonic \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ | ||
"mnemonic": "achieve merry hidden lyrics element brand student armed dismiss vague fury avocado grief crazy garlic gallery blur spider bag bless motor crawl surround copper", | ||
"password": "b1gHKyfXTzs6", | ||
"index": 0, | ||
"threshold": 2 | ||
}' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
set -e | ||
|
||
docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=rw aesmd-socket | ||
|
||
docker compose -f docker-compose-hw.yml up --build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[toolchain] | ||
channel = "1.76.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
version: '3.8' | ||
|
||
services: | ||
aesm: | ||
build: | ||
context: enclave | ||
dockerfile: Dockerfiles/HW/Dockerfile | ||
target: aesm | ||
image: sgx_aesm | ||
devices: | ||
- /dev/isgx | ||
volumes: | ||
- aesmd-socket:/var/run/aesmd | ||
stdin_open: true | ||
tty: true | ||
|
||
enclave-sgx: | ||
build: | ||
context: enclave | ||
dockerfile: Dockerfiles/HW/Dockerfile | ||
target: sample | ||
depends_on: | ||
- aesm | ||
- db_enclave | ||
environment: | ||
- ENCLAVE_DATABASE_URL=postgres://postgres:postgres@db_enclave:5432/enclave | ||
devices: | ||
- /dev/isgx | ||
volumes: | ||
- aesmd-socket:/var/run/aesmd | ||
stdin_open: true | ||
tty: true | ||
|
||
mercury-server: | ||
build: | ||
context: . | ||
dockerfile: server/Dockerfile | ||
depends_on: | ||
- db_server | ||
environment: | ||
- LOCKBOX_URL=http://enclave-sgx:18080 | ||
- BITCOIN_NETWORK=testnet | ||
- LOCKHEIGHT_INIT=1000 | ||
- LH_DECREMENT=10 | ||
- DATABASE_CONNECTION_STRING=postgres://postgres:postgres@db_server:5432/mercury | ||
ports: | ||
- "8000:8000" | ||
|
||
db_enclave: | ||
image: postgres:16.2 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: enclave | ||
ports: | ||
- "5433:5432" | ||
volumes: | ||
- postgres_enclave_data:/var/lib/postgresql/data | ||
|
||
db_server: | ||
image: postgres:16.2 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: mercury | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- postgres_server_data:/var/lib/postgresql/data | ||
|
||
|
||
volumes: | ||
aesmd-socket: | ||
external: true | ||
postgres_enclave_data: | ||
postgres_server_data: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
version: '3.8' | ||
|
||
services: | ||
enclave-sgx: | ||
build: | ||
context: enclave | ||
dockerfile: Dockerfiles/SIM/Dockerfile | ||
depends_on: | ||
- db_enclave | ||
environment: | ||
- ENCLAVE_DATABASE_URL=postgres://postgres:postgres@db_enclave:5432/enclave | ||
|
||
mercury-server: | ||
build: | ||
context: . | ||
dockerfile: server/Dockerfile | ||
depends_on: | ||
- db_server | ||
environment: | ||
- LOCKBOX_URL=http://enclave-sgx:18080 | ||
- BITCOIN_NETWORK=testnet | ||
- LOCKHEIGHT_INIT=1000 | ||
- LH_DECREMENT=10 | ||
- DATABASE_CONNECTION_STRING=postgres://postgres:postgres@db_server:5432/mercury | ||
ports: | ||
- "8000:8000" | ||
|
||
db_enclave: | ||
image: postgres:16.2 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: enclave | ||
ports: | ||
- "5433:5432" | ||
volumes: | ||
- postgres_enclave_data:/var/lib/postgresql/data | ||
|
||
db_server: | ||
image: postgres:16.2 | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: mercury | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- postgres_server_data:/var/lib/postgresql/data | ||
|
||
|
||
volumes: | ||
postgres_enclave_data: | ||
postgres_server_data: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.