-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
justfile
145 lines (116 loc) Β· 3.68 KB
/
justfile
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
set positional-arguments
watch +args='test':
cargo watch --clear --exec '{{args}}'
ci: clippy forbid
cargo fmt -- --check
cargo test --all
forbid:
./bin/forbid
fmt:
cargo fmt
clippy:
cargo clippy --all --all-targets
deploy branch chain domain:
ssh root@{{domain}} "mkdir -p deploy \
&& apt-get update --yes \
&& apt-get upgrade --yes \
&& apt-get install --yes git rsync"
rsync -avz deploy/checkout root@{{domain}}:deploy/checkout
ssh root@{{domain}} 'cd deploy && ./checkout {{branch}} {{chain}} {{domain}}'
deploy-mainnet: (deploy "master" "main" "ordinals.com")
deploy-signet branch="master": (deploy branch "signet" "signet.ordinals.com")
log unit="ord" domain="ordinals.com":
ssh root@{{domain}} 'journalctl -fu {{unit}}'
test-deploy:
ssh-keygen -f ~/.ssh/known_hosts -R 192.168.56.4
vagrant up
ssh-keyscan 192.168.56.4 >> ~/.ssh/known_hosts
rsync -avz \
--delete \
--exclude .git \
--exclude target \
--exclude .vagrant \
--exclude index.redb \
. root@192.168.56.4:ord
ssh root@192.168.56.4 'cd ord && ./deploy/setup'
time-tests:
cargo +nightly test -- -Z unstable-options --report-time
profile-tests:
cargo +nightly test -- -Z unstable-options --report-time \
| sed -n 's/^test \(.*\) ... ok <\(.*\)s>/\2 \1/p' | sort -n \
| tee test-times.txt
open:
open http://localhost
doc:
cargo doc --all --open
update-dev-server:
./bin/update-dev-server
start-dev-server-benchmark: && update-dev-server
systemctl stop ord-dev
rm /var/lib/ord-dev/index.redb
journalctl --rotate
journalctl --vacuum-time 1s
./bin/update-dev-server
# publish current GitHub master branch
publish:
#!/usr/bin/env bash
set -euxo pipefail
rm -rf tmp/release
git clone git@github.com:casey/ord.git tmp/release
cd tmp/release
VERSION=`sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1`
git tag -a $VERSION -m "Release $VERSION"
git push origin $VERSION
cargo publish
cd ../..
rm -rf tmp/release
list-outdated-dependencies:
cargo outdated -R
cd test-bitcoincore-rpc && cargo outdated -R
update-modern-normalize:
curl \
https://raw.githubusercontent.com/sindresorhus/modern-normalize/main/modern-normalize.css \
> static/modern-normalize.css
download-log unit='ord' host='ordinals.com':
ssh root@{{host}} 'mkdir -p tmp && journalctl -u {{unit}} > tmp/{{unit}}.log'
rsync --progress --compress root@{{host}}:tmp/{{unit}}.log tmp/{{unit}}.log
download-index unit='ord' host='ordinals.com':
rsync --progress --compress root@{{host}}:/var/lib/{{unit}}/index.redb tmp/{{unit}}.index.redb
graph log:
./bin/graph $1
flamegraph dir=`git branch --show-current`:
./bin/flamegraph $1
benchmark index height-limit:
./bin/benchmark $1 $2
benchmark-revision rev:
ssh root@ordinals.com "mkdir -p benchmark \
&& apt-get update --yes \
&& apt-get upgrade --yes \
&& apt-get install --yes git rsync"
rsync -avz benchmark/checkout root@ordinals.com:benchmark/checkout
ssh root@ordinals.com 'cd benchmark && ./checkout {{rev}}'
build-snapshots:
#!/usr/bin/env bash
set -euxo pipefail
rm -rf tmp/snapshots
mkdir -p tmp/snapshots
cargo build --release
cp ./target/release/ord tmp/snapshots
cd tmp/snapshots
for start in {0..750000..50000}; do
height_limit=$((start+50000))
if [[ -f $start.redb ]]; then
cp -c $start.redb index.redb
fi
a=`date +%s`
time ./ord --data-dir . --height-limit $height_limit index
b=`date +%s`
mv index.redb $height_limit.redb
printf "$height_limit\t$((b - a))\n" >> time.txt
done
serve-docs:
mdbook serve docs --open
build-docs:
mdbook build docs
update-changelog:
git log --pretty='format:- %s' >> CHANGELOG.md