Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: store inscription data in postgres instead of sqlite #375

Merged
merged 60 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a314cd6
chore: new pg lib
rafaelcr Nov 12, 2024
b3e50b8
chore: migrations and connection code
rafaelcr Nov 12, 2024
1a45c1a
brc20 migrations
rafaelcr Nov 12, 2024
d44f597
connection opts
rafaelcr Nov 12, 2024
21d2c37
fixed columns
rafaelcr Nov 13, 2024
efbb1e0
vscode configs
rafaelcr Nov 13, 2024
e3ce7e6
transaction utils
rafaelcr Nov 13, 2024
f093630
chain tip integration
rafaelcr Nov 13, 2024
2f217aa
more progress
rafaelcr Nov 14, 2024
40e1bd3
progress
rafaelcr Nov 14, 2024
e03a440
models
rafaelcr Nov 14, 2024
86bb137
brc20 progress
rafaelcr Nov 15, 2024
891fb39
progress
rafaelcr Nov 15, 2024
a8c9ca5
more
rafaelcr Nov 16, 2024
7bfbaf5
utils
rafaelcr Nov 16, 2024
5dfddf9
models and isnerts
rafaelcr Nov 18, 2024
c5844d6
some more inserts
rafaelcr Nov 18, 2024
38d2a8a
ordering support
rafaelcr Nov 18, 2024
332c004
remove extra code
rafaelcr Nov 19, 2024
9107300
organize
rafaelcr Nov 19, 2024
155e249
deadpool
rafaelcr Nov 19, 2024
bd49a89
chain tip
rafaelcr Nov 20, 2024
311b998
counts
rafaelcr Nov 20, 2024
0f00f24
optimize transfers table
rafaelcr Nov 20, 2024
03df2ee
optimize reinscriptions
rafaelcr Nov 20, 2024
fc68172
transfers in same block
rafaelcr Nov 20, 2024
151d3ad
drop blocks structure
rafaelcr Nov 21, 2024
7d057cd
brc20 counts
rafaelcr Nov 22, 2024
d83f93b
token minted supplies
rafaelcr Nov 22, 2024
5117316
brc20 insert chunks
rafaelcr Nov 25, 2024
4662b8b
brc20 tweaks
rafaelcr Nov 25, 2024
0af93b7
tweaks
rafaelcr Nov 25, 2024
d21fe7c
rollback progress
rafaelcr Nov 26, 2024
e849292
restore tests
rafaelcr Nov 26, 2024
f6b6e95
fix brc20 tests
rafaelcr Nov 26, 2024
c2e9119
cache tests
rafaelcr Nov 26, 2024
343dd6f
brc20 db tests
rafaelcr Nov 26, 2024
78b73dd
pg docker compose
rafaelcr Nov 27, 2024
4ccc0c4
fix: pg path
rafaelcr Nov 27, 2024
8dfd4b8
fix: dockerfile
rafaelcr Nov 27, 2024
0a0ba6b
test: inscr write
rafaelcr Nov 27, 2024
bcf059c
test: rollbacks
rafaelcr Nov 27, 2024
5945058
fix: token minted supply rollback
rafaelcr Nov 27, 2024
9e059c2
fix: ordinals rollback
rafaelcr Dec 3, 2024
aa43444
chore: upgrade rust
rafaelcr Dec 3, 2024
280b470
fix: share rocksdb conn across threads
rafaelcr Dec 4, 2024
4050d9a
chore: search path support
rafaelcr Dec 4, 2024
9a8b2c7
chore: logs cleanup
rafaelcr Dec 4, 2024
0a00a7e
chore: re-enable seq cursor tests
rafaelcr Dec 4, 2024
d5524d4
fix: wire up rollbacks
rafaelcr Dec 4, 2024
4123eb6
fix: brc20 decimal conversion
rafaelcr Dec 4, 2024
9b4e537
fix: recursion parsing
rafaelcr Dec 5, 2024
c27399e
fix: remove 0x from binary content
rafaelcr Dec 5, 2024
b629044
fix: inscription content fixed for real this time
rafaelcr Dec 5, 2024
28d371a
fix: remove null bytes before inserting
rafaelcr Dec 8, 2024
f31b0b2
chore: delete http api
rafaelcr Dec 20, 2024
93a8020
fix: new pg methods
rafaelcr Dec 21, 2024
32c3ea0
fix: all tests
rafaelcr Dec 21, 2024
b884650
chore: add pool size config, remove http config
rafaelcr Dec 21, 2024
a0b9820
style: comments
rafaelcr Jan 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup integration environment
run: |
sudo ufw disable
docker compose -f ../../dockerfiles/docker-compose.dev.postgres.yml up -d
docker compose -f ../../dockerfiles/docker-compose.dev.postgres.yml logs -t -f --no-color &> docker-compose-logs.txt &

- name: Update Rust
run: |
rustup update
Expand All @@ -59,6 +65,14 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
slug: hirosystems/ordhook

- name: Print integration environment logs
run: cat docker-compose-logs.txt
if: failure()

- name: Teardown integration environment
run: docker compose -f ../../dockerfiles/docker-compose.dev.postgres.yml down -v -t 0
if: always()

build-publish:
runs-on: ubuntu-latest
needs: test
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ components/chainhook-types-js/dist
*.tar.gz
*.zip
*.rdb
Ordhook.toml
/Ordhook.toml

cache/
./tests
Expand Down
65 changes: 65 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'chainhook-postgres'",
"cargo": {
"args": ["test", "--no-run", "--lib", "--package=chainhook-postgres"],
"filter": {
"name": "chainhook-postgres",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "run: ordhook service",
"cargo": {
"args": ["build", "--bin=ordhook", "--package=ordhook-cli"],
"filter": {
"name": "ordhook",
"kind": "bin"
}
},
"args": [
"service",
"start",
"--config-path=${workspaceFolder}/.vscode/ordhook.toml",
],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'ordhook'",
"cargo": {
"args": ["test", "--no-run", "--bin=ordhook", "--package=ordhook-cli"],
"filter": {
"name": "ordhook",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'ordhook'",
"cargo": {
"args": ["test", "--no-run", "--lib", "--package=ordhook"],
"filter": {
"name": "ordhook",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
46 changes: 46 additions & 0 deletions .vscode/ordhook.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[storage]
working_dir = "tmp"
observers_working_dir = "tmp"

[ordinals_db]
database = "ordinals"
host = "localhost"
port = 5432
username = "postgres"
password = "postgres"

[brc20_db]
database = "brc20"
host = "localhost"
port = 5432
username = "postgres"
password = "postgres"

# The Http Api allows you to register / deregister
# dynamically predicates.
# Disable by default.
#
# [http_api]
# http_port = 20456

[network]
mode = "mainnet"
bitcoind_rpc_url = "http://localhost:8332"
bitcoind_rpc_username = "rafaelcr"
bitcoind_rpc_password = "developer"
bitcoind_zmq_url = "tcp://0.0.0.0:18543"

[resources]
ulimit = 2048
cpu_core_available = 6
memory_available = 16
bitcoind_rpc_threads = 2
bitcoind_rpc_timeout = 15
expected_observers_count = 1

[logs]
ordinals_internals = true
chainhook_internals = true

[meta_protocols]
brc20 = true
Loading
Loading