The Superfluid Developer Console is a great resource when building any Superfluid related project. You can find the hosted version here when working on any live testnet or main network: https://console.superfluid.finance.
However, it's much easier to tinker with new projects locally. This repo will help you run the console locally so that you can make this happen!
- You must have docker installed and open on your machine. If it's not open, you'll get errors that the 'docker daemon is not running'
- Make sure that your port 8545 is open and that you don't have any processes already running on port 5001 or port 5432. To check whether or not a process is running on these ports, you can use
lsof -i :8545and then kill those process by taking the PID number returned bylsofand runningkill PID
- Start docker on your machine
- Run sh start.sh at root
- OPTIONAL - if there were any errors with the subgraph deployment, then cd into ./subgraph and run
yarn build-and-deploy-local - Create a stream in the example project folder to test it out by running the
wrapTokensandcreateFlowscripts and specifying--network localhostlike this:npx hardhat run scripts/wrapTokens.js --network localhostandnpx hardhat run scripts/createFlow.js --network localhost - Head to your local console running on localhost:3000 and see your newly created stream in the 'Hardhat' tab!
You’re up and running! Now you can use the console locally with your other work!
Here’s how to troubleshoot if you make a mistake somewhere in this process and need to re start
-
Kill everything: shut down your hardhat node and your docker container running the subgraph
-
Delete the automatically generated
datafolder inside of the subgraph folder of the ethereum-contracts package. This is caching data from previous networks & deployments
For example:
- the subgraph isn’t indexing data, or the data it is indexing is old
- or your node is quitting immediately after booting up
Possible remedies:
- Try deleting the automatically generated
datafolder inside of the subgraph folder of the ethereum-contracts package, then try again. - You may also need to ensure that you don’t have other proccesses running on port 5432 or port 5001 - your container needs these for running IPFS and Postgres on your machine as a part of the subgraph node
If you have any questions, don't hesitate to reach out in the Superfluid Discord's #dev-support channel: https://discord.superfluid.finance