Skip to content

Commit

Permalink
Merge branch 'staging' of github.com:hop-protocol/hop into production
Browse files Browse the repository at this point in the history
  • Loading branch information
shanefontaine committed May 19, 2024
2 parents a9a2965 + d106bba commit bdbc399
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 12 deletions.
15 changes: 11 additions & 4 deletions ops/webhooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ Set up a webhook [on GitHub](https://github.com/hop-protocol/hop/settings/hooks)

### On the server

Ensure port `4665` can accept incoming requests.

- Set the `DOCKER_IMAGE_NAME` and `WEBHOOK_SECRET` envs in `~/.bashrc` and source it.
- Add the scripts in this repo to the server.
- Set up the environment
- Set the `DOCKER_IMAGE_NAME` and `WEBHOOK_SECRET` envs in `~/.bashrc` and source it.
- Ensure port `4665` can accept incoming requests.
- Installation
- Add the appropriate files from this directory to the server and make them executable with `chmod +x`
- Run `./install_webhook_server.sh`
- Run `/.install-_dependencies.sh`
- Run the webhook server in the background with `./run_webhook_server.sh &`

Ensure that you have a `docker.sh` executable file in the directly where these files are being executed.

To stop the webhook server, run `./stop_webhook_server.sh`.
30 changes: 30 additions & 0 deletions ops/webhooks/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Function to install jq
install_jq() {
if command -v jq > /dev/null 2>&1; then
echo "jq is already installed."
return
fi

# Detect package manager and install jq
if command -v apt > /dev/null 2>&1; then
echo "Using apt to install jq..."
sudo apt update
sudo apt install -y jq
elif command -v dnf > /dev/null 2>&1; then
echo "Using dnf to install jq..."
sudo dnf install -y jq
elif command -v yum > /dev/null 2>&1; then
echo "Using yum to install jq..."
sudo yum install -y jq
else
echo "Package manager not supported. Please install jq manually."
exit 1
fi

echo "jq installation complete."
}

# Call the install function
install_jq
16 changes: 16 additions & 0 deletions ops/webhooks/stop_webook_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Port number to check
PORT=4665

# Find process using the port and get its PID
pid=$(lsof -t -i:$PORT)

# Check if any process was found
if [ -z "$pid" ]; then
echo "No process is using port $PORT."
else
echo "Process $pid is using port $PORT. Killing it..."
kill $pid
echo "Process killed."
fi
33 changes: 32 additions & 1 deletion packages/frontend/src/config/blocklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,36 @@ export const blocklist = blocklistEnabled ? [
'0x5a14e72060c11313e38738009254a90968f58f51',
'0xefe301d259f525ca1ba74a7977b80d5b060b3cca',
'0x39d908dac893cbcb53cc86e0ecc369aa4def1a29',
'0x4ea83653ecea38b51730c14776698e19f5ca6e65'
'0x4f47bc496083c727c5fbe3ce9cdf2b0f6496270c',
'0x38735f03b30FbC022DdD06ABED01F0Ca823C6a94',
'0x97b1043abd9e6fc31681635166d430a458d14f9c',
'0xb6f5ec1a0a9cd1526536d3f0426c429529471f40',
'0xdcbEfFBECcE100cCE9E4b153C4e15cB885643193',
'0x5f48c2a71b2cc96e3f0ccae4e39318ff0dc375b2',
'0x5a7a51bfb49f190e5a6060a5bc6052ac14a3b59f',
'0xed6e0a7e4ac94d976eebfb82ccf777a3c6bad921',
'0x797d7ae72ebddcdea2a346c1834e04d1f8df102b',
'0x931546D9e66836AbF687d2bc64B30407bAc8C568',
'0x43fa21d92141BA9db43052492E0DeEE5aa5f0A93',
'0x6be0ae71e6c41f2f9d0d1a3b8d0f75e6f6a0b46e',
'0x9c2bc757b66f24d60f016b6237f8cdd414a879fa',
'0x530a64c0ce595026a4a556b703644228179e2d57',
'0xfac583c0cf07ea434052c49115a4682172ab6b4f',
'0x961c5be54a2ffc17cf4cb021d863c42dacd47fc1',
'0x983a81ca6fb1e441266d2fbcb7d8e530ac2e05a2',
'0xf3701f445b6bdafedbca97d1e477357839e4120d',
'0xe950dc316b836e4eefb8308bf32bf7c72a1358ff',
'0x21b8d56bda776bbe68655a16895afd96f5534fed',
'0x175d44451403edf28469df03a9280c1197adb92c',
'0x19f8f2b0915daa12a3f5c9cf01df9e24d53794f7',
'0x4ea83653ecea38b51730c14776698e19f5ca6e65',
'0xae4a7cde7c99fb98b0d5fa414aa40f0300531f43',
'0x4ab93fc50b82d4dc457db85888dfdae28d29b98d',
'0x02fa2625825917e9b1f8346a465de1bbc150c5b9',
'0xbd18100a168321701955e348f03d0df4f517c13b',
'0x7e97b74252b6df53caf386fb4c54d4fb59cb6928',
'0xae4a7cde7c99fb98b0d5fa414aa40f0300531f43',
'0x9f09ec563222fe52712dc413d0b7b66cb5c7c795',
'0x5d0d99e9886581ff8fcb01f35804317f5ed80bbb',
'0x6277ab36a67cfb5535b02ee95c835a5eec554c07'
] : []
2 changes: 0 additions & 2 deletions packages/frontend/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ if (process.env.REACT_APP_NETWORK === 'goerli') {
showRewards = false
}

const cacheBuster: number = 15

export { showRewards }

export const transferTimes = {
Expand Down
1 change: 0 additions & 1 deletion packages/hop-node/src/types/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export class BonderFeeTooLowError extends Error {}
export class RelayerFeeTooLowError extends Error {}
export class BonderTooEarlyError extends Error {}
export class UnfinalizedTransferBondError extends Error {}
const cacheBuster = 31
2 changes: 0 additions & 2 deletions packages/sdk/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { config as goerli } from './goerli.js'
import { config as mainnet } from './mainnet.js'
import { config as sepolia } from './sepolia.js'

const cachebuster: number = 7

let sdkConfig: any = {}
const bondableChainsSet = new Set<string>([])
const config: any = { goerli, sepolia, mainnet }
Expand Down
2 changes: 0 additions & 2 deletions packages/v2-explorer-backend/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ export const postgresConfig = {
port: process.env.POSTGRES_PORT ? parseInt(process.env.POSTGRES_PORT, 10) : 5432,
maxConnections: process.env.POSTGRES_MAX_CONNECTIONS ? parseInt(process.env.POSTGRES_MAX_CONNECTIONS, 10) : 10
}

const cacheBuster = 23

0 comments on commit bdbc399

Please sign in to comment.