# DAOstar spec update propagation The following updates need to be made on all supported EVM networks: ## Contracts Deploy to all networks https://github.com/metagov/daostar/blob/60fd73998dee7f840230c66f60834f962891a469/contracts/package.json#L9 Only goerli has been completed ``` "scripts": { "build": "forge build", "deploy:goerli": "EVM_NETWORK=goerli source .env && forge script script/Deploy.s.sol --fork-url $GOERLI_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast", "deploy:gnosis": "EVM_NETWORK=gnosis source .env && forge script script/Deploy.s.sol --fork-url $GNOSIS_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast", "deploy:mainnet": "EVM_NETWORK=mainnet source .env && forge script script/Deploy.s.sol --fork-url $MAINNET_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast", "verify:mainnet": "EVM_NETWORK=mainnet source .env && forge verify-contract", "deploy:optimism": "EVM_NETWORK=optimism source .env && forge script script/Deploy.s.sol --fork-url $OPTIMISM_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast", "deploy:arbitrum": "EVM_NETWORK=arbitrum source .env && forge script script/Deploy.s.sol --fork-url $ARBITRUM_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast", "deploy:polygon": "EVM_NETWORK=polygon source .env && forge script script/Deploy.s.sol --fork-url $POLYGON_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast", "test": "forge test" }, ``` ## Subgraph Update subgraph networks once contract is deployed https://github.com/metagov/daostar/blob/main/Implementations/Subgraph/daostar/networks.json ``` { "goerli": { "EIP4824Index": { "address": "0xd8f49391ba81942d40c26a50f8ca63cdca6fb3da", "startBlock": 8901481 } } } ``` Add build & deploy scripts for all new networks https://github.com/metagov/daostar/blob/main/Implementations/Subgraph/daostar/package.json Only goerli is deployed. You will need a graph hosted service account (free) https://thegraph.com/hosted-service/dashboard ``` "scripts": { "build:mainnet": "graph codegen && graph build --network mainnet", "build:goerli": "graph codegen && graph build --network goerli", "codegen": "graph codegen", "build": "graph build", "deploy:mainnet": "graph deploy --node https://api.thegraph.com/deploy/ ipatka/daostar", "deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ ipatka/daostar-goerli", "deploy:all": "yarn build:goerli && yarn deploy:goerli && yarn build:mainnet && yarn deploy:mainnet", "create-local": "graph create --node http://localhost:8020/ ipatka/daostar", "remove-local": "graph remove --node http://localhost:8020/ ipatka/daostar", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ipatka/daostar" }, ``` ## Website Update multi graph config to support other subgraphs https://github.com/metagov/daostar/blob/60fd73998dee7f840230c66f60834f962891a469/daostar-website/src/index.js#L26 ``` const client = new ApolloClient({ link: ApolloLink.from([ new MultiAPILink({ endpoints: { goerli: `https://api.thegraph.com/subgraphs/name/ipatka/daostar-goerli`, mainnet: `https://api.thegraph.com/subgraphs/name/ipatka/daostar`, // HERE }, // defaultEndpoint: 'https://api.thegraph.com/subgraphs/name/ipatka/daostar', httpSuffix: '', createHttpLink: createHttpLink, }), ]), cache: new InMemoryCache({}), }) ``` Update query to support all new subgraphs https://github.com/metagov/daostar/blob/60fd73998dee7f840230c66f60834f962891a469/daostar-website/src/App.js#L27 ``` const { loading, error, data: mainnetData } = useQuery(queries.REGISTRATIONS, { context: { apiName: 'mainnet' }, variables: { id: 'mainnet' } }) const goerliRes = useQuery(queries.REGISTRATIONS, { context: { apiName: 'goerli' }, variables: { id: 'goerli' } }) const { loading: goerliLoading, error: goerliError, data: goerliData } = goerliRes console.log({ mainnetData, goerliData }) if (error || goerliError) return 'error' if (loading || goerliLoading) return 'loading...' const mainnetRegistrations = mainnetData?.registrationNetwork?.registrations || [] const goerliRegistrations = goerliData?.registrationNetwork?.registrations || [] const registrationInstances = mainnetRegistrations.concat(goerliRegistrations) console.log({ registrationInstances }) ``` Goerli index: https://goerli.etherscan.io/address/0xd8f49391Ba81942D40C26A50F8cA63cDcA6fb3dA#code Goerli factory: https://goerli.etherscan.io/address/0x3271b3479f7485dadb2bd5fff43eeb4367b1a91a#code