Skip to content

Commit

Permalink
Merge pull request #16 from teleconsys/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Revanee authored Mar 6, 2023
2 parents 5f29348 + df56455 commit 2438f12
Show file tree
Hide file tree
Showing 27 changed files with 3,613 additions and 1,653 deletions.
1,734 changes: 849 additions & 885 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
actix-web = "4"
kyber-rs = "0.1.0-alpha"
actix-web = "4"
anyhow = "1.0.68"
thiserror = "1.0.38"
log = "0.4.17"
Expand All @@ -18,10 +18,8 @@ hex = "0.4.3"
clap = { version = "4.0.32", features = ["derive"] }
serde = "1.0.152"
serde_json = "1.0.91"
iota-client = { git = "https://github.com/iotaledger/iota.rs", branch = "production", features = [
"mqtt",
] }
identity_iota = { version = "0.6" }
iota-client = { version = "2.0.1-rc.4", default-features = false, features = ["tls", "mqtt"] }
identity_iota = { version = "0.7.0-alpha" }
time = { version = "0.3.5", features = [
"std",
"serde",
Expand All @@ -33,4 +31,4 @@ tokio = { version = "1.24.1" }
futures = "0.3.25"
bincode = "1.3.3"
url = "2.3.1"
reqwest = "0.11.14"
reqwest = {version = "0.11.14", features = ["blocking"]}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ RUN cargo build --release

WORKDIR /scratch
RUN mkdir /app
RUN mkdir /data

RUN mv dora-storage/target/release/dora-storage /app

############################
Expand All @@ -30,8 +32,11 @@ EXPOSE 8000

# Copy the app dir into distroless image
COPY --chown=nonroot:nonroot --from=build /app /app
COPY --chown=nonroot:nonroot --from=build /data /data

WORKDIR /app


USER nonroot

ENTRYPOINT ["/app/dora-storage"]
85 changes: 52 additions & 33 deletions INSTRUCTIONS.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dOra is a distributed oracle built with the cryptographic techniques of DKG and

This demo is proposed as a proof of concept of the oracular and storage functionality.

Every node and the committee itself uses the DID standard for identification and communication purposes. This demo is currently using the IOTA Chrysalis network as a transport layer and to deploy DID Documents. **A conversion for this demo to Stardust is currently in the works, and will be released soon**.
Every node and the committee itself uses the DID standard for identification and communication purposes. This demo is currently using the **Stardust Testnet** network as a transport layer and to deploy DID Documents. If you want to run this demo using the IOTA Mainnet (Chrysalis) look at the [branch Chrysalis](https://github.com/teleconsys/dora-storage-demo/tree/chrysalis).

To implement DKG, DSS and other cryptographic features we use our library [kyber-rs](https://github.com/teleconsys/kyber-rs) which is Rust partial porting of the [DEDIS kyber](https://github.com/dedis/kyber) library written in Go.

Expand All @@ -21,7 +21,7 @@ Running the demo

In this demo, you can instance some nodes through the provided [docker-compose file](docker-compose.yml). Every fresh node will create its keypair and DID document on the Tangle, and connect to its local storage (a dedicated [minio](https://min.io/) instance).

To create a committee and send requests, a dedicated CLI app is provided by the very same executable. The nodes will create a committee in response to the `governor` entity, which, in this demo, is represented by a special `index` for indexed payloads on the Tangle. Requests will be forwarded to the `committee` using its DID's index, and the committee's logs and outputs will also be published on the same index.
To create a committee and send requests, a dedicated CLI app is provided by the very same executable. The nodes will create a committee in response to the `governor` entity, which, in this demo, is represented by a special `tag` for tagged data on the Tangle. Requests will be forwarded to the `committee` using a tag derived from its DID, and the committee's logs and outputs will also be published on the same tag.

The nodes will communicate using the Tangle, without the necessity of exchanging IPs or anything. This means that you can run multiple nodes from different machines and networks and they will form a `committee` using only the reciprocal DIDs, with some initial input from the `governor`.

Expand All @@ -32,6 +32,8 @@ For a detailed set of instructions regarding how to properly run and customize t

This demo is not intended to be fully representative of the final dOra system, either functionally or formally. Several possible security holes are present, deliberately overlooked as not of fundamental importance for a proof of concept.

This demo is built for the **Stardust Testnet**. The committee's funding (received through the faucet) is necessary to publish L1 DID documents and could be lost at the end of the demo. A way to retrieve funds from a committee's address is not yet implemented. **We disclaim any responsibility for loss of funds as we publish this demo to be used ONLY with Stardust Testnet without funds retrival.**


Contacts
---------------------------------
Expand Down
37 changes: 25 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,77 +40,90 @@ services:
MINIO_ROOT_PASSWORD: password
command: server --console-address ":9001" /data


dora-storage-1:
container_name: d1
tty: true
image: giordyfish/dora-storage-demo
image: giordyfish/dora-storage-demo:1.1.0
stop_grace_period: 5m
restart: always
volumes:
- d1:/data
environment:
- RUST_LOG=fsm=trace,dora=trace,sign=trace
- DORA_SAVE_DIR=/data
depends_on:
minio-1:
condition: service_started
command:
- "node"
- "--governor=dora-governor-demo"
- "--time-resolution=20"
- "--signature-sleep-time=20"
- "--signature-sleep-time=30"
- "--storage=minio-local"
- "--storage-endpoint=minio-1:9000"
- "--storage-access-key=admin"
- "--storage-secret-key=password"
- "--network=iota-main"
- "--node-url=https://api.testnet.shimmer.network"
- "--faucet-url=https://faucet.testnet.shimmer.network/api/enqueue"

dora-storage-2:
container_name: d2
tty: true
image: giordyfish/dora-storage-demo
image: giordyfish/dora-storage-demo:1.1.0
stop_grace_period: 5m
restart: always
volumes:
- d2:/data
environment:
- RUST_LOG=fsm=trace,dora=trace,sign=trace
- DORA_SAVE_DIR=/data
depends_on:
minio-2:
condition: service_started
command:
- "node"
- "--governor=dora-governor-demo"
- "--time-resolution=20"
- "--signature-sleep-time=20"
- "--signature-sleep-time=30"
- "--storage=minio-local"
- "--storage-endpoint=minio-2:9000"
- "--storage-access-key=admin"
- "--storage-secret-key=password"
- "--network=iota-main"
- "--node-url=https://api.testnet.shimmer.network"
- "--faucet-url=https://faucet.testnet.shimmer.network/api/enqueue"

dora-storage-3:
container_name: d3
tty: true
image: giordyfish/dora-storage-demo
image: giordyfish/dora-storage-demo:1.1.0
stop_grace_period: 5m
restart: always
volumes:
- d3:/data
environment:
- RUST_LOG=fsm=trace,dora=trace,sign=trace
- DORA_SAVE_DIR=/data
depends_on:
minio-3:
condition: service_started
command:
- "node"
- "--governor=dora-governor-demo"
- "--time-resolution=20"
- "--signature-sleep-time=20"
- "--signature-sleep-time=30"
- "--storage=minio-local"
- "--storage-endpoint=minio-3:9000"
- "--storage-access-key=admin"
- "--storage-secret-key=password"
- "--network=iota-main"

- "--node-url=https://api.testnet.shimmer.network"
- "--faucet-url=https://faucet.testnet.shimmer.network/api/enqueue"

#### minio volumes
volumes:
minio_storage_1: {}
minio_storage_1: {}
minio_storage_2: {}
minio_storage_3: {}
d1: {}
d2: {}
d3: {}

Loading

0 comments on commit 2438f12

Please sign in to comment.