# Network Bootstrapping Guide This guide will help onboard new networks to the DAOhaus community interface. ## Requirements - EVM compatible chain - TheGraph node/hosted node - Block explorer with api (etherscan/blockscout) - Gnosis safe on network - UberHaus proposal - Community Bounty/Grant (optional) ## Prepping for deploy In order to summon moloches and minions on your network we'll need the summoning factories for each. ### Deploy Contracts Deploy and verify contracts on your block explorer - [Moloch v2.1 Factory](https://github.com/HausDAO/Molochv2.1) - [Safe Minion Factory](https://github.com/HausDAO/MinionSummonerV2/blob/main/contracts/SafeMinion.sol) - if gnosis safe is not on the network use [Minion v3 Factory](https://github.com/HausDAO/NiftyMInionSummoner) - [WrapNZap Factory](https://github.com/HausDAO/wrap-n-zap) ### Deploy Subgraphs - [Supergraph](https://github.com/HausDAO/daohaus-supergraph) - Moloches & Minions - [Stats Graph](https://github.com/HausDAO/daohaus-stats) - Aggregated stats for proposals, votes, etc. - [Boost Subgraph](https://github.com/HausDAO/daohaus-boosts) - WrapNZap & Misc - [erc721](https://github.com/sunguru98/erc-721-subgraph) - [erc1155](https://github.com/sunguru98/erc-1155-subgraph) **Update Manifest Config** 1. Add PR for the [`manifests/config`](https://github.com/HausDAO/daohaus-supergraph/blob/master/manifests/config.js) 2. Provide a contact for notifying about deploys, if not automated ## Extend DAOhaus chain.js PR into `develop` branch with updated [chain.js](https://github.com/HausDAO/pokemol-web/blob/app/src/utils/chain.js). Add details for the chain, check [here](#Chainjs-data-table) for a glossary on these keys. #### Example ```javascript '0x89': { name: 'Matic', short_name: 'matic', nativeCurrency: 'MATIC', network_id: 137, chain_id: '0x89', hub_sort_order: 3, providers: ['walletconnect'], rpc_url: 'https://rpc-mainnet.matic.network', abi_api_url: 'https://api.polygonscan.com/api?module=contract&action=getabi&address=', tokenlist_api_url: 'https://api.polygonscan.com/api', subgraph_url: 'https://api.thegraph.com/subgraphs/name/odyssy-automaton/daohaus-matic', stats_graph_url: 'https://api.thegraph.com/subgraphs/name/odyssy-automaton/daohaus-stats-matic', boosts_graph_url: 'https://api.thegraph.com/subgraphs/name/odyssy-automaton/daohaus-boosts-matic', minion_factory_addr: '0x02e458B5eEF8f23e78AefaC0F15f5d294C3762e9', moloch_factory_addr: '0x6690C139564144b27ebABA71F9126611a23A31C9', dai_contract: '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063', wrapper_contract: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', wrap_n_zap_factory_addr: '0xbf9e327d465A4A160fA7805282Fb8C7aB892770a', block_explorer: 'https://polygonscan.com', superfluid: { minion_factory_addr: '0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6', resolver: '0xE0cc76334405EE8b39213E620587d815967af39C', subgraph_url: 'https://api.thegraph.com/subgraphs/name/superfluid-finance/superfluid-matic', superapp_addr: { v1: '0xdb4D89F2199b9Cf451B7Ff4bdC94b1c96De4bdD0', }, version: 'v1', }, niftyMinion: { minion_factory_addr: '0x4CCaDF3f5734436B28869c27A11B6D0F4776bc8E', version: 'v1', }, }, ``` ## Other Frontend Updates ### Summoning Preset values for summoning in `summoning.js` ### Explore Add network to explore filters. ## Extend the API & Caching Hopefully this step can be distributed also, but for now we're caching extra data to ensure data providers are able to keep up with the quickly moving ecosystem of banks, minions, NFTs and token balances. This usually takes 1 to 2 weeks once availablility allows. - token price data - minion vault erc20/erc721/erc1155 tokens ### Explorer API This requires access to an etherscan-like api for the chain: - polygon: https://api.polygonscan.com/api - eth chains: https://etherscan.io/apis - xdai: https://blockscout.com/xdai/mainnet/api-docs **Functions needed** - Fetch ABI - Fetch Balances ## UberHaus Proposal As the overseeer of the DAOhaus community frontend, UberHaus reserves the right to approve new networks added. Create a new proposal for [UBERhaus](https://forum.daohaus.club/c/uberhaus/58) in the [DAOhaus Forum](https://forum.daohaus.club): https://forum.daohaus.club/c/uberhaus/58 Join an UBERhaus delegates call or pop into the public forum for further discussion on your proposal. ### Proposal Template ``` # New Network: {NETWORK NAME} ## Submission Details - Submitter: @daohaus ## Network Overview Give an overview of the network and its consensus, ecosystem participants and any other useful information. ## Technical implementation - [ ] Contracts deployed - Moloch v2.1 Factory: - [ ] Subgraphs deployed - Supergraph Explorer: - [ ] Update chains, summoning, explore - [ ] Explorer API for data cache ## Pull Request for Frontend Link to the PR submitted to complete the frontend update https://github.com/HausDAO/pokemol-web/pulls/{PR} ## Magesmith PR Review - Reviewed by: {MAGESMITH(S)} ``` ## On-going Support It will invariably come time to update the subgraph so it's best to deploy the subgraph with a deploy pipeline that sources the supergraph, etc. repos directly. If these services deteriorate we'll be forced to remove network support until these improve again. ### Deploy Pipeline - Leverage CI/CD for subgraph deploy to keep in sync with the community deploys ### Community Bounty and Grants It takes some overhead for the Daohaus team to setup and maintain the hosted services and front end. Do you have a grant program to help keep us building? If so please tell us about it. ## Appendix ### Chain.js data table | key | value | | -------- | -------- | | name | Display name for the network | | short_name | Gnosis API key for network: `mainnet, kov, rink` | | ~~chain~~ | Deprecated | | nativeCurrency | Native currency symbol: `ETH, xDai, MATIC` | | ~~network~~ | Deprecated: Used only for pokemol (v1) networks | | network_id | Integer representation for network | | chain_id | Hex representation for network | | hub_sort_order | Default to last before Eth test networks | | providers | Ensure they're available in `web3Modal.js` | | rpc_url | Primary json RPC URL, will use user's if available | | abi_api_url | Explorer URL for fetching contract ABI | | tokenlist_api_url | Token List URL for ERC20 tokens | | subgraph_url | Supergraph URL | | stats_graph_url | Stats Subgraph URL | | boosts_graph_url | Boosts Subgraph URL | | minion_factory_addr | Minion factory address | | moloch_factory_addr | Moloch Summoner address | | dai_contract | to provide a default stable currency at summon | | wrapper_contract | to facilitate wrapping for the dao/user | | wrap_n_zap_factory_addr | WrapNZap factory address | | block_explorer | Block explorer URL for sharing with tx hashes or address links | | superfluid | Superfluid minion summoner address and settings | | niftyMinion | Nifty minion summoner address and settings |