Skip to content

unification-com/finchains-v2

Repository files navigation

Finchains

Oracles

admin

Need to authorise each exchange oracle. Set up .env with wallet and pkey for contract owner, then run:

node ./oracle-service/index.js add-oracle digifinex 0xd03ea8624C8C5987235048901fB614fDcA89b117

Thresholds can be set for each pair:

node ./oracle-service/index.js set-threshold LINK/BTC 0.01

Run an oracle

Each oracle requires its own .env, with values set for:

EXCHANGE=
WALLET_ADDRESS=
WALLET_PKEY=

Once configured, run via cron etc.:

node ./oracle-service/index.js run-oracle

Backend

init db

Set up the DB to gather data from contract. Edit common/db/config/config.json and run:

cd common/db
npx sequelize-cli db:migrate

run watchers

Run via pm2

For currency updates:

node backend/index.js --run=watch-event --event=CurrencyUpdate

For discrepancies:

node backend/index.js --run=watch-event --event=Discrepancy

For WRKCHain block hash submission:

node backend/index.js wrkchain

Smart contract

Deploying with ganache-cli

If ganache-cli is not installed, install with:

npm install -i ganache-cli

Run ganache-cli with:

npx ganache-cli --deterministic --accounts=20 --blockTime=15

The --deterministic flag will ensure the same keys and accounts are generated each time

Deploy with:

npx oz deploy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published