Skip to content

platypus-project/v3-core

 
 

Repository files navigation

Platypus Deployment Guide

There is a handful of steps to do in order to deploy the Uni V3 fork on a new Autonity chain:

1. Deploy the smart contracts

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:

  1. Clone the repo.
  2. Run npm install (recommend using node 18).
  3. Run npx hardhat compile to compile the contracts.
  4. Update the hardhat.config.ts file with the newest RPC endpoint and chainid.
  5. Configure .env file referencing the .env.example.
  6. Deploy the contracts with npx hardhat migrate --network piccadilly --verify command.

Don't forget to fund the deployer wallet beforehand.

2. Deploy the Graph node

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:

  • 8000 that serves the graphql server for subgraphs queries.
  • 8020 that is needed to create and upload subgraphs.
  • 5001 that serves the IPFS instance.

The graph node is quite resource hungry, check the VPS requirements here.

3. Deploy subgraph to the node

Here are the steps to deploy the Uni subgraph:

  1. Clone the repo.
  2. Run npm install.
  3. Update the yaml config file with the required addresses from the smart contracts deployment step.
  4. Run npm run compile to compile the schema and build the assemblyscript.
  5. Update the $GRAPH_NODE_ENDPOINT (8020 port), $IPFS_ENDPOINT (5001 port), and $GRAPH_VERSION (can be arbitrary) env variables.
  6. Execute npm run create and npm run deploy to upload the subgraph to the graph node.

The subgraph should be queryable at the http://<graph_node_ip>:8000/subgraphs/name/uniswapv3 endpoint.

4. Deploy the front end

The front end repo can be found here.

To build the repo, first you need to update its configs:

  1. Update smart contracts addresses here.
  2. Update the picadilly chainid here.
  3. Update the picadilly RPC URL here.
  4. 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.

Disclaimer

GLHW!

About

🦄 🦄 🦄 Core smart contracts of Uniswap v3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 51.9%
  • Solidity 48.1%