Skip to content

Commit

Permalink
chore(ci): Lock cargo-pgrx to version 0.11.3 for postgres and binary …
Browse files Browse the repository at this point in the history
…builds (#21)
  • Loading branch information
Mercurial authored May 30, 2024
1 parent 46d0f4b commit d8691c4
Show file tree
Hide file tree
Showing 7 changed files with 3,399 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../dev.Dockerfile",
"dockerfile": "../docker/dev.Dockerfile",
"args": {
"UID": "1000",
"GID": "1000"
Expand Down
391 changes: 391 additions & 0 deletions data/latest_10k_blocks.csv

Large diffs are not rendered by default.

2,983 changes: 2,983 additions & 0 deletions data/latest_10k_transactions.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apt update && apt -y install \
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

RUN cargo install --locked cargo-pgrx && cargo pgrx init
RUN cargo install --locked cargo-pgrx@0.11.3 && cargo pgrx init

WORKDIR /source
COPY ./extension ./
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.postgres
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN apt update && apt -y install \
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

RUN cargo install --locked cargo-pgrx && cargo pgrx init --pg$PG_MAJOR /usr/lib/postgresql/$PG_MAJOR/bin/pg_config
RUN cargo install --locked cargo-pgrx@0.11.3 && cargo pgrx init --pg$PG_MAJOR /usr/lib/postgresql/$PG_MAJOR/bin/pg_config

WORKDIR /source
COPY ./extension ./extension
Expand Down
4 changes: 3 additions & 1 deletion docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ COPY ./extension ./
RUN sudo chown -R postgres:postgres /source
RUN su - postgres -c 'cd /source && cargo pgrx install'

COPY ./init-db.sh /docker-entrypoint-initdb.d/
COPY ./init-db.sh /docker-entrypoint-initdb.d/
COPY ./data/latest_10k_blocks.csv /data/latest_10k_blocks.csv
COPY ./data/latest_10k_transactions.csv /data/latest_10k_transactions.csv
24 changes: 19 additions & 5 deletions init-db.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
psql -d postgres -c 'CREATE EXTENSION IF NOT EXISTS mumak;'

# TEMPORARY DATA FOR TESTING
psql -d postgres -c 'CREATE TABLE transactions (body BYTEA);'
psql -d postgres <<EOF
-- Table for storing CBOR blocks
CREATE TABLE blocks (
slot INTEGER NOT NULL,
cbor BYTEA
);
psql -d postgres -c "INSERT INTO transactions (body) VALUES (E'\\\\x84AD009282582040E50EBF0DED25391F7DD13AD2D32A8EEF5A2CC76CC0E95B8BB2330C482DEF2F0082582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520082582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520282582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520382582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520482582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520582582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520682582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520782582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520882582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520982582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520A82582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520B82582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520C82582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520D82582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520E82582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520F82582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822521082582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F282252110182A300581D71071BD7F4B5E059EA90E763467CF559167B21C82EF1CB5FE34FB7A9E501821A030A32C0A3581C1CC1ACEAF5C7DF55E270864A60600B9F52383FE418164574FFDEEED0A14010581CC0E5564CF5786031D9053F567EC78B8383A0F2BC01318E690E0503F4A14001581CF66D78B4A3CB3D37AFA0EC36461E51ECBDE00F26C8F0A68F94B69880A144695553441B00000201D16E7CF2028201D818479F0000000000FF82583901DA299558C70A8970781806DCA93D1801BA2F3B3894227A7B284786E49BABA19195B7CB8B1C6FEBB192CC487B5E8B96D737BADDB8BB09866F1B000000015053786B021A0007A272031A07138899075820D36A2619A672494604E11BB447CBCF5231E9F2BA25C2169177EDC941BD50AD6C081A0713876D0B5820DE92CFE211ABE2B770D253FF364362E4281C96CE70C3048B104ACB5FC172EA900D8182582040E50EBF0DED25391F7DD13AD2D32A8EEF5A2CC76CC0E95B8BB2330C482DEF2F000E81581CDA299558C70A8970781806DCA93D1801BA2F3B3894227A7B284786E40F011082583901DA299558C70A8970781806DCA93D1801BA2F3B3894227A7B284786E49BABA19195B7CB8B1C6FEBB192CC487B5E8B96D737BADDB8BB09866F1B00000001502D541D111A002DC6C0128482582032536ACBFA12B80A3C570B1DAC7948187DFA66992460D11542F67BA357C0FD2C0082582083D52903A465B2CF0DBB0900C1D8A1E2DEC10578075CD7484B869A205F2822520182582089F6715FF7AFFD8BDEFF696F47D7A08BD899CC9C627483A8885F9FD3943286A100825820DB7900797BF9C1235976B226D0CDBE1040D199555158BFE2BC042575F142DA6100A30082825820F44CE6186D190F8776FD871D753DF7AE503972E4793A2360A423D2F96021E60158400B18E4FCF4BE17A531D3FD7A0320DF6BA7ACBFF31B35118275D7FF1CB3DE25523453C767AF39AC1F3B435749C44AF64ECBAF19AE1E23A7B4AB9C7939D653A90182582063179F731829D60AADE12A1398C07B7A905CC38E7D9901850C9B186946F5CA3E58403B3932C709D9A355F8A0BB453D2722F39F82A16BB7669669F11698CACC825CE2A74B26AA31F3740A8A820829BFDA3F6F3F4BBCE1F045707D037DF0085273A50004800591840001D87980821A001AAF3E1A315977A684000AD87980821A00011EFA1A01C4794F840006D87980821A00011EFA1A01C4794F840004D87980821A00011EFA1A01C4794F840002D87980821A00011EFA1A01C4794F840003D87980821A00011EFA1A01C4794F840005D87980821A00011EFA1A01C4794F840008D87980821A00011EFA1A01C4794F840007D87980821A00011EFA1A01C4794F840009D87980821A00011EFA1A01C4794F84000ED87980821A00011EFA1A01C4794F84000CD87980821A00011EFA1A01C4794F84000BD87980821A00011EFA1A01C4794F84000DD87980821A00011EFA1A01C4794F840010D87980821A00011EFA1A01C4794F84000FD87980821A00011EFA1A01C4794F840011D87980821A00011EFA1A01C4794FF5A0');"
-- Index for the blocks table
CREATE INDEX idx_blocks_slot ON blocks(slot);
psql -d postgres -c "INSERT INTO transactions (body) VALUES (E'\\\\x84A40082825820A028675D79197A5A0EC505325B43A0C280B95D131A57F83CB52D8E2863397001018258207EE928016527BED2498F6145894B36F67D01285A5598CA62106D78E8959364B501018282582B82D818582183581CDCFAC754F15B77A483FAC62214E63F11621050E2CCC47A58D9463E81A0001A3CF8B9AF1A07BEF9C182581D616904E8B2C26F3DDA6C4A5DB4B3EC9E31D581C9960977CFE9C6917A431A00517415021A0002E471031A07139582A100828258200D197B7EEEF1B961962A2911D4B553F0D9C3114B8D3E61DE3BEB4F39DC348EB058402D53C022C86BCC8802260329E0D3844E52D590478F4E2DB68A85CE6E1CED1D2013AD318ED29D76D4A0822E36E6446ED621D1F0B5480D6B241E57F733FD03F900825820393B3D3CAB6BE0897CBC87143CC3A24825DC1D8249DF4D37969502931CF856FF5840A3DDEC97CFC523051B025EF11E1CDEC85BB9FE290EF657C06F1085414D3916285ADBAAAC540D541ECA39160588926C26975B4D0041E51D671C44513C38410403F5F6');"
-- Table for storing CBOR transactions
CREATE TABLE txs (
slot INTEGER NOT NULL,
cbor BYTEA
);
psql -d postgres -c "INSERT INTO transactions (body) VALUES (E'\\\\x84A600828258200ED8AC469B53B2B248BD5774251C79622075206F30D98440327442BD6E5D77B400825820AB2E6163D69BE2ACC56DD57AB59EC33DC3531899C73EC6371987929D6BCF327205018383583911A65CA58A4E9C755FA830173D2A5CAED458AC0C73F97DB7FAAE2E7E3B52563C5410BFF6A0D43CCEBB7C37E1F69F5EB260552521ADFF33B9C2821A003D0900A1581CDEFE216460D594211631FCFBD354F361C04645D6A0CFEEAD3D6F6283A14B6C657676797769666861741920C75820F9464C0C1E1C1D2A8BC2CFCA57361C388BF2E5DC5B9D77BF2EF2DA05830AF3A4825839010E6B79819AE9EE26BB34389EC7276F2E26C2CA28F8B343E5E9583019F84DDCAD45B332DC44A0E44A63B89320C8B955F37E163EBD9F2F86B01A0BACBCEB825839010E6B79819AE9EE26BB34389EC7276F2E26C2CA28F8B343E5E9583019F84DDCAD45B332DC44A0E44A63B89320C8B955F37E163EBD9F2F86B0821A002EA0AEA7581CD6E3AE03A94C9748189F41E9D180F91E971F18909EA52559C977C259A74B6D65746150584C37313435014B6D65746150584C37313837014B6D65746150584C37323039014B6D65746150584C37333133014B6D65746150584C37343937014B6D65746150584C37373034014B6D65746150584C3738303201581CD894897411707EFA755A76DEB66D26DFD50593F2E70863E1661E98A0A14A7370616365636F696E7303581CD925606BC640B2C51704FA907CD47A0486FC235115777E5E004831FAA15154696D655261706964734163696469747901581CDC8BFE53D4E3E29C143322EDFFC0ED08169B8745111CF463B7B539E0A251464C61777765643143524F5733303030320153464C61777765643150494E484541443030313101581CDCD679B44C93D1613639D95AF123B04C96DE062AC702DAD3400254ABA24B4379626572583038343637014B437962657258303930333601581CDDED27E88A57900BA5597E548D2B90C6F245C33CF9705D24A99A79FFA14F4D45454E534C4F434B444F574E383601581CE26A51E521B20ACB44C84F4D464813E0AC1EE8A39CC2F190FF42C8C4A54A54686973576179323835014A54686973576179333130014A54686973576179333137014A54686973576179363636014A5468697357617937383701021A00033861031A0713B197075820B64602EEBF602E8BBCE198E2A1D6BBB2A109AE87FA5316135D217110D6D946490B58200DB5F1D2D28689CCF278A4D35A67919A37A476DC0BA99E3B3BCD48F11A17363CA2008182582085C2C81F24BDAD786CC57A8869AD1743D2D6C9B02A955DC609A9698742C41B9C584023FBC4F2FD445BDD3AAF5124A5F2FA56A2CAD79058B2CCD0B79DC96ADB6D868ADEA121EC00C9BE48A01B1AD214A9F111D76F7C7DBC359CC45520FF27B60B1607049FD8799FD8799FD8799F581C0E6B79819AE9EE26BB34389EC7276F2E26C2CA28F8B343E5E9583019FFD8799FD8799FD8799F581CF84DDCAD45B332DC44A0E44A63B89320C8B955F37E163EBD9F2F86B0FFFFFFFFD8799FD8799F581C0E6B79819AE9EE26BB34389EC7276F2E26C2CA28F8B343E5E9583019FFD8799FD8799FD8799F581CF84DDCAD45B332DC44A0E44A63B89320C8B955F37E163EBD9F2F86B0FFFFFFFFD87A80D8799FD8799F4040FF1A00DC7F53FF1A001E84801A001E8480FFFFF5A11902A2A1636D736781781C4D696E737761703A205377617020457861637420496E204F72646572');"
-- Index for the txs table
CREATE INDEX idx_txs_slot ON txs(slot);
EOF

psql -d postgres -c "\COPY blocks FROM '/data/latest_10k_blocks.csv' WITH (FORMAT csv, HEADER true);"
psql -d postgres -c "\COPY txs FROM '/data/latest_10k_transactions.csv' WITH (FORMAT csv, HEADER true);"

psql -d postgres -c 'CREATE TABLE utxos (hash BYTEA, output_index INTEGER, slot INTEGER, era INTEGER, body BYTEA);'
psql -d postgres -c "INSERT INTO utxos (hash, output_index, slot, era, body) VALUES(E'\\\\xa30',0,0, 5, E'\\\\xa300581d7161b3802ce748ed1fdaad2d6c744b19f104285f7d318172a5d4f06a4e01821a001ab364a1581cc27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34ca144434e43541b0000001369fb413e028201d8185899d8799f9fd8799f1a9a7ec800d8799f0118c8ffffd8799f1b00000001cf7c5800d8799f0518c8ffffd8799f1b000000039ef8b000d8799f0f18c8ffffd8799f1b000000073df16000d8799f182818c8ffffff581cc27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34c44434e4354d8799f581c63ea9fddc8d7d0dc87c7eef00df01c6e01c028b461c1b62c82aa9e37ff00ff');"
Expand Down

0 comments on commit d8691c4

Please sign in to comment.