-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from BoltzExchange/rif
RIF relay
- Loading branch information
Showing
9 changed files
with
152 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
ARG NODE_VERSION=lts-bookworm-slim | ||
|
||
FROM node:${NODE_VERSION} AS builder | ||
|
||
RUN git clone https://github.com/rsksmart/rif-relay-contracts.git | ||
|
||
WORKDIR /rif-relay-contracts | ||
|
||
RUN git checkout 59b67d6ccd901f8e2320e3aea5a5fc937956f34b | ||
COPY contracts.patch . | ||
RUN git apply contracts.patch | ||
|
||
RUN npm ci | ||
|
||
WORKDIR / | ||
RUN git clone https://github.com/rsksmart/rif-relay-server.git | ||
|
||
WORKDIR /rif-relay-server | ||
|
||
RUN git checkout a4807e557d8205ab285b8891cef58e8b5fb2994a | ||
COPY server.patch . | ||
RUN git apply server.patch | ||
|
||
RUN npm ci | ||
|
||
COPY start.sh / | ||
|
||
ENTRYPOINT ["/bin/bash", "/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/hardhat.config.ts b/hardhat.config.ts | ||
index 0115432..162c704 100644 | ||
--- a/hardhat.config.ts | ||
+++ b/hardhat.config.ts | ||
@@ -54,7 +54,7 @@ if (PK) { | ||
sharedNetworkConfig.accounts = [PK]; | ||
} else { | ||
sharedNetworkConfig.accounts = { | ||
- mnemonic: MNEMONIC || DEFAULT_MNEMONIC, | ||
+ mnemonic: 'test test test test test test test test test test test junk' || MNEMONIC || DEFAULT_MNEMONIC, | ||
}; | ||
} | ||
|
||
@@ -79,7 +79,7 @@ const config: HardhatUserConfig = { | ||
}, | ||
networks: { | ||
regtest: { | ||
- url: 'http://localhost:4444', | ||
+ url: 'http://anvil:8545', | ||
chainId: 33, | ||
}, | ||
testnet: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
diff --git a/config/default.json5 b/config/default.json5 | ||
index b2d355c..52ec78b 100644 | ||
--- a/config/default.json5 | ||
+++ b/config/default.json5 | ||
@@ -5,12 +5,12 @@ | ||
Server | ||
*/ | ||
app: { | ||
- url: "http://127.0.0.1", // URL where the relay server will be deployed, it could be localhost or the IP of the host machine. | ||
+ url: "http://127.0.0.1:8090", // URL where the relay server will be deployed, it could be localhost or the IP of the host machine. | ||
port: 8090, // port where the relay server will be hosted. | ||
devMode: false, // indicates to the server if we are in development mode or not. | ||
customReplenish: false, // set if the server uses a custom replenish function or not. | ||
|
||
- logLevel: 4 /* The log level for the relay server. Available levels: | ||
+ logLevel: 1 /* The log level for the relay server. Available levels: | ||
{ | ||
TRACE: 0; | ||
DEBUG: 1; | ||
@@ -58,7 +58,7 @@ | ||
Blockchain node | ||
*/ | ||
blockchain: { | ||
- rskNodeUrl: "http://127.0.0.1:4444", // RSK node endpoint URL, where the RSK node is located. | ||
+ rskNodeUrl: "http://anvil:8545", // RSK node endpoint URL, where the RSK node is located. | ||
gasPriceFactor: 1, | ||
alertedBlockDelay: 0, | ||
minAlertedDelayMS: 0, | ||
@@ -85,9 +85,9 @@ | ||
Relay contracts addresses | ||
*/ | ||
contracts: { | ||
- relayHubAddress: "0x0000000000000000000000000000000000000000", // relay hub contract address, you can retrieve this from the contract summary. | ||
- relayVerifierAddress: "0x0000000000000000000000000000000000000000", // relay verifier contract address, you can retrieve this from the contract summary. | ||
- deployVerifierAddress: "0x0000000000000000000000000000000000000000", // deploy verifier contract address, you can retrieve this from the contract summary. | ||
+ relayHubAddress: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", // relay hub contract address, you can retrieve this from the contract summary. | ||
+ relayVerifierAddress: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", // relay verifier contract address, you can retrieve this from the contract summary. | ||
+ deployVerifierAddress: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", // deploy verifier contract address, you can retrieve this from the contract summary. | ||
feesReceiver: "0x0000000000000000000000000000000000000000", | ||
trustedVerifiers: [], | ||
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
register_relay() { | ||
# We can sleep for a while; this can happen in the background | ||
sleep 15 | ||
cd /rif-relay-server | ||
npm run register | ||
} | ||
|
||
cd /rif-relay-contracts | ||
npx hardhat deploy --network regtest | ||
|
||
cd /rif-relay-server | ||
|
||
register_relay & | ||
npm run start |