<p>Took me like 6+ Months to figure out all the requirements and what modules need to get loaded first...</p>
<p>This guide helped a lot <a href="https://robferguson.org/blog/2022/02/19/getting-started-with-cardano-graphql/" rel="nofollow noreferrer">https://robferguson.org/blog/2022/02/19/getting-started-with-cardano-graphql/</a>
And he coverers building on mac.</p>
<p>These steps assume you have a docker GraphQL git environment already created and volumes ending in *_db-sync-data and *_postgres-data are empty. If you are tring to sync DB-Sync then remove Postgres and db-sync-data volumes. Ogmios data will be fine.</p>
<p>If you have data in  *_db-sync-data and *_postgres-data, please remove the data. We need a fresh state for all of this to work. See <a href="https://github.com/input-output-hk/cardano-graphql/wiki/Docker#rebuild-cardano-db" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-graphql/wiki/Docker#rebuild-cardano-db</a> for help. (If you use CGQL only select postgres)</p>
<h2>1st</h2>
<p>Start Ogmios and let it sync up to 80-99% depending on what
snapshot you download (I suggest waiting until its at least 95%
synced).</p>
<pre><code>`Docker-compose up -d` then `Docker-compose down` finally
`docker-compose start cardano-node-ogmios`
</code></pre>
<p>This will only start Ogmios, wait a day or until you are at 70-90%.</p>
<h2>2nd</h2>
<p>Now we need to sync cardano-db-sync-extended. Go to the IOHK snapshot <a href="https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13/" rel="nofollow noreferrer">https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13/</a> (PS we are in folder 13/ right now, but look in 12/ folder for older snapshots) and choose the latest snapshot (if Ogmios is synced to 95%) or an older snapshot from folder 12/ if you are synced below 95%.</p>
<p>NOTE choosing a snapshot that is before that current sync point of Ogmios is fine, but getting a snapshot that is past Ogmios sync point will cause DB-Sync to delete any blocks past Ogmios sync point and can take a bit longer to delete then re-sync.</p>
<p>Syncing without a snapshot can take 3+ Days, I tried once and Ogmios was fully synced it took DB-sync 3 days to only get to ~70% and I have SSDs.</p>
<p>If you look at the Ogmios logs you should see one saying what slot &amp; block it is currently at:
<code>[3d54f2c4:cardano.node.ChainDB:Notice:2262] [2022-06-05 16:59:45.33 UTC] Chain extended, new tip: b57fbffcfccc13b56f0f869bf0b1dc699c4b020217ff9292d3504f56b83448bf at slot 62882094 {&quot;severity&quot;:&quot;Info&quot;,&quot;timestamp&quot;:&quot;2022-06-05T16:59:45.341328986Z&quot;,&quot;thread&quot;:&quot;3454&quot;,&quot;message&quot;:{&quot;Health&quot;:{&quot;tag&quot;:&quot;HealthTick&quot;,&quot;status&quot;:{&quot;startTime&quot;:&quot;2022-06-04T13:55:56.922570134Z&quot;,&quot;lastKnownTip&quot;:{&quot;slot&quot;:62882094,&quot;hash&quot;:&quot;b57fbffcfccc13b56f0f869bf0b1dc699c4b020217ff9292d3504f56b83448bf&quot;,&quot;blockNo&quot;:7337678},&quot;lastTipUpdate&quot;:&quot;2022-06-05T16:59:45.341113964Z&quot;,&quot;networkSynchronization&quot;:1.00000,&quot;currentEra&quot;:&quot;Alonzo&quot;,&quot;metrics&quot;:{&quot;sessionDurations&quot;:{&quot;max&quot;:0,&quot;min&quot;:0,&quot;mean&quot;:244854.64556962025},&quot;totalMessages&quot;:6957619,&quot;runtimeStats&quot;:{&quot;currentHeapSize&quot;:2551,&quot;maxHeapSize&quot;:10242,&quot;gcCpuTime&quot;:522927267999,&quot;cpuTime&quot;:5356749610627},&quot;activeConnections&quot;:5,&quot;totalUnrouted&quot;:0,&quot;totalConnections&quot;:84},&quot;connectionStatus&quot;:&quot;connected&quot;,&quot;currentEpoch&quot;:343,&quot;slotInEpoch&quot;:69294}}},&quot;version&quot;:&quot;v5.1.0&quot;} </code>
Which shows I am at Block: 7337678 and Blockchain Slot: 62882094
So I know I use the latest release &quot;db-sync-snapshot-schema-13-block-7334319-x86_64.tgz&quot; since 7337678 &gt; 7334319.</p>
<p>Now we need to start DB-Sync:</p>
<p>There are 2 ways to do this.</p>
<p>One way is to let db-sync download the file from IOHK but there is a chance that the download can become interrupted and will not finish or continue after. (easiest but may not work..)</p>
<p>The other way is to manually download the snapshot and edit docker-compose.yml to have DB-sync load it from a local file instead of downloading(suggested)</p>
<p><strong>Way 1 - not-recommended</strong></p>
<p><code>export NETWORK=mainnet &amp;&amp;\ RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/12/db-sync-snapshot-schema-12-block-6764999-x86_64.tgz \ docker-compose up -d &amp;&amp;\ docker-compose logs -f</code> Insert your snapshot link instead of mine.</p>
<p>Then wait ~2 hours and the download should be down and the system should start adding/altering tables in the DB-sync log.</p>
<p>If you see messages saying download was interrupted or stopped and it can not resume. Then try Way 2 and delete volumes *_postgres-data and .</p>
<p><a href="https://github.com/input-output-hk/cardano-graphql/wiki/Docker#rebuild-cardano-db" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-graphql/wiki/Docker#rebuild-cardano-db</a> for help on removing volumes</p>
<p><strong>Way 2 - Recommended</strong></p>
<p>Navigate to container folder, then create a &quot;snapshots&quot; directory and give it access to all users (777).</p>
<p>Now we download the snapshot to &quot;snapshots&quot; using wget:
<code> wget https://update-cardano-mainnet.iohk.io/cardano-db-sync/13/db-sync-snapshot-schema-13-block-7334319-x86_64.tgz</code></p>
<p>Next, we need to edit docker-compose.yml, look for &quot;cardano-db-sync-extended&quot; then the volumes should look like this:</p>
<pre><code>   volumes:
    - ./config/network/${NETWORK:-mainnet}:/config
    - db-sync-data:/var/lib/cdbsync
    - node-ipc:/node-ipc
    - db-sync-tmp:/tmp
    - ./snapshots:/snapshots
