You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

2.3 KiB

Concordia Contracts

In this package live the contracts that power Concordia.

This document provides information about how to build and migrate the contracts.

Prerequisites

To migrate the contracts, the targeted blockchain must be up and running. Furthermore, if uploading to a contracts provider, the provider must be available.

Compiling

To compile the contracts execute the compile script:

yarn compile

Linting

To lint the contracts execute the lint script:

yarn lint

Testing

Default host and port values of the blockchain used for testing are:

host port
127.0.0.1 8546

Test using the default network:

yarn test

Using different host and port values for testing blockchain

Define the host and port of the blockchain using environment variables (see below). Test using the env network:

yarn test --network env

Migrating

Default host and port values of the blockchain are:

host port
127.0.0.1 8545

Migrate (using the development network by default):

yarn migrate

Setting different host and port values

Define the host and port of the blockchain using environment variables (see below). Migrate using the env network:

yarn _migrate --network env

Notice the underscore _ prefix in the script name. This is not a mistake.

Uploading

Default hash and tag values used during contracts upload:

hash tag
<npm_package_version>-dev latest

To upload the contracts to a contracts provider instance execute the upload script:

yarn upload

Setting different hash and tag values

Pass the hash and tag of the contracts during script call:

yarn _upload <hash> <tag>

Notice the underscore _ prefix in the script name. This is not a mistake.

Environment Variables

The environment variables used are described below.

Environment variable Default value Usage
WEB3_HOST 127.0.0.1 Set the hostname of the blockchain
WEB3_PORT 8545 Set the port of the blockchain
CONTRACTS_PROVIDER_HOST http://127.0.0.1 Set the hostname of the contracts provider
CONTRACTS_PROVIDER_PORT 8400 Set the port of the contracts provider