Skip to content

Commit 59c43c8

Browse files
committed
Merge branch 'main' into file-system
2 parents 24b4608 + 05c697f commit 59c43c8

File tree

25 files changed

+264
-421
lines changed

25 files changed

+264
-421
lines changed

.github/workflows/service-explorer.yml renamed to .github/workflows/explorer.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

9+
concurrency:
10+
group: "explorer"
11+
cancel-in-progress: true
12+
913
jobs:
1014
run:
1115
runs-on: ubuntu-latest
1216
permissions: write-all
17+
if: github.ref == 'refs/heads/main'
1318
steps:
1419
- name: Login to Github registry
1520
uses: docker/login-action@v2
@@ -27,6 +32,7 @@ jobs:
2732
- name: Retag and push latest Docker image
2833
if: github.ref == 'refs/heads/main'
2934
run: |
30-
docker tag ghcr.io/${{ github.repository }}/explorer:$( cat ./services/explorer/version.txt ) \
35+
version=$( cat ./services/explorer/version.txt )
36+
docker tag ghcr.io/${{ github.repository }}/explorer:$version \
3137
ghcr.io/${{ github.repository }}/explorer:latest
3238
docker push ghcr.io/${{ github.repository }}/explorer:latest

.github/workflows/ledger.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Ledger Journal
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
concurrency:
10+
group: "ledger"
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions: write-all
17+
if: github.ref == 'refs/heads/main'
18+
steps:
19+
- name: Login to Github registry
20+
uses: docker/login-action@v2
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
- name: Build and push versioned Docker image
28+
run: |
29+
version=$( cat ./compose/ledger/version.txt )
30+
docker build ./compose/ledger --tag ghcr.io/${{ github.repository }}/ledger:$version
31+
docker push ghcr.io/${{ github.repository }}/ledger:$version
32+
- name: Retag and push latest Docker image
33+
if: github.ref == 'refs/heads/main'
34+
run: |
35+
version=$( cat ./compose/ledger/version.txt )
36+
docker tag ghcr.io/${{ github.repository }}/ledger:$version \
37+
ghcr.io/${{ github.repository }}/ledger:latest
38+
docker push ghcr.io/${{ github.repository }}/ledger:latest

.github/workflows/ontology.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Ontology Journal
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
concurrency:
10+
group: "ontology"
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions: write-all
17+
if: github.ref == 'refs/heads/main'
18+
steps:
19+
- name: Login to Github registry
20+
uses: docker/login-action@v2
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
- name: Build and push versioned Docker image
28+
run: |
29+
version=$( cat ./compose/ontology/version.txt )
30+
docker build ./compose/ontology --tag ghcr.io/${{ github.repository }}/ontology:$version
31+
docker push ghcr.io/${{ github.repository }}/ontology:$version
32+
- name: Retag and push latest Docker image
33+
if: github.ref == 'refs/heads/main'
34+
run: |
35+
version=$( cat ./compose/ontology/version.txt )
36+
docker tag ghcr.io/${{ github.repository }}/ontology:$version \
37+
ghcr.io/${{ github.repository }}/ontology:latest
38+
docker push ghcr.io/${{ github.repository }}/ontology:latest

