Skip to content

Commit

Permalink
Merge branch 'pedro/update_dns_2' of github.com:obscuronet/go-obscuro…
Browse files Browse the repository at this point in the history
… into pedro/update_dns_2
  • Loading branch information
otherview committed Oct 4, 2023
2 parents 8c86c03 + 88807aa commit 2201eeb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/obscuroscan/main/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type obscuroscanConfig struct {
func defaultObscuroClientConfig() obscuroscanConfig {
return obscuroscanConfig{
nodeID: "",
rpcServerAddr: "http://erpc.uat-testnet.obscu.ro:80",
rpcServerAddr: "http://erpc.sepolia-testnet.obscu.ro:80",
address: "127.0.0.1:3000/v1",
logPath: "obscuroscan_logs.txt",
}
Expand Down
18 changes: 17 additions & 1 deletion tools/walletextension/api/staticOG/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ async function fetchAndDisplayVersion() {
}
}

function getRPCFromUrl(gatewayAddress) {
// get the correct RPC endpoint for each network
switch(gatewayAddress) {
case 'https://testnet.obscu.ro/':
return 'https://rpc.sepolia-testnet.obscu.ro'
case 'https://sepolia-testnet.obscu.ro':
return 'https://rpc.sepolia-testnet.obscu.ro'
case 'https://uat-testnet.obscu.ro/':
return 'https://rpc.uat-testnet.obscu.ro';
case 'https://dev-testnet.obscu.ro/':
return 'https://rpc.dev-testnet.obscu.ro';
default:
return gatewayAddress;
}
}

async function addNetworkToMetaMask(ethereum, userID, chainIDDecimal) {
// add network to MetaMask
let chainIdHex = "0x" + chainIDDecimal.toString(16); // Convert to hexadecimal and prefix with '0x'
Expand All @@ -65,7 +81,7 @@ async function addNetworkToMetaMask(ethereum, userID, chainIDDecimal) {
symbol: 'ETH',
decimals: 18
},
rpcUrls: [obscuroGatewayAddress+"/"+obscuroGatewayVersion+'/?u='+userID],
rpcUrls: [getRPCFromUrl(obscuroGatewayAddress)+"/"+obscuroGatewayVersion+'/?u='+userID],
blockExplorerUrls: ['https://testnet.obscuroscan.io'],
},
],
Expand Down

0 comments on commit 2201eeb

Please sign in to comment.