Set up your development environment
Get everything you need to start developing using the developer guides.
All of the developer guides assume that you are using a TypeScript development environment with a project structure similar to the one described here. You can follow the instructions in this section to prepare a development environment for working with the sample scripts in the Cozy developer guide repository.
Before you begin
Before you set up the development environment for creating protection markets, verify the following:
You have an internet connection and access to a shell terminal.
You have
node.js
andyarn
installed.You can connect to a node running locally or through a service such as Infura.
You have access to a wallet—including its private key—and can send transactions.
Prepare the development environment
To set up the development environment:
Clone the Cozy Developer Guides repository by running the following command:
Install package dependencies by running the following command:
Create an environment file called
.env
to store information for connecting to the node provider and wallet.For example, if you are using the infura API and connecting to the Rinkeby test network, your
.env
file should look similar to the following example:Be careful to never commit these secrets to a repository!
Test your local environment by running the following command:
If your development environment is ready to use, you should see output similar to the following to indicate that tests have passed:
What's next?
The settings in the .env
file are used to initialize the wallet and send transactions when the TypeScript files such as create-protection-market.ts
are executed.
For example:
To finish setting up the development environment, you need to obtain the contract addresses and ABIs. You can find all of the contract addresses on the Contract deployments page. If you cloned the Cozy Developer Guides repository, you'll already have the ABIs. If you did not clone the repository, the contracts are verified on Etherscan, so you can get the ABIs from there [NOTE: currently not true].
Last updated