There is a handful of steps to do in order to deploy the Uni V3 fork on a new Autonity chain:
The first step is to deploy the smart contracts from the five repositories in the organization:
The deployment order is essential. Some repositories require the existing deployment of others.
In order to deploy the smart cotnracts:
- Clone the repo.
- Run
npm install(recommend usingnode 18). - Run
npx hardhat compileto compile the contracts. - Update the
hardhat.config.tsfile with the newest RPC endpoint and chainid. - Configure
.envfile referencing the.env.example. - Deploy the contracts with
npx hardhat migrate --network piccadilly --verifycommand.
Don't forget to fund the deployer wallet beforehand.
In order to deploy the Uni subgraph, we first need to setup the Graph node.
The Graph node is available as a Docker image and can be setup just like that.
You will need to provide the POSTGRES_USER and POSTGRES_PASSWORD variables.
Also it may be necessary to update the RPC ethereum endpoint.
After the node is up, we are particularly interested in three ports:
8000that serves the graphql server for subgraphs queries.8020that is needed to create and upload subgraphs.5001that serves the IPFS instance.
The graph node is quite resource hungry, check the VPS requirements here.
Here are the steps to deploy the Uni subgraph:
- Clone the repo.
- Run
npm install. - Update the yaml config file with the required addresses from the smart contracts deployment step.
- Run
npm run compileto compile the schema and build the assemblyscript. - Update the
$GRAPH_NODE_ENDPOINT(8020 port),$IPFS_ENDPOINT(5001 port), and$GRAPH_VERSION(can be arbitrary) env variables. - Execute
npm run createandnpm run deployto upload the subgraph to the graph node.
The subgraph should be queryable at the http://<graph_node_ip>:8000/subgraphs/name/uniswapv3 endpoint.
The front end repo can be found here.
To build the repo, first you need to update its configs:
- Update smart contracts addresses here.
- Update the picadilly chainid here.
- Update the picadilly RPC URL here.
- Update the WETH address here.
You may also need to update the token list here. This is used to show the default tokens of the Uni front end.
Afterwards, update the .env and .env.production files with the required subgraphs endpoints.
Then build the repo with Docker.
GLHW!