- Install Archon from NPM
As of v2.0.0
web3.js is a peer-dependency and should be installed alongside
yarn add '@kleros/archon@^2.0.0' 'web3@^1.4.0'
- Import Archon into your project
var Archon = require('@kleros/archon')
- Initialize an instance of Archon using an Ethereum Provider and, optionally, an IPFS Gateway.
// By default Archon uses 'https://gateway.ipfs.io' as the default IPFS gateway. To use your own gateway, pass the gateway URI as the 2nd parameter to Archon. var archon = new Archon('https://mainnet.infura.io')
A provider is needed so that the codebase knows how to connect to the Ethereum network. You can use a connection to your own node, or to a hosted node such as infura.
web3.js will make RPC calls to the provider to fetch data from the blockchain.
A gateway is needed to access
IPFS files that might be referenced in evidence or metaEvidence.