Skip to content

Commit

Permalink
feat: add lbc deployer image
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisfc68 committed Jan 7, 2025
1 parent 296fb3e commit 981ef34
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:20.15.1@sha256:6326b52a508f0d99ffdbfaa29a69380321b215153db6f32974835bac71b38fa4

RUN apt-get update -y && \
apt-get install -y -qq --no-install-recommends jq && \
apt-get clean

USER node

WORKDIR /home/node

COPY --chown=node:node package.json \
package-lock.json \
deploy.sh \
.solhint.json \
hardhat.config.ts \
tsconfig.json \
addresses.json ./

RUN npm ci --ignore-scripts

COPY --chown=node:node tasks ./tasks
COPY --chown=node:node scripts ./scripts
COPY --chown=node:node contracts ./contracts

RUN npm run compile

ENTRYPOINT [ "./deploy.sh" ]
9 changes: 9 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

npm config set //npm.pkg.github.com/:_authToken "$GITHUB_TOKEN"

npx hardhat run scripts/deployment/deploy-lbc.ts --network "$NETWORK_NAME"
npx hardhat run scripts/deployment/upgrade-lbc.ts --network "$NETWORK_NAME"

LBC_ADDRESS=$(jq -r '.rskRegtest.LiquidityBridgeContract.address' ./addresses.json)
echo "LBC_ADDRESS=$LBC_ADDRESS"
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MAINNET_RPC_URL=https://public-node.rsk.co
TESTNET_RPC_URL=https://public-node.testnet.rsk.co
REGTEST_RPC_URL=http://localhost:4444
MAINNET_SIGNER_PRIVATE_KEY=<private_key>
TESTNET_SIGNER_PRIVATE_KEY=<private_key>
DEV_SIGNER_PRIVATE_KEY=<private_key>
Expand Down
3 changes: 2 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dotenv.config();
const {
MAINNET_RPC_URL,
TESTNET_RPC_URL,
REGTEST_RPC_URL,
MAINNET_SIGNER_PRIVATE_KEY,
MAINNET_MNEMONIC,
TESTNET_SIGNER_PRIVATE_KEY,
Expand All @@ -30,7 +31,7 @@ const rpcDefaultTimeout = 3 * 60 * 1000; // 3 minutes
const config: HardhatUserConfig = {
networks: {
rskRegtest: {
url: "http://localhost:4444",
url: REGTEST_RPC_URL ?? "http://localhost:4444",
chainId: 33,
},
rskDevelopment: {
Expand Down

0 comments on commit 981ef34

Please sign in to comment.