@@ -55,23 +55,48 @@ make install
55
55
56
56
```
57
57
58
- - with cabal:
58
+ ### Clone repository
59
59
60
- ```
60
+ Start by cloning the ` cardano-db-sync ` repository from GitHub.
61
+ ``` sh
61
62
git clone https://github.com/IntersectMBO/cardano-db-sync
63
+ ```
64
+
65
+ Navigate into the cloned repository directory.
66
+ ``` sh
62
67
cd cardano-db-sync
63
- PGPASSFILE=config/pgpass-mainnet scripts/postgresql-setup.sh --createdb
68
+ ```
69
+
70
+ ** Checkout and Create Branch** : Check out the latest official tag and create a new branch based on that tag. Replace ` <latest-official-tag> ` with the specific tag you want to use.
71
+ ``` sh
64
72
git checkout < latest-official-tag> -b tag-< latest-official-tag>
73
+ ```
74
+
75
+ ## Using Cabal
76
+
77
+ ** Database Setup** : Set up the PostgreSQL database using the provided script with the configuration in ` config/pgpass-mainnet ` .
78
+ ``` sh
79
+ PGPASSFILE=config/pgpass-mainnet scripts/postgresql-setup.sh --createdb
80
+ ```
65
81
82
+ ** Build the Project** : Use Cabal to build the ` cardano-db-sync ` project.
83
+ ``` sh
66
84
cabal build cardano-db-sync
85
+ ```
86
+
87
+ ** Run the Sync Node** :
88
+ - Ensure the ` config/mainnet-config.yaml ` file is correctly specified.
89
+ - Use the appropriate socket path for the Cardano node.
90
+ - Define the directories for storing ledger state and schema files.
91
+ ``` sh
67
92
PGPASSFILE=config/pgpass-mainnet cabal run cardano-db-sync -- \
68
93
--config config/mainnet-config.yaml \
69
94
--socket-path ../cardano-node/state-node-mainnet/node.socket \
70
95
--state-dir ledger-state/mainnet \
71
96
--schema-dir schema/
72
97
```
73
98
74
- to find ` cardano-db-sync ` executable location use:
99
+ If building locally, to find ` cardano-db-sync ` executable location use:
75
100
76
101
```
77
102
find . -name cardano-db-sync -executable -type f
@@ -82,14 +107,23 @@ On macOS `brew install postgresl
[email protected] ` and extend PKG_CONFIG_PATH with
82
107
` PKG_CONFIG_PATH=/usr/local/opt/postgresql/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig cabal build all `
83
108
when running cabal build
84
109
85
- - with nix :
110
+ ## Using Nix :
86
111
87
- ```
88
- git clone https://github.com/IntersectMBO/cardano-db-sync
89
- cd cardano-db-sync
90
- git checkout <latest-official-tag> -b tag-<latest-official-tag>
112
+ ** Build the Project** : Build the cardano-db-sync project using Nix
113
+ ``` sh
91
114
nix build -v .# cardano-db-sync -o db-sync-node
115
+ ```
116
+
117
+ Set up the PostgreSQL database using the provided script with the configuration in ` config/pgpass-mainnet `
118
+ ``` sh
92
119
PGPASSFILE=config/pgpass-mainnet scripts/postgresql-setup.sh --createdb
120
+ ```
121
+
122
+ ** Run the Sync Node** :
123
+ - Ensure the ` config/mainnet-config.yaml ` file is correctly specified.
124
+ - Use the appropriate socket path for the Cardano node.
125
+ - Define the directories for storing ledger state and schema files.
126
+ ``` sh
93
127
PGPASSFILE=config/pgpass-mainnet db-sync-node/bin/cardano-db-sync \
94
128
--config config/mainnet-config.yaml \
95
129
--socket-path ../cardano-node/state-node-mainnet/node.socket \
0 commit comments