.github/workflows/service-cryptography.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,46 @@
1-
This repository contains services and deployment configurations for the [synchronic web journal](https://github.com/sandialabs/sync-journal).
1+
# Synchronic Web Services
2+
3+
This repository contains services and deployment configurations for the [Synchronic Web Journal](https://github.com/sandialabs/sync-journal) and [Synchronic Web Records](https://github.com/sandialabs/sync-records). It provides both ready-to-deploy, all-in-one Compose environments and individual microservice components that support Synchronic Web applications.
4+
5+
---
6+
7+
## Repository Structure
8+
9+
- **compose/**
10+
Pre-packaged, batteries-included Docker Compose environments for deploying Synchronic Web journals and supporting services.
11+
- Each subdirectory (e.g., `ledger/`, `ontology/`) contains everything needed to launch a complete application stack, including configuration, orchestration, and example scripts.
12+
- Ideal for users who want to quickly deploy a working Synchronic Web journal with minimal setup.
13+
14+
- **services/**
15+
Standalone microservice components that provide additional functionality to composed deployments.
16+
- These are not full applications by themselves, but are designed to be integrated into Compose environments or other orchestration systems.
17+
- Example: the `explorer` service provides a point-and-click front-end for exploring Synchronic Web record and ledger interfaces.
18+
19+
---
20+
21+
## Getting Started
22+
23+
To get started, choose a Compose environment that matches your use case:
24+
25+
- [compose/ledger/README.md](compose/ledger/README.md): Deploy a ledger journal for cryptographically verifiable record-keeping.
26+
- [compose/ontology/README.md](compose/ontology/README.md): Deploy an ontology journal for semantic data and provenance workflows.
27+
28+
Each Compose README provides step-by-step instructions, required environment variables, and example usage. These environments are designed for rapid deployment and experimentation—just follow the linked guides for details.
29+
30+
If you want to run or develop individual microservices, see the README in each service directory (e.g., [services/explorer/README.md](services/explorer/README.md)).
31+
32+
---
33+
34+
## Related Projects
35+
36+
- **[sync-journal](https://github.com/sandialabs/sync-journal):**
37+
The core Synchronic Web Journal SDK. Provides the main ledger, record, and evaluation engine.
38+
39+
- **[sync-records](https://github.com/sandialabs/sync-records):**
40+
A collection of reusable Scheme modules and test suites for advanced record and ledger operations.
41+
42+
---
43+
44+
## Contributing
45+
46+
Contributions are welcome! Please open issues or pull requests for new services, improvements to Compose environments, or documentation updates.

compose/ledger/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
database/

compose/ledger/Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
FROM ghcr.io/sandialabs/sync-journal/journal-sdk:1.0.1
1+
FROM ghcr.io/sandialabs/sync-journal/journal-sdk:1.0.3
22

3-
RUN wget https://raw.githubusercontent.com/sandialabs/sync-records/refs/heads/main/lisp/record.scm
4-
RUN wget https://raw.githubusercontent.com/sandialabs/sync-records/refs/heads/main/lisp/control.scm
5-
RUN wget https://raw.githubusercontent.com/sandialabs/sync-records/refs/heads/main/lisp/ledger.scm
3+
ARG REPOSITORY=https://raw.githubusercontent.com/sandialabs/sync-records/28818b41c1660db0eb81b05620972f7220b20b1b/lisp/
4+
5+
RUN wget $REPOSITORY/record.scm
6+
RUN wget $REPOSITORY/control.scm
7+
RUN wget $REPOSITORY/ledger.scm
68

79
COPY run.sh .
810

9-
CMD ./run.sh
11+
ENTRYPOINT ["./run.sh"]

compose/ledger/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ Please set the following environmental variables to configure the notary journal
1414
- `SECRET` (required): a string used to generate authentication credentials
1515
- `PORT`: port number to forward on the host machine (default:8192)
1616
- `PERIODICITY`: a nonnegative integer that determines the period of each synchronization step where period = 2 ^ PERIODICITY
17+
- `WINDOW`: the number previous unpinned historical states to persist
1718

1819
## Start
1920

20-
`$ SECRET=password PORT=80 docker compose up --build`
21+
`$ SECRET=password PORT=80 docker compose up`
2122

2223
## End
2324

compose/ledger/docker-compose.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,18 @@ networks:
33
name: docker
44

55
services:
6-
cryptography:
7-
image: ghcr.io/sandialabs/sync-services/cryptography:1.0.0
8-
container_name: cryptography
9-
networks:
10-
- docker
11-
126
journal:
13-
build:
14-
context: .
7+
image: ghcr.io/sandialabs/sync-services/ledger:1.0.1
158
container_name: journal
169
networks:
1710
- docker
18-
depends_on:
19-
- cryptography
2011
environment:
2112
SECRET: ${SECRET}
2213
PERIODICITY: ${PERIODICITY:-2}
23-
CRYPTOGRAPHY: http://cryptography.docker
14+
WINDOW: ${WINDOW:-1024}
15+
RUST_LOG: ${RUST_LOG:-INFO}
16+
volumes:
17+
- database:/srv/database
2418

2519
explorer:
2620
image: ghcr.io/sandialabs/sync-services/explorer:1.0.0
@@ -42,3 +36,6 @@ services:
4236
- docker
4337
ports:
4438
- "${PORT:-8192}:80"
39+
40+
volumes:
41+
database:

compose/ledger/run.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,12 @@ if [ -z "$SECRET" ]; then
55
exit 1
66
fi
77

8+
if [ -z "$WINDOW" ]; then
9+
WINDOW="#f"
10+
fi
11+
812
record=$( cat record.scm )
913
control=$( cat control.scm )
1014
ledger=$( cat ledger.scm )
1115

12-
check_status() {
13-
while true; do
14-
echo "Polling for cryptography service"
15-
response=$( wget -qO - "$1" 2>/dev/null)
16-
if [ -n "$response" ]; then
17-
return 0
18-
else
19-
sleep 1
20-
fi
21-
done
22-
}
23-
24-
check_status "${CRYPTOGRAPHY}/signature/key/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
25-
26-
./journal-sdk -- -b "($record \"$SECRET\" $control ($ledger \"$CRYPTOGRAPHY\" #t #f))" -s "(*step* \"$SECRET\")" -p 80 -c $PERIODICITY
16+
RUST_LOG=$RUST_LOG ./journal-sdk -b "($record \"$SECRET\" $control ($ledger \"$SECRET\" #f $WINDOW))" -s "(*step* \"$SECRET\")" -p 80 -c $PERIODICITY -d database

0 commit comments

Comments
 (0)