blob: 69be88181195bf65efba17b74ff45494072a636b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
[
{ type: install
message: <<EOM
/!\ This FreeBSD package REQUIRES postgresql DB to be initialized /!\
/!\ as per the following example for the software to function /!\
If starting with a fresh postgresql install:
service postgresql initdb
service postgresql start
service cardano_db_sync onefetch
To create a new database, this example uses "root" username for Cardano "mainnet".
Replace all instances of "mainnet" with "preview" or "preprod" for testnet setup.
su postgres
createuser --createdb --superuser root
exit
Next, setup pgpass file:
export PGPASSFILE=/var/db/cardano_db_sync/mainnet-configs/.pgpass
or
setenv PGPASSFILE /var/db/cardano_db_sync/mainnet-configs/.pgpass
echo "/tmp/:5432:cexplorer:*:*" > $PGPASSFILE
chmod 0600 $PGPASSFILE
Create the "cexplorer" database:
cardano-db-sync-pgsql-setup --createdb
Restore the database from a snapshot ( or skip this step to sync from genesis ):
IOG Repo: https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13.4/
Koios Repo: https://snapshots.koios.rest/dbsync-13.4-mainnet/
( Koios repo usually has extra indexes and fresh syncs from genesis )
fetch https://XXXX/XXXXXXXXXXX/db-sync-snapshot-schema-XX.X-block-XXXXXXX-XXXX.tgz
cardano-db-sync-pgsql-setup --restore-snapshot db-sync-snapshot-schema-XX.X-block-XXXXXXX-XXXX.tgz /var/db/cardano_db_sync/mainnet-state/
EOM
}
{ type: upgrade
message: <<EOM
If doing a major version upgrade ( ex. 15.0.0 to 16.0.0 ) you should drop
the current database and re-create it, as there will be breaking changes:
setenv PGPASSFILE /var/db/cardano_db_sync/mainnet-configs/.pgpass
cardano-db-sync-pgsql-setup --recreatedb
EOM
}
]
|