forked from NibiruChain/nibiru
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
80 lines (64 loc) · 1.65 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
# Displays available recipes by running `just -l`.
setup:
#!/usr/bin/env bash
just -l
# Locally install the `nibid` binary and build if needed.
install:
go mod tidy
make install
install-clean:
rm -rf temp
just install
# Build the `nibid` binary.
build:
make build
alias b := build
# Generate protobuf code (Golang) for Nibiru
proto-gen:
#!/usr/bin/env bash
make proto-gen
alias proto := proto-gen
# Build protobuf types (Rust)
proto-rs:
bash proto/buf.gen.rs.sh
lint:
#!/usr/bin/env bash
source contrib/bashlib.sh
if ! which_ok golangci-lint; then
log_info "Installing golangci-lint"
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
fi
golangci-lint run --allow-parallel-runners --fix
# Runs a Nibiru local network. Ex: "just localnet --features perp spot"
localnet *PASS_FLAGS:
make localnet FLAGS="{{PASS_FLAGS}}"
# Test: "localnet.sh" script
test-localnet:
#!/usr/bin/env bash
source contrib/bashlib.sh
just install
bash contrib/scripts/localnet.sh &
log_info "Sleeping for 6 seconds to give network time to spin up and run a few blocks."
sleep 6
kill $(pgrep -x nibid) # Stops network running as background process.
log_success "Spun up localnet"
# Test: "chaosnet.sh" script
test-chaosnet:
#!/usr/bin/env bash
source contrib/bashlib.sh
which_ok nibid
bash contrib/scripts/chaosnet.sh
# Runs golang formatter (gofumpt)
fmt:
gofumpt -w x app
# Format and lint
tidy:
#!/usr/bin/env bash
go mod tidy
just proto-gen
just lint
just fmt
test-release:
make release-snapshot
release-publish:
make release