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

[INF-182] Fix hot reload of libs #3481

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions dev-tools/startup/build-audius-libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh

set -e

cat > strip_abi.js <<EOF
const fs = require("fs")
const abi = JSON.parse(fs.readFileSync(0, "utf-8"));
console.log(JSON.stringify({ contractName: abi.contractName, abi: abi.abi }));
EOF

for abi in ../data-contracts/ABIs/*; do
node strip_abi.js < "$abi" > data-contracts/ABIs/$(basename "$abi")
done

for abi in ../eth-contracts/ABIs/*; do
node strip_abi.js < "$abi" > eth-contracts/ABIs/$(basename "$abi")
done

cp scripts/AudiusClaimDistributor.json scripts/Wormhole.json eth-contracts/ABIs/

npx rollup -c -w
12 changes: 9 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,18 @@ services:

build-audius-libs:
build: libs
command: sh -c "cp scripts/AudiusClaimDistributor.json scripts/Wormhole.json eth-contracts/ABIs/"
command: sh /tmp/dev-tools/startup/build-audius-libs.sh
volumes:
- audius-libs:/usr/src/app
- poa-contracts-abis:/usr/src/app/data-contracts/ABIs
- eth-contracts-abis:/usr/src/app/eth-contracts/ABIs
- poa-contracts-abis:/usr/src/data-contracts/ABIs
- eth-contracts-abis:/usr/src/eth-contracts/ABIs
- ./libs/src:/usr/src/app/src
- ./dev-tools:/tmp/dev-tools
depends_on:
poa-ganache:
condition: service_started
eth-ganache:
condition: service_started
logging: *default-logging
deploy:
mode: global
Expand Down