From e761e2004285e51c4ec3dc490bcf267e700f73a7 Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 15:52:43 -0300 Subject: [PATCH 1/9] ref(readme) add features and setup sections --- README.md | 59 ++++++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index eccbec6..bc535ff 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,39 @@ -# decimals +Sequence +========== +- Website: https://decimals.app/sequence +- Community: [Decimals Slack](https://decimals.app) +- Documentation: [https://docs.decimals.app/](https://docs.decimals.app/) -``` -jq -ncM 'while(true; .+1) | {method: "POST", header: {"x-api-key":["decimals"]}, url: "http://localhost:8890/v1/transactions", body: {amount: ., from: "Bob", to: "Alice", currency: "usd"} | @base64 }' | \ - vegeta attack -rate=50/s -lazy -format=json -duration=30s | \ - tee results.bin | \ - vegeta report -``` +Sequence is an API that stores, validates and reports asset movements. Also known as a Ledger. Sequence is immutable, scalable, and minimalist. -FIXME - -## Getting Started - -1. Start the application: `lein run` -2. Go to [localhost:8080](http://localhost:8080/) to see: `Hello World!` -3. Read your app's source code at src/decimals/service.clj. Explore the docs of functions - that define routes and responses. -4. Run your app's tests with `lein test`. Read the tests at test/decimals/service_test.clj. -5. Learn more! See the [Links section below](#links). +The key features of Sequence are: +- **Currency Agnostic**: Store and move any asset, from regular currencies like USD, to shelf items. -## Configuration +- **Easy API**: Sequence creates things as you use them. When you send value to an account, it is created if it does not exist. It gets out of the way. Just use it, and things will work. -To configure logging see config/logback.xml. By default, the app logs to stdout and logs/. -To learn more about configuring Logback, read its [documentation](http://logback.qos.ch/documentation.html). +- **Immutability**: Most existing ledger use database updates. This is bad for a ledger. Sequence is completelly immutable. The design of the database allows for consistency of balances without a single field being updated. +- **No-SQL Scalability**: Sequence runs on top of a No-SQL database, making it horizontally scalable from the 12-factors contianer to the database layer. -## Developing your service - -1. Start a new REPL: `lein repl` -2. Start your service in dev-mode: `(def dev-serv (run-dev))` -3. Connect your editor to the running REPL session. - Re-evaluated code will be seen immediately in the service. +## Getting Started -### [Docker](https://www.docker.com/) container support +### Docker -1. Configure your service to accept incoming connections (edit service.clj and add ::http/host "0.0.0.0" ) -2. Build an uberjar of your service: `lein uberjar` -3. Build a Docker image: `sudo docker build -t decimals .` -4. Run your Docker image: `docker run -p 8080:8080 decimals` +### Clojure lein -### [OSv](http://osv.io/) unikernel support with [Capstan](http://osv.io/capstan/) +1. Start the application: `lein run` -1. Build and run your image: `capstan run -f "8080:8080"` +## Configurations -Once the image it built, it's cached. To delete the image and build a new one: -1. `capstan rmi decimals; capstan build` +## Developing Sequence +1. Start a new REPL: `lein repl` +2. Start Sequence in dev-mode: `(def dev-serv (run-dev))` +3. Connect your editor to the running REPL session. + Re-evaluated code will be seen immediately in the service. ## Links -* [Other Pedestal examples](http://pedestal.io/samples) +* [Sequence design](http://decimals.app) +* [Open-source ledgers](http://decimals.app) From 61eb9d6278d7f00ebd30fb255c4ae28b75dec342 Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 16:24:12 -0300 Subject: [PATCH 2/9] feat(docs) add project logo image --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bc535ff..73608dd 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Sequence - Community: [Decimals Slack](https://decimals.app) - Documentation: [https://docs.decimals.app/](https://docs.decimals.app/) +Sequence + Sequence is an API that stores, validates and reports asset movements. Also known as a Ledger. Sequence is immutable, scalable, and minimalist. The key features of Sequence are: From 92ea8cd7dbd59a744883bc045db754e4d7db5f16 Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 17:35:26 -0300 Subject: [PATCH 3/9] fix(docs) minor readme text fixes --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 73608dd..b8a4c50 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,17 @@ Sequence Sequence -Sequence is an API that stores, validates and reports asset movements. Also known as a Ledger. Sequence is immutable, scalable, and minimalist. +Sequence is an API that store validate and reports asset movements. Also known as a Ledger. Sequence is immutable, scalable, and easy to use. The key features of Sequence are: -- **Currency Agnostic**: Store and move any asset, from regular currencies like USD, to shelf items. +- **Currency Agnostic**: Store, move and analyse any asset, from regular currencies like USD, to shelf items. -- **Easy API**: Sequence creates things as you use them. When you send value to an account, it is created if it does not exist. It gets out of the way. Just use it, and things will work. +- **Simple API**: Sequence creates things as you use them. When you send value to an account, it is gets created if it does not exist. It gets out of the way. use it, and things will work. -- **Immutability**: Most existing ledger use database updates. This is bad for a ledger. Sequence is completelly immutable. The design of the database allows for consistency of balances without a single field being updated. +- **Immutable**: Most existing ledger use database updates. This is bad for a ledger. Sequence is immutable. The design of the database allows for consistency of balances without a single field using updateds. -- **No-SQL Scalability**: Sequence runs on top of a No-SQL database, making it horizontally scalable from the 12-factors contianer to the database layer. +- **No-SQL database**: Sequence runs on top of a No-SQL database. It is horizontally scalable from the 12-factors contianer to the persistency layer. ## Getting Started From 421c91853a90623ca943e2f539d8a4887e5bf2b2 Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 18:04:03 -0300 Subject: [PATCH 4/9] feat(docs) add features and configs to readme --- README.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b8a4c50..a645106 100644 --- a/README.md +++ b/README.md @@ -10,24 +10,40 @@ Sequence is an API that store validate and reports asset movements. Also known a The key features of Sequence are: -- **Currency Agnostic**: Store, move and analyse any asset, from regular currencies like USD, to shelf items. +- **Multi-Currency**: Store, move and analyse any asset, from regular currencies like USD, to shelf items. -- **Simple API**: Sequence creates things as you use them. When you send value to an account, it is gets created if it does not exist. It gets out of the way. use it, and things will work. +- **Multi-Tenant**: Run multiple ledgers using the same infrastructure. Simply setup multiple tenants in the configurations and use the different API keys. + +- **No-SQL powered**: Sequence runs on top of a No-SQL database. It is horizontally scalable from the 12-factors contianer to the persistency layer. - **Immutable**: Most existing ledger use database updates. This is bad for a ledger. Sequence is immutable. The design of the database allows for consistency of balances without a single field using updateds. -- **No-SQL database**: Sequence runs on top of a No-SQL database. It is horizontally scalable from the 12-factors contianer to the persistency layer. +- **API simplicity**: Sequence creates things as you use them. When you send value to an account, it is gets created if it does not exist. It gets out of the way. Use it, and things will work. + +- **Analytics**: Send asset movement events to multiple destinations. Use it for analytics, fraud-detection, anything. ## Getting Started -### Docker +### docker-compose + +`docker-compose up` -### Clojure lein +The `docker-compose` file brings up: -1. Start the application: `lein run` +1. DynamoDB local with the Sequence table structure +2. The Sequence container ## Configurations +All configurations are loaded from environment varialbes. The available configurations are: + +| environment variable | configuration | dev profile | +|----------------------|---|---------------| +| `DYNAMODB_ENDPOINT` | The host for the DynamoDB instance. Mostly used for local development. | `http://localhost:8000` | +| `SEGMENT_KEY` | Optional Segment.io key to generate analytics events. | | +| `KEYS` | A string with a list of tenants and their `sha256` API keys digests. In json format. | `[{ "name": "test","email": "test@decimals.app", "public-key": "abc", "secret-key-hash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"}]` | + +Configurations can also be loaded from the `profiles.clj` file, where the dev configurations are setup. ## Developing Sequence From 2b6c8c4add217771d2363be36fcbf0e109a15fdc Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 18:06:37 -0300 Subject: [PATCH 5/9] fix(docs) set slack url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a645106..b0e2019 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Sequence ========== - Website: https://decimals.app/sequence -- Community: [Decimals Slack](https://decimals.app) +- Community: [Decimals Slack](https://decimalsapp.slack.com) - Documentation: [https://docs.decimals.app/](https://docs.decimals.app/) Sequence From 5e67e5bc2a389608608fb90c6103959e33e7947b Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 18:09:17 -0300 Subject: [PATCH 6/9] feat(docs) set sequence design blog link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0e2019..cbd4c0b 100644 --- a/README.md +++ b/README.md @@ -53,5 +53,5 @@ Configurations can also be loaded from the `profiles.clj` file, where the dev co Re-evaluated code will be seen immediately in the service. ## Links -* [Sequence design](http://decimals.app) +* [Sequence design](https://decimals.substack.com/p/things-i-wish-i-knew-before-building) * [Open-source ledgers](http://decimals.app) From 8bc740f015a2a3671257f0091321d2c47f802fa6 Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 18:10:28 -0300 Subject: [PATCH 7/9] feat(docs) add line separation to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cbd4c0b..35cf50e 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ The key features of Sequence are: - **Analytics**: Send asset movement events to multiple destinations. Use it for analytics, fraud-detection, anything. ## Getting Started +-------------------- ### docker-compose @@ -34,6 +35,7 @@ The `docker-compose` file brings up: 2. The Sequence container ## Configurations +------------------- All configurations are loaded from environment varialbes. The available configurations are: @@ -46,6 +48,7 @@ All configurations are loaded from environment varialbes. The available configur Configurations can also be loaded from the `profiles.clj` file, where the dev configurations are setup. ## Developing Sequence +------------------------ 1. Start a new REPL: `lein repl` 2. Start Sequence in dev-mode: `(def dev-serv (run-dev))` @@ -53,5 +56,6 @@ Configurations can also be loaded from the `profiles.clj` file, where the dev co Re-evaluated code will be seen immediately in the service. ## Links +--------- * [Sequence design](https://decimals.substack.com/p/things-i-wish-i-knew-before-building) * [Open-source ledgers](http://decimals.app) From 699e041ad21b76bbb77d637ecc4fb0d8e7fe297f Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 18:11:57 -0300 Subject: [PATCH 8/9] fix(docs) rollback lines --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 35cf50e..cbd4c0b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ The key features of Sequence are: - **Analytics**: Send asset movement events to multiple destinations. Use it for analytics, fraud-detection, anything. ## Getting Started --------------------- ### docker-compose @@ -35,7 +34,6 @@ The `docker-compose` file brings up: 2. The Sequence container ## Configurations -------------------- All configurations are loaded from environment varialbes. The available configurations are: @@ -48,7 +46,6 @@ All configurations are loaded from environment varialbes. The available configur Configurations can also be loaded from the `profiles.clj` file, where the dev configurations are setup. ## Developing Sequence ------------------------- 1. Start a new REPL: `lein repl` 2. Start Sequence in dev-mode: `(def dev-serv (run-dev))` @@ -56,6 +53,5 @@ Configurations can also be loaded from the `profiles.clj` file, where the dev co Re-evaluated code will be seen immediately in the service. ## Links ---------- * [Sequence design](https://decimals.substack.com/p/things-i-wish-i-knew-before-building) * [Open-source ledgers](http://decimals.app) From d374f28fafc6862f06cb8f12ffb116e390883d0d Mon Sep 17 00:00:00 2001 From: Andrios Date: Wed, 2 Sep 2020 18:24:14 -0300 Subject: [PATCH 9/9] fix(test) add specs dependency --- test/decimals/transactions_test.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/test/decimals/transactions_test.clj b/test/decimals/transactions_test.clj index ec70d8a..06e2059 100644 --- a/test/decimals/transactions_test.clj +++ b/test/decimals/transactions_test.clj @@ -6,6 +6,7 @@ [clojure.spec.gen.alpha :as gen] [decimals.dynamodb :as db] [decimals.balances :as b] + [decimals.specs] [decimals.transactions :as tx])) (deftest hash-txs-test