</code></pre>
<p>Finally at the bottom of Docker-compose.yml, look for and edit the Volumes array.
It should look like this:</p>
<pre><code>volumes:
  db-sync-data:
  node-db:
  node-ipc:
  postgres-data:
  db-sync-tmp:
</code></pre>
<p>Now we can start DB Sync and Postgres</p>
<p><code>export NETWORK=mainnet &amp;&amp; \ export RESTORE_SNAPSHOT=/snapshots/*FILE_NAME* &amp;&amp; \ docker-compose up -d</code></p>
<p>which will start Postgres, Hasura, DB-Sync, GraphQL and Ogmios (if not already running).</p>
<p>Let DB Sync run for a day or so then it should be down unpacking. If you see anything saying that DB-sync is rolling back to genesis and the amount of block to be deleted is &gt;2-5K then your snapshot was too far ahead and you need to wait for DB-sync to delete all those Blocks, before it uses to Hasura to continue syncing.</p>
<p>At this point, it might be worth it to restart the DB-sync process with older snapshot, But it is hard to say how long the deletion will take and depends on your system setup. If it is more than 5-10K of blocks that need to be deleted then I say re-start the DB-sync process with a older snapshot, or close DB-sync and wait for Ogmios to sync more.</p>
<p>GraphQL may come up with a fresh install after running the docker-compose up command from Github, but db-sync never fully syncs so it is never usable for me.</p>
<p>After DB-sync is done, if GraphQL port is still not online then restart the GraphQL module only and wait a day. <code>docker-compose restart cardano-graphql</code></p>
<p>the GraphQL port and interface should come up after 1-3 hrs after DB Sync is fully synced and Ogmios is around 99-100%</p>
<h2>Errors I saw</h2>
<p>`psql:/tmp/db-sync-snapshot-hc6bN9lE7U/db-sync-snapshot-schema-12-block-6451499-x86_64.sql:238416086: ERROR:  could not extend file &quot;base/16384/214298&quot;: No space left on device
HINT:  Check free disk space.</p>
<p>psql:/tmp/db-sync-snapshot-hc6bN9lE7U/db-sync-snapshot-schema-12-block-6451499-x86_64.sql:238416150: ERROR:  could not write block 35045 of temporary file: No space left on device
CONTEXT:  parallel worker`</p>
<p><a href="https://robferguson.org/blog/2022/02/19/getting-started-with-cardano-graphql/" rel="nofollow noreferrer">https://robferguson.org/blog/2022/02/19/getting-started-with-cardano-graphql/</a></p>
<p>Be carful using <code>docker image prune</code> since it could delete your Ogmios data and add an extra day or two to the whole sync process. But normally the Check Free disk Space error is because the system can not unzip the snapshot because of space limitations.</p>
<p>Even if you should have enough space, I found that sometimes I needed to delete all my volumes to get it to work.</p>
<h2>Background</h2>
<p>Ive been trying to get GraphQL to work for months now... I've tried on a few different servers over the months, but I just recently have been able to get it online.</p>
<p>Also make sure your system has the requirement to run the full stack (32GB Ram needed and SSDs strongly encouraged):
<a href="https://github.com/input-output-hk/cardano-graphql/releases" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-graphql/releases</a></p>
<p>Hope this helps and saves people some months like me XD</p>

CC BY-SA 4.0
2022-06-05T17:55:16.203Z
2022-06-05T17:55:16.203Z
yungtechboy1
<p>I am following the following guide to set up graphql on my M1 Mac. <a href="https://github.com/input-output-hk/cardano-graphql#overview" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-graphql#overview</a>. All the containers are up and running but i can't visit local host to play around with graphql.The containers i am running have a amd64 warning error. Is there a way to get past this warning ? Has anyone else been able to setup cardano-graphql on M1 Mac?</p>

<cardano-graphql><m1>
AMD64 Error Warning When Setting Up Grapgql Docker in Mac M1
# AMD64 Error Warning When Setting Up Grapgql Docker in Mac M1

(Asked by: username_0 on 2022-06-01)

I am following the following guide to set up graphql on my M1 Mac. <https://github.com/input-output-hk/cardano-graphql#overview>. All the containers are up and running but i can't visit local host to play around with graphql.The containers i am running have a amd64 warning error. Is there a way to get past this warning ? Has anyone else been able to setup cardano-graphql on M1 Mac?

**Tags:** cardano-graphql, m1

---

## 1 answers

### Answer by username_1 on 2022-06-05. Score: 1 | Accepted answer

Took me like 6+ Months to figure out all the requirements and what modules need to get loaded first...
This guide helped a lot https://robferguson.org/blog/2022/02/19/getting-started-with-cardano-graphql/
And he coverers building on mac.
These steps assume you have a docker GraphQL git environment already created and volumes ending in *_db-sync-data and *_postgres-data are empty. If you are tring to sync DB-Sync then remove Postgres and db-sync-data volumes. Ogmios data will be fine.
If you have data in  *_db-sync-data and *_postgres-data, please remove the data. We need a fresh state for all of this to work. See https://github.com/input-output-hk/cardano-graphql/wiki/Docker#rebuild-cardano-db for help. (If you use CGQL only select postgres)
1st
Start Ogmios and let it sync up to 80-99% depending on what
snapshot you download (I suggest waiting until its at least 95%
synced).
`Docker-compose up -d` then `Docker-compose down` finally
`docker-compose start cardano-node-ogmios`

This will only start Ogmios, wait a day or until you are at 70-90%.
2nd
Now we need to sync cardano-db-sync-extended. Go to the IOHK snapshot https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13/ (PS we are in folder 13/ right now, but look in 12/ folder for older snapshots) and choose the latest snapshot (if Ogmios is synced to 95%) or an older snapshot from folder 12/ if you are synced below 95%.
NOTE choosing a snapshot that is before that current sync point of Ogmios is fine, but getting a snapshot that is past Ogmios sync point will cause DB-Sync to delete any blocks past Ogmios sync point and can take a bit longer to delete then re-sync.
Syncing without a snapshot can take 3+ Days, I tried once and Ogmios was fully synced it took DB-sync 3 days to only get to ~70% and I have SSDs.
If you look at the Ogmios logs you should see one saying what slot & block it is currently at:
[3d54f2c4:cardano.node.ChainDB:Notice:2262] [2022-06-05 16:59:45.33 UTC] Chain extended, new tip: b57fbffcfccc13b56f0f869bf0b1dc699c4b020217ff9292d3504f56b83448bf at slot 62882094 {"severity":"Info","timestamp":"2022-06-05T16:59:45.341328986Z","thread":"3454","message":{"Health":{"tag":"HealthTick","status":{"startTime":"2022-06-04T13:55:56.922570134Z","lastKnownTip":{"slot":62882094,"hash":"b57fbffcfccc13b56f0f869bf0b1dc699c4b020217ff9292d3504f56b83448bf","blockNo":7337678},"lastTipUpdate":"2022-06-05T16:59:45.341113964Z","networkSynchronization":1.00000,"currentEra":"Alonzo","metrics":{"sessionDurations":{"max":0,"min":0,"mean":244854.64556962025},"totalMessages":6957619,"runtimeStats":{"currentHeapSize":2551,"maxHeapSize":10242,"gcCpuTime":522927267999,"cpuTime":5356749610627},"activeConnections":5,"totalUnrouted":0,"totalConnections":84},"connectionStatus":"connected","currentEpoch":343,"slotInEpoch":69294}}},"version":"v5.1.0"} 
Which shows I am at Block: 7337678 and Blockchain Slot: 62882094
So I know I use the latest release "db-sync-snapshot-schema-13-block-7334319-x86_64.tgz" since 7337678 > 7334319.
Now we need to start DB-Sync:
There are 2 ways to do this.
One way is to let db-sync download the file from IOHK but there is a chance that the download can become interrupted and will not finish or continue after. (easiest but may not work..)
The other way is to manually download the snapshot and edit docker-compose.yml to have DB-sync load it from a local file instead of downloading(suggested)
Way 1 - not-recommended
export NETWORK=mainnet &&\ RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/12/db-sync-snapshot-schema-12-block-6764999-x86_64.tgz \ docker-compose up -d &&\ docker-compose logs -f Insert your snapshot link instead of mine.
Then wait ~2 hours and the download should be down and the system should start adding/altering tables in the DB-sync log.
If you see messages saying download was interrupted or stopped and it can not resume. Then try Way 2 and delete volumes *_postgres-data and .
https://github.com/input-output-hk/cardano-graphql/wiki/Docker#rebuild-cardano-db for help on removing volumes
Way 2 - Recommended
Navigate to container folder, then create a "snapshots" directory and give it access to all users (777).
Now we download the snapshot to "snapshots" using wget:
 wget https://update-cardano-mainnet.iohk.io/cardano-db-sync/13/db-sync-snapshot-schema-13-block-7334319-x86_64.tgz
Next, we need to edit docker-compose.yml, look for "cardano-db-sync-extended" then the volumes should look like this:
   volumes:
    - ./config/network/${NETWORK:-mainnet}:/config
    - db-sync-data:/var/lib/cdbsync
    - node-ipc:/node-ipc
    - db-sync-tmp:/tmp
    - ./snapshots:/snapshots

Finally at the bottom of Docker-compose.yml, look for and edit the Volumes array.
It should look like this:
volumes:
  db-sync-data:
  node-db:
  node-ipc:
  postgres-data:
  db-sync-tmp:

Now we can start DB Sync and Postgres
export NETWORK=mainnet && \ export RESTORE_SNAPSHOT=/snapshots/*FILE_NAME* && \ docker-compose up -d
which will start Postgres, Hasura, DB-Sync, GraphQL and Ogmios (if not already running).
Let DB Sync run for a day or so then it should be down unpacking. If you see anything saying that DB-sync is rolling back to genesis and the amount of block to be deleted is >2-5K then your snapshot was too far ahead and you need to wait for DB-sync to delete all those Blocks, before it uses to Hasura to continue syncing.
At this point, it might be worth it to restart the DB-sync process with older snapshot, But it is hard to say how long the deletion will take and depends on your system setup. If it is more than 5-10K of blocks that need to be deleted then I say re-start the DB-sync process with a older snapshot, or close DB-sync and wait for Ogmios to sync more.
GraphQL may come up with a fresh install after running the docker-compose up command from Github, but db-sync never fully syncs so it is never usable for me.
After DB-sync is done, if GraphQL port is still not online then restart the GraphQL module only and wait a day. docker-compose restart cardano-graphql
the GraphQL port and interface should come up after 1-3 hrs after DB Sync is fully synced and Ogmios is around 99-100%
Errors I saw
`psql:/tmp/db-sync-snapshot-hc6bN9lE7U/db-sync-snapshot-schema-12-block-6451499-x86_64.sql:238416086: ERROR:  could not extend file "base/16384/214298": No space left on device
HINT:  Check free disk space.
psql:/tmp/db-sync-snapshot-hc6bN9lE7U/db-sync-snapshot-schema-12-block-6451499-x86_64.sql:238416150: ERROR:  could not write block 35045 of temporary file: No space left on device
CONTEXT:  parallel worker`
https://robferguson.org/blog/2022/02/19/getting-started-with-cardano-graphql/
Be carful using docker image prune since it could delete your Ogmios data and add an extra day or two to the whole sync process. But normally the Check Free disk Space error is because the system can not unzip the snapshot because of space limitations.
Even if you should have enough space, I found that sometimes I needed to delete all my volumes to get it to work.
Background
Ive been trying to get GraphQL to work for months now... I've tried on a few different servers over the months, but I just recently have been able to get it online.
Also make sure your system has the requirement to run the full stack (32GB Ram needed and SSDs strongly encouraged):
https://github.com/input-output-hk/cardano-graphql/releases
Hope this helps and saves people some months like me XD


---

