Skip to content

Commit

Permalink
Merge pull request #138 from metagov/add-more-testnets
Browse files Browse the repository at this point in the history
add more testnets
  • Loading branch information
crazyyuan committed Sep 4, 2023
2 parents 4f115f0 + d53f506 commit 036bade
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
28 changes: 26 additions & 2 deletions daostar-website/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,29 @@ function App() {
context: { apiName: "optimismGoerli" },
variables: { id: "optimism-goerli" },
});
const arbitrumGoerliRes = useQuery(queries.REGISTRATIONS, {
context: { apiName: "arbitrumGoerli" },
variables: { id: "arbitrum-goerli" },
});
const chapelRes = useQuery(queries.REGISTRATIONS, {
context: { apiName: "chapel" },
variables: { id: "chapel" },
});
const {
loading: optimismGoerliLoading,
error: optimismGoerliError,
data: optimismGoerliData,
} = optimismGoerliRes;
const {
loading: arbitrumGoerliLoading,
error: arbitrumGoerliError,
data: arbitrumGoerliData,
} = arbitrumGoerliRes;
const {
loading: chapelLoading,
error: chapelError,
data: chapelData,
} = chapelRes;
const {
loading: goerliLoading,
error: goerliError,
Expand All @@ -66,7 +84,7 @@ function App() {
console.error("Goerli Error "+ goerliError);
console.error("Optimism Goerli Error "+ optimismGoerliError);
};
if (loading || goerliLoading || gnosisLoading || optimismGoerliLoading) return "loading...";
if (loading || goerliLoading || gnosisLoading || optimismGoerliLoading || arbitrumGoerliLoading || chapelLoading) return "loading...";
const mainnetRegistrations =
mainnetData?.registrationNetwork?.registrations || [];
const goerliRegistrations =
Expand All @@ -75,10 +93,16 @@ function App() {
optimismGoerliData?.registrationNetwork?.registrations || [];
const gnosisRegistrations =
gnosisData?.registrationNetwork?.registrations || [];
const arbitrumGoerliRegistrations =
arbitrumGoerliData?.registrationNetwork?.registrations || [];
const chapelRegistrations =
chapelData?.registrationNetwork?.registrations || [];
const registrationInstances = mainnetRegistrations.concat(
goerliRegistrations,
gnosisRegistrations,
optimismGoerliRegistrations
optimismGoerliRegistrations,
arbitrumGoerliRegistrations,
chapelRegistrations
);

console.log({ registrationInstances });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ const RegistrationForm = ({ toggleRegScreen, setRegistrationData }) => {
options={[
{ label: 'Mainnet', value: 'mainnet' },
{ label: 'Goerli', value: 'goerli' },
{ label: 'Optimism-Goerli', value: 'optimismGoerli'}
{ label: 'Optimism-Goerli', value: 'optimismGoerli'},
{ label: 'Arbitrum-Goerli', value: 'arbitrumGoerli'},
{ label: 'BNB Bruno', value: 'chapel'}

]}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const RegistrationReceived = ({
polygon: `0x37dF3fC47C1c3A2acaFd2Dad9c1C00090a8655Bc`,
optimism: `0x37dF3fC47C1c3A2acaFd2Dad9c1C00090a8655Bc`,
optimismGoerli: `0x45E81552DEC1F57c18E3cbd69549252624b96D98`,
arbitrumGoerli: `0x5C0340AD34f7284f9272E784FF76638E8dDb5dE4`,
chapel:`0x5C0340AD34f7284f9272E784FF76638E8dDb5dE4`

};

const regContract = new ethers.Contract(
Expand All @@ -40,11 +43,13 @@ const RegistrationReceived = ({
"summonRegistration",
[...regData]
);

// The below assignment is done because url cant handle '-' in the links
if(daoContractNetwork === 'optimism-goerli'){
daoContractNetwork = 'optimismGoerli';
}

if(daoContractNetwork === 'arbitrum-goerli'){
daoContractNetwork = 'arbitrumGoerli';
}

return (
<Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const DisplayRegistration = ({
network = "optimismGoerli";
}

if(network === 'arbitrum-goerli'){
network = 'arbitrumGoerli';
}

return (
<Fragment>
{standalone === true ? (
Expand Down
2 changes: 2 additions & 0 deletions daostar-website/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const client = new ApolloClient({
optimismGoerli: `https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-optimism-goerli`,
mainnet: `https://api.thegraph.com/subgraphs/name/ipatka/daostar`,
gnosis: `https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-gnosis`,
arbitrumGoerli: `https://thegraph.com/hosted-service/subgraph/crazyyuan/daostar-arbitrum-goerli`,
chapel:`https://thegraph.com/hosted-service/subgraph/crazyyuan/daostar-bnb-bruno`
},
// defaultEndpoint: 'https://api.thegraph.com/subgraphs/name/ipatka/daostar',
httpSuffix: "",
Expand Down

0 comments on commit 036bade

Please sign in to comment.