Set up your development environment
Get everything you need to start developing using the developer guides.
Last updated
Was this helpful?
Get everything you need to start developing using the developer guides.
Last updated
Was this helpful?
All of the 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 repository.
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
and yarn
installed.
You can connect to a node running locally or through a service such as .
You have access to a wallet—including its private key—and can send transactions.
To set up the development environment:
Clone the 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:
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 page. If you cloned the 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].