Skip to content

Commit

Permalink
Merge pull request #1256 from input-output-hk/kderme/release-cherry-p…
Browse files Browse the repository at this point in the history
…icks

Cherry-pick commits for release
  • Loading branch information
kderme authored Sep 13, 2022
2 parents ca94be4 + 5a5c3ed commit 8ad98d4
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
# From cardano-base
# see https://github.com/input-output-hk/cardano-base/blob/master/.github/workflows/haskell.yml
SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a
PKG_CONFIG_PATH: ${{ matrix.os == 'macos-latest' && '/usr/local/opt/postgresql@14/lib/postgresql@14/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig' || '' }}

strategy:
fail-fast: false
Expand All @@ -39,7 +40,7 @@ jobs:
- name: Install Postgres support (MacOS)
if: matrix.os == 'macos-latest'
run: |
brew install postgres libpq [email protected]
brew install postgresql@14 libpq [email protected]
brew services start postgresql
sudo mkdir -p /var/run/postgresql/
sudo ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432
Expand Down Expand Up @@ -120,7 +121,7 @@ jobs:
- name: Build dependencies OSX
if: matrix.os == 'macos-latest'
run: |
PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig" cabal build all --only-dependencies
cabal build all --only-dependencies
- name: Build
run: cabal build all
Expand Down
2 changes: 1 addition & 1 deletion cardano-chain-gen/cardano-chain-gen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cabal-version: 2.4
-- http://haskell.org/cabal/users-guide/

name: cardano-chain-gen
version: 13.0.4
version: 13.0.5
synopsis: A fake chain generator for testing cardano DB sync.
description: A fake chain generator for testing cardano DB sync.
homepage: https://github.com/input-output-hk/cardano-db-sync
Expand Down
8 changes: 8 additions & 0 deletions cardano-db-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Revision history for cardano-db-sync

## 13.0.5
* Fixed an issue where `StakeAdress` cache was not cleaned up properly and could cause crashes [#1222]
* Fixed an issue where fees for txs with phase 2 failure which din't include the total_collateral fields appeared to be 0 [#1242]
* Fixed an issue where `Datum` were reserialised and could be inserted in a different CBOR format [#1214]
* Improved docker documentation
* Made disable options like `disable-ledger` easily available through docker
* Supported new networks, preview, preprod

## 13.0.4
* Bump to the latest node release.

Expand Down
2 changes: 1 addition & 1 deletion cardano-db-sync/cardano-db-sync.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cabal-version: 2.4
-- http://haskell.org/cabal/users-guide/

name: cardano-db-sync
version: 13.0.4
version: 13.0.5
synopsis: The Cardano DB Sync node
description: A Cardano node that follows the Cardano chain and inserts data from the
chain into a PostgresQL database.
Expand Down
2 changes: 1 addition & 1 deletion cardano-db-tool/cardano-db-tool.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cabal-version: 2.2
-- http://haskell.org/cabal/users-guide/

name: cardano-db-tool
version: 13.0.4
version: 13.0.5
synopsis: Utilities to manage the cardano-db-sync databases.
description: Utilities and executable, used to manage and validate the
PostgreSQL db and the ledger database of the cardano-db-sync node
Expand Down
2 changes: 1 addition & 1 deletion cardano-db/cardano-db.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cabal-version: 2.2
-- http://haskell.org/cabal/users-guide/

name: cardano-db
version: 13.0.4
version: 13.0.5
synopsis: A base PostgreSQL component for the cardano-db-sync node.
description: Code for the Cardano DB Sync node that is shared between the
cardano-db-node and other components.
Expand Down
2 changes: 1 addition & 1 deletion cardano-smash-server/cardano-smash-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cabal-version: 2.2
-- http://haskell.org/cabal/users-guide/

name: cardano-smash-server
version: 13.0.4
version: 13.0.5
synopsis: The Cardano smash server
description: Please see the README on GitHub at
<https://github.com/input-output-hk/cardano-db-sync/cardano-smash-server/#readme>
Expand Down
24 changes: 20 additions & 4 deletions doc/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ The PostgreSQL database is exposed on localhost port `5432`
`$ psql -h 0.0.0.0 -p 5432 -U postgres -d cexplorer` (then enter secret password)

### To connect to another network:

To connect to different network (preprod or preview) use `NETWORK` environment variable:


```
NETWORK=testnet docker-compose up && docker-compose logs -f
NETWORK=preprod docker-compose up && docker-compose logs -f
```

### Take control
Expand Down Expand Up @@ -57,16 +61,28 @@ docker load -i $(nix-build -A dockerImage --no-out-link)
## Restore from Snapshot

Restoring a database by running from gensis can take a number of hours, snapshots are provided for
both networks (Mainnet and Testnet) to restore the postgres database. See the
Mainnet to restore the postgres database. See the
[latest releases](https://github.com/input-output-hk/cardano-db-sync/releases) for a recent snapshot
matched with the `cardano-db-sync` version.

To download and restore a snapshot include `RESTORE_SNAPSHOT`:

```
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/db-sync-snapshot-schema-10-block-6014140-x86_64.tgz \
NETWORK=testnet docker-compose up && docker-compose logs -f
docker-compose up && docker-compose logs -f
```

## Disable options

Consult the configuration [docs](docs/configuration.md) for what these options mean, assuming you have read that
they can be accessed via env variables passed to docker-compose. Leave out any that do not make sense, eg if
you just want to disable the ledger use `DISABLE_LEDGER=--disable-ledger docker-compose up`.

``` shell
DISABLE_LEDGER=--disable-ledger \
DISABLE_CACHE=--disable-cache \
DISABLE_EPOCH=--disable-epoch \
docker-compose up
```

## Running Tests with Docker Postgres
Expand Down Expand Up @@ -139,7 +155,7 @@ inputoutput/cardano-db-sync 066b747a8bfd3791b06ea46c2e793f83ed64967f f34b029
$ docker run inputoutput/cardano-db-sync:066b747a8bfd3791b06ea46c2e793f83ed64967f
```

## Running SMASH with docker-compose
## Running SMASH with docker-compose

Edit the docker-compose.yml to add a listening port for the postgres container
e.g.
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ services:
max-file: "10"

cardano-db-sync:
image: inputoutput/cardano-db-sync:13.0.4
image: inputoutput/cardano-db-sync:13.0.5
environment:
- NETWORK=${NETWORK:-mainnet}
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- RESTORE_SNAPSHOT=${RESTORE_SNAPSHOT:-}
- RESTORE_RECREATE_DB=N
- DISABLE_LEDGER=${DISABLE_LEDGER:-}
- DISABLE_CACHE=${DISABLE_CACHE:-}
- DISABLE_EPOCH=${DISABLE_EPOCH:-}
depends_on:
# Depend on both services to be healthy before starting.
cardano-node:
Expand Down
3 changes: 2 additions & 1 deletion nix/nixos/cardano-db-sync-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ in {
--config ${configFile} \
--socket-path "$CARDANO_NODE_SOCKET_PATH" \
--schema-dir ${self.schema or (self.src + "/schema")} \
--state-dir ${cfg.stateDir}
--state-dir ${cfg.stateDir} \
$DISABLE_LEDGER $DISABLE_CACHE $DISABLE_EPOCH
'';
};
systemd.services.cardano-db-sync = {
Expand Down

0 comments on commit 8ad98d4

Please sign in to comment.