Skip to content

Commit

Permalink
Merge branch 'master' into enis/add-nixos-module
Browse files Browse the repository at this point in the history
  • Loading branch information
enobayram committed Dec 21, 2023
2 parents 6c06752 + 725f3d5 commit 3df2f9b
Show file tree
Hide file tree
Showing 26 changed files with 652 additions and 1,347 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.10.7']
cabal: ['3.4']
ghc: ['9.2.8']
cabal: ['3.10']
os: ['ubuntu-20.04', 'ubuntu-22.04', 'macOS-latest']

steps:
Expand All @@ -23,7 +23,7 @@ jobs:

# Haskell Setup
- name: Install GHC and Cabal
uses: haskell/actions/setup@v2.3.3
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ jobs:
uses: actions/checkout@v3

- name: Set up Nix with caching
uses: kadena-io/setup-nix-with-cache/by-root@v3
uses: kadena-io/setup-nix-with-cache/by-root@v3.1
with:
cache_url: s3://nixcache.chainweb.com?region=us-east-1
signing_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
additional_experimental_features: recursive-nix


- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -32,9 +34,12 @@ jobs:
aws-region: us-east-1

- name: Give root user AWS credentials
uses: kadena-io/setup-nix-with-cache/copy-root-aws-credentials@v3
uses: kadena-io/setup-nix-with-cache/copy-root-aws-credentials@v3.1

- name: Build and cache artifacts
run: |
echo Building the project and its devShell
nix build .#check --log-lines 500 --show-trace
echo Build the recursive output
nix build .#recursive.allDerivations --log-lines 500 --show-trace
10 changes: 6 additions & 4 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#+TITLE: Chainweb Data
#+AUTHOR: Colin

