Explore the docs »
soon in production
·
Report Bug
·
Request Feature
[ ] Node 14.15.0
- Check
env.example
at project root and fill in corresonpding values on your local - Go to https://infura.io/ and make an account
- Paste the kovan project ID into your .env as the value for
INFURA_PROJECT_ID
key - Generate a 12 word mnemonic seed phrase (can use ganache to get one or ask project admin for current seed used for remote envs)
- Paste 12 word mnemonic seed phrase as value for
MNEMONIC_SEED
key - Go to https://alchemyapi.io/ and setup an account then take the api key for the relevant network (like mainnet, kovan or ropsten) or ask the team for an existing API key and paste under
ALCHEMY_KEY
- When setting up locally, paste
LOCALHOST
as value toCHAIN_NETWORK
. Other values areKOVAN
orMAINNET
(we are not on other testnets atm)
- Be sure to have metamask plugin installed in your browser (recommended browser is Chrome)
- Login to Metamask and point the network to localhost and port 7545 before starting the frontend app
- Install ganache
https://trufflesuite.com/ganache/
.
- Open a new terminal window and run
git clone https://github.com/Ghost-Finance/g-minter && cd g-minter
- run
npm i
to install backend dependencies - run
npm run test:local
to run contract test suite to run smart contract test cases - run
npm run deploy:local
to compile and deploy the Minter contract to the ganache node - cd to frontend
cd frontend
- run
yarn
to install frontend dependencies - run
npm run start
to serve the app locally
- Install all dependencies
- Deployed a local ethereum network with Ganache on the uma protocol/ protocol folder
- Compliled and deployed smart contract to the blockchain
- Contract artifact and typechain is auto generated in the front end folder
- Terminal 1 - React Front End for the dapp
- Terminal 2 - Ganache node deploy from the uma protocol folder
- Deploy the local ganache inside the uma protocol
- Metamask set to the network you are developing to (localhost:7545 for local, testnet of choice)
- Run a local react server
- Contract and other dependencies are in the same folder
- Ensure you have added the following env variables: INFURA_PROJECT_ID and MNEMONIC SEED
- Make sure the account in your mnemonic seed has enough balance to deploy the contract
- Run
npm run test:local
to ensure all tests are passing (make sure you have the setup your local environment first) - If tests are passing, check deploy.ts if the addresses are pointed to rinkeby.
- If all addresses are on kovan, deploy the code by running
npm run deploy:rinkeby
- The minter address should appear in the console.
- Run the dApp:
cd frontend && npm run start
- Change your metamask network to Rinkeby
- The minter dApp UI should load
- Ensure your local environment has been set up (ganache node, truffle console)
- Do updates in the smart contract solidity code in the contracts folder located in root
- Add tests in the test folder when necessary
- Run
npm run test:local
- If tests are passing, deploy the code by running
npm run deploy:local
- If successful, the front end dApp should reload and smart contract changes can be read/utilized by the dApp.
HardHat Documentation - Hardhat tutorials, config, network, and plugin references
- Error: Cannot use JSX unless the '--jsx' flag is provided
- Follow: https://vscode.readthedocs.io/en/latest/languages/typescript/#using-the-workspace-version-of-typescript - "Using the workspace version of TypeScript" section
- Warning: Calling an account which is not a contract
- Compile and deploy your contract first. Run
npm run deploy:local
for local deployments.
- If you get
ProviderError: Must be authenticated!
or https://hardhat.org/errors/#HH604 then make sure you've entered a key and value in.env
forALCHEMY_KEY
- If you've accidentally started a background process for a node then you can use
sudo lsof -i :<port number>
to find the PID then kill it usingkill -9 <PID>
(from https://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac)
- Use Github Flow. (https://guides.github.com/introduction/flow/)
- Name your branches starting with feature/branchName. Ex. feature/doingSomethingNew or feature/fixSomething.