Skip to content

Commit 42f8884

Browse files
committed
Merge branch 'main' into chore-fractionadigits-envconfigs
2 parents 04e78c0 + eea0c00 commit 42f8884

68 files changed

Lines changed: 3335 additions & 215 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: mainnet-api-main
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
detect-changes:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
changed: ${{ steps.changes.outputs.api-main }}
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Detect api-main changes
18+
uses: dorny/paths-filter@v3
19+
id: changes
20+
with:
21+
filters: |
22+
api-main:
23+
- 'packages/api-main/**'
24+
25+
test:
26+
needs: detect-changes
27+
if: needs.detect-changes.outputs.changed == 'true'
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v3
33+
34+
- name: Install pnpm with npm
35+
run: npm install -g pnpm
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version-file: .nvmrc
41+
cache: "pnpm"
42+
43+
- name: Install dependencies with pnpm
44+
run: pnpm install
45+
46+
- name: Set up Docker
47+
uses: docker/setup-docker-action@v4
48+
49+
- name: Build API Types
50+
run: |
51+
cd ./packages/lib-api-types
52+
pnpm build
53+
54+
- name: Run Docker Compose Up
55+
run: |
56+
cd ./packages/api-main
57+
docker compose -f ./docker-compose-github.yml up --build -d --wait --wait-timeout 30
58+
59+
- name: Push database migrations
60+
run: |
61+
cd ./packages/api-main
62+
cp .env.example .env
63+
pnpm db:push:force
64+
65+
- name: Run tests with pnpm
66+
run: |
67+
cd ./packages/api-main
68+
pnpm test
69+
70+
deploy-mainnet:
71+
needs: [detect-changes, test]
72+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
73+
runs-on: ubuntu-latest
74+
environment: mainnet
75+
steps:
76+
- name: Checkout code
77+
uses: actions/checkout@v3
78+
79+
- name: Setup Fly.io CLI
80+
uses: superfly/flyctl-actions/setup-flyctl@master
81+
82+
- name: Deploy api-main to Fly.io
83+
run: |
84+
cd ./packages/api-main
85+
flyctl deploy --remote-only --config ./fly.mainnet.toml
86+
env:
87+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN_API_MAIN }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: mainnet-reader-main
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
detect-changes:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
changed: ${{ steps.changes.outputs.reader-main }}
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Detect reader-main changes
18+
uses: dorny/paths-filter@v3
19+
id: changes
20+
with:
21+
filters: |
22+
reader-main:
23+
- 'packages/reader-main/**'
24+
25+
test:
26+
needs: detect-changes
27+
if: needs.detect-changes.outputs.changed == 'true'
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v3
32+
33+
# Add reader-main specific test steps here
34+
35+
deploy-mainnet:
36+
needs: [detect-changes, test]
37+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
38+
runs-on: ubuntu-latest
39+
environment: mainnet
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v3
43+
44+
- name: Setup Fly.io CLI
45+
uses: superfly/flyctl-actions/setup-flyctl@master
46+
47+
- name: Deploy reader-main to Fly.io
48+
run: |
49+
cd ./packages/reader-main
50+
flyctl deploy --remote-only --config ./fly.mainnet.toml
51+
env:
52+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN_READER_MAIN }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Deploy Retype Docs
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- mainnet
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: retypeapp/action-build@latest
18+
env:
19+
key: ${{ secrets.RETYPE_KEY }}
20+
config_path: docs
21+
22+
- uses: retypeapp/action-github-pages@latest
23+
with:
24+
update-branch: true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: api-main
1+
name: testnet-api-main
22

33
on:
44
pull_request:
@@ -86,6 +86,6 @@ jobs:
8686
- name: Deploy api-main to Fly.io
8787
run: |
8888
cd ./packages/api-main
89-
flyctl deploy --remote-only
89+
flyctl deploy --remote-only --config ./fly.testnet.toml
9090
env:
9191
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN_API_MAIN }}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: reader-main
1+
name: testnet-reader-main
22

33
on:
44
pull_request:
@@ -51,6 +51,6 @@ jobs:
5151
- name: Deploy reader-main to Fly.io
5252
run: |
5353
cd ./packages/reader-main
54-
flyctl deploy --remote-only
54+
flyctl deploy --remote-only --config ./fly.testnet.toml
5555
env:
5656
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN_READER_MAIN }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ data
1010
data/*
1111
.vscode/
1212
.idea/
13-
.DS_Store
13+
.DS_Store
14+
.retype
15+
retype.manifest

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Dither Service
22

3-
Dither Service is a provider engine for individual front-end applications to listen to the Dither Protcol.
3+
The **Dither Service** utilizes **event-sourcing data** to deterministically rebuild application state. This is achieved by processing events streamed directly from cosmos-based chains, specifically **AtomOne**.
44

5-
The Dither Service uses event-sourcing data to rebuild application state from Cosmos based chains, specifically AtomOne.
5+
## 🚀 Getting Started (Usage)
66

7-
## Usage
7+
To quickly spin up the entire Dither Service and its components, use the provided Docker Compose file:
88

9-
```
9+
```sh
1010
docker compose up --build
1111
```
1212

13+
You will need to start the frontend service on its own.
14+
1315
## Project Structure Explanation
1416

1517
### [api-main](./packages/api-main/README.md)
@@ -20,14 +22,18 @@ A REST Endpoint Provider for post feeds, and looking up individual posts.
2022

2123
A blockchain reader that parses memos, and re-routes them through an event system.
2224

23-
### nginx
25+
### [cli](./packages/cli)
2426

25-
Just an nginx configuration for gateway access to APIs
27+
A small reader that pulls all `dither.` messages from the chain in the last 100 blocks.
2628

2729
### [frontend-main](./packages/frontend-main/README.md)
2830

2931
An frontend Single Page Application for Dither as a whole.
3032

3133
## [tool-network-spammer](./packages/tool-network-spammer/README.md)
3234

33-
A tool for spamming devnet / testnet and building test data to be consumed by the event system.
35+
A tool for spamming devnet / testnet and building test data to be consumed by the event system.
36+
37+
### nginx
38+
39+
Just an nginx configuration for gateway access to APIs

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ services:
3232
condition: service_healthy
3333
environment:
3434
PG_URI: "postgresql://default:password@postgres:5432/postgres"
35+
AUTH: "dev"
3536
ports:
3637
- 3000:3000
3738
healthcheck:
@@ -61,6 +62,11 @@ services:
6162
MEMO_PREFIX: "dither."
6263
RECEIVER: "atone1uq6zjslvsa29cy6uu75y8txnl52mw06j6fzlep"
6364
API_ROOT: "http://api-main:3000/v1"
65+
AUTH: "dev"
66+
# Uncomment to enable fast sync
67+
# ECLESIA_GRAPHQL_ENDPOINT: "https://graphql-atomone-testnet-1.allinbits.services/v1/graphql"
68+
# ECLESIA_GRAPHQL_SECRET: ""
69+
6470
# PG_URI: postgres://username:password@postgres-feed:5432/feed
6571
# LOG: process.env.LOG === 'true' ? true : false,
6672

docs/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# **About Dither**
2+
3+
Dither is a public protocol for publishing messages onchain**.** It is designed to be simple, durable, and open to extension by anyone.
4+
5+
At its core, Dither is a read-optimized, event-sourced messaging protocol. It indexes a specific subset of memos from any compatible blockchain (currently AtomOne), reconstructs application state from those events, and exposes that state through a public API.
6+
7+
There are two main components:
8+
9+
* **Dither Service**
10+
A backend that monitors the blockchain, processes memo events, and reconstructs user and post data. This state is made available through a REST API.
11+
12+
* **Dither Website**
13+
A lightweight frontend that connects to the API and lets users post, browse, follow others, and reflect content. It is fully stateless and open source.
14+
15+
These components are designed to be decoupled. Anyone can run their own version of the service, build their own client, or use the protocol in a completely different way. Dither is not a platform. It is a protocol and reference implementation.
16+
17+
Dither avoids algorithmic feeds, editing tools, and moderation queues. It is minimal by design. All content is public and stored permanently onchain. This structure creates space for users and communities to define their own norms, tooling, and experience. Developers can run their own indexers, fork the client, or build custom frontends using the public API.

docs/guides/FAQ.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
!!! Hey Listen!
2+
We will never ask you for your private keys, or mnemonic phrase.
3+
Never share this information with anyone else.
4+
!!!
5+
6+
# FAQ
7+
8+
Information for people who have questions about Dither and how it works.
9+
10+
## How does dither work?
11+
12+
Dither works by pushing messages to the AtomOne blockchain with a specific format.
13+
14+
Specifically for posting it's `dither.Post("My message goes here")`
15+
16+
As long as it goes to the `atone1uq6zjslvsa29cy6uu75y8txnl52mw06j6fzlep` address, it will be indexed.
17+
18+
## Can I upload images?
19+
20+
No, instead you can link to other third-party providers who will be image hosts. This prevents nefarious content from being uploaded to the chain. It's important to understand that Dither is a text-only service.
21+
22+
## How do I post without Keplr?
23+
24+
If you are using a cli application like `atomoned` you can do a simple bank transfer to `atone1uq6zjslvsa29cy6uu75y8txnl52mw06j6fzlep` with `dither.Post("My message goes here")` to post a message.
25+
26+
## Why does dither cost PHOTON?
27+
28+
In order to index your message and keep the service alive we take a very tiny fee for indexing, and the validators will get the rest of the fees for indexing the data on-chain.
29+
30+
## Can messages be deleted?
31+
32+
No, they cannot be deleted. However, Dither does reserve the right to hide a message. However, you as a user will always have access to these messages as they are **always available on-chain, if you go looking for them**.

0 commit comments

Comments
 (0)