[[https://github.com/kadena-io/chainweb-data/workflows/Build/badge.svg]]
[[https://github.com/kadena-io/chainweb-data/actions/workflows/ci.yaml/badge.svg]]
[[https://github.com/kadena-io/chainweb-data/actions/workflows/nix.yml/badge.svg]]

* Table of Contents :TOC_4_gh:noexport:
- [[#overview][Overview]]
Expand Down Expand Up @@ -35,9 +36,10 @@ can easily determine mining statistics and confirm transaction contents.

* Requirements

~chainweb-data~ requires [[https://www.postgresql.org/][Postgres]]. If you plan to host a chainweb-data instance
~chainweb-data~ requires [[https://www.postgresql.org/][Postgres]] configured with UTF8 encoding. If you plan to host a chainweb-data instance
on a cloud machine (e.g. Amazon EC2), we recommend that you run the postgres
instance on an instance attached storage unit.
The chainweb-node instance should have good performance to avoid timeouts during fill operations, use ssd storage for the db.

* Building

Expand Down Expand Up @@ -314,7 +316,7 @@ If the already executed migrations are a prefix (i.e. they were run in the corre
of the expected migrations, then the rest of the migrations will be executed.

By taking advantage of this alphabetical sorting, ~chainweb-data~ operators can insert custom migrations to be executed at the moment they desire.
For example, version 2.3.0 of ~chainweb-data~ will have migrations done on top of version 2.2.0, thus having migrations named ~2.2.0.N_...~ (~N>=1~). Creating a custom migration named ~2.3.0.0.N_...~ will guarantee that it'll be executed after the new migrations that come with version 2.3.0 and before the new migrations of future versions, which are guaranteed to have a name greater than ~2.3.0.1_...~.
For example, version 2.3.0 of ~chainweb-data~ will have migrations done on top of version 2.2.0, thus having migrations named ~2.2.0.N_...~ (~N>=1~). Creating a custom migration named ~2.3.0.0.N_...~ will guarantee that it'll be executed after the new migrations that come with version 2.3.0 and before the new migrations of future versions, which are guaranteed to have a name greater than ~2.3.0.1_...~.
Likewise, ~chainweb-data~ operators that run the latest commit
from the ~master~ branch can also inject their migrations. For example, if the latest commit
has the last migration named ~2.2.0.1_...~, then their migrations can be named ~2.2.0.1.N_...~.
Expand All @@ -327,4 +329,4 @@ manually by undoing migrations and removing ~schema_migrations~ entries.
~chainweb-data~ operators that specialize their database schema are strongly advised to review
the incoming migrations **before** they upgrade their ~chainweb-data~ versions. This will allow
them to detect any potential conflicts and insert new schema migrations to be executed at the right moment, to
accommodate the incoming changes.
accommodate the incoming changes.
54 changes: 30 additions & 24 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
packages: haskell-src/chainweb-data.cabal
with-compiler: ghc-9.2.8

package aeson
flags: +cffi

source-repository-package
type: git
location: https://github.com/mightybyte/beam-automigrate.git
tag: 112c39953c432b05ec6ae2354b0150c61ee30157
--sha256: sha256-0x8L1moEyayqdxHUVpYvvdvMcBCo6qMXku2zDzpMNq8=
location: https://github.com/kadena-io/beam-automigrate.git
tag: 0909e5ea1d967ab4342df6e6b503f59608a3f01e
--sha256: sha256-FMudTlB9H5e0mMmzOLvQFMo+AdBA5pQ+W7eMB8LPB68==

source-repository-package
type: git
location: https://github.com/kadena-io/pact.git
tag: 957b8bd7644cebc60d043b33f0d7ffc53c65d783
--sha256: sha256-ERyHLWEoV83mzjSlMwY8WmHsEaq3JrbxFwQjW0tFXLE=
tag: e5c922664fb4df53e3b8e2c48618d71b3ef612ad
--sha256: sha256-t1p+Zd5I/mW2Aggi4xMRl0wj6k3ztsgzydvNkBachFA=

source-repository-package
type: git
location: https://github.com/kadena-io/chainweb-api.git
tag: 7fb1e73d2f7a0f0dd5703873c7204287cd7e8d25
--sha256: sha256-KaXVlMBVy6hDrKL2z54+jH4CIVjoWbS4X2RwT/QUMNo=
tag: 33022a1b4e8800d01120b5c2a41979adfe65d987
--sha256: 0wi52j109r2j8csqjanf4q9s2gyl3p16d9r58ljgyxjmp5ihjvi1

source-repository-package
type: git
location: https://github.com/tathougies/beam.git
tag: 596981a1ea6765b9f311d48a2ec4d8460ebc4b7e
--sha256: sha256-4jfhHJTUKu09ULNFFACh3v9r3S0sJkUjTyjXq6gJY2A=
subdir:
beam-core
beam-migrate
beam-postgres

source-repository-package
type: git
location: https://github.com/obsidiansystems/gargoyle
tag: df0068f9572c1371bed7aa416af84d462c3574c0
--sha256: sha256-1NWmQf0zgi4RtQISXvk0JbsQ1OkpYJ789pkglE3fVaU=
subdir:
gargoyle
gargoyle-postgresql
type: git
location: https://github.com/kadena-io/pact-json
tag: e43073d0b8d89d9b300980913b842f4be339846d
--sha256: sha256-ZWbAId0JBaxDsYhwcYUyw04sjYstXyosSCenzOvUxsQ=

source-repository-package
type: git
Expand All @@ -51,4 +39,22 @@ package vault

write-ghc-environment-files: never

package pact
ghc-options: -Wwarn
optimization: True
flags: -build-tool

constraints: sbv <10
constraints: http2 <4.2

allow-newer: gargoyle:base
allow-newer: streaming-events:*
allow-newer: postgresql-simple-migration:*
allow-newer: beam-postgres:*
-- allow-newer: *:aeson
allow-newer: *:vector

allow-older: pact:base
allow-older: pact:mtl
allow-older: pact:text
allow-older: pact-json:text
Loading

0 comments on commit 3df2f9b

Please sign in to comment.