Below are the instructions for deploying the contracts with the Semaphore SDK:
Clone the Semaphore repo: https://github.com/semaphore-protocol/semaphore
git clone <https://github.com/semaphore-protocol/semaphore.git>
Install the dependencies:
cd semaphore && yarn
Build the libraries:
yarn build:libraries
Create a .env
file and set your BACKEND_PRIVATE_KEY
.
Go to the packages/contracts
folder and run:
⚠️ Note: You may need to update the url property for each network in the supported-network.ts
file (inside the utils package) to use the correct Alchemy or Infura RPC URLs. After updating the url properties, make sure you don't commit those changes so that the package continues to contain the default URLs.
yarn deploy --network sepolia
You can specify other networks. Take a look here to check the supported ones.
If you want to verify the contracts you deployed on Etherscan you need to set the ETHERSCAN_API_KEY
variable in the .env
file and run:
yarn verify --network sepolia
Deploy the new subgraphs by running:
⚠️ Note: Ensure that the semaphore-interface.json
file in the utils library matches the artifact generated in contracts after running yarn compile. The artifact is located at packages/contracts/artifacts/contracts/Semaphore.sol/Semaphore.json
.
In the root project:
yarn && yarn build:libraries
In the subgraph project:
yarn codegen <network>
And:
yarn auth <access-token> && yarn deploy <subgraph-name>
Please, remember to update the README file.
packages/data/src/getURL.ts
.