Skip to content
Open
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
8 changes: 6 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ base_path="$(dirname "$(realpath -s "$0")")/src"
# Explanation for the flags:
# - `NODE_EXTRA_CA_CERTS`: if using ethers npm package and this is denied, the
# script errors out with "Error: could not detect network".
# - `WS_NO_BUFFER_UTIL`: script crashes without access
# https://www.npmjs.com/package/ws?activeTab=readme
# - `--deny-read`: do not prompt for permission to read the node_modules cache,
# which is triggered by the npm module import of ethers.
# - `--allow-net=...`: list of nodes that the script is expected to connect to.
# - `--allow-write=./out`: this is the folder that collects the script's output.
deno run \
--deny-read \
--allow-write="./out" \
--allow-env='NODE_EXTRA_CA_CERTS' \
--allow-env='NODE_EXTRA_CA_CERTS,WS_NO_BUFFER_UTIL' \
--allow-net="\
rpc.mevblocker.io,\
rpc.gnosischain.com,\
ethereum-sepolia.publicnode.com,\
arbitrum-one-rpc.publicnode.com,\
base.llamarpc.com,\
rpc.lens.xyz" \
rpc.lens.xyz,\
rpc.linea.build,\
rpc.plasma.to" \
-- \
"$base_path/replace-owners.ts" \
"$@"
8 changes: 7 additions & 1 deletion src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export type SupportedNetworks =
| "Avalanche"
| "Arbitrum One"
| "Base"
| "Lens";
| "Lens"
| "Linea"
| "Plasma";

export function getRpc(network: SupportedNetworks): string {
// For more information about the RPC nodes: https://chainlist.org/
Expand All @@ -36,6 +38,10 @@ export function getRpc(network: SupportedNetworks): string {
return "https://api.avax.network/ext/bc/C/rpc";
case "Lens":
return "https://rpc.lens.xyz";
case "Linea":
return "https://rpc.linea.build";
case "Plasma":
return "https://rpc.plasma.to";
default:
throw new Error(`Invalid network ${network}`);
}
Expand Down