contract-registry
v1.0.1
Published
CLI and proxy module for interacting with smart contract registry ABIs, deployments and docs.
Downloads
1
Readme
contract-registry-node
CLI and proxy module for interacting with smart contract registry ABIs, deployments and docs.
Setup
Generate an API_KEY
in the contract registry and create a contracts.js
file following this convention:
const config = {
registry = MyCoolCompany,
api_key = '1234abc', // or process.env.API_KEY
contracts = [
voting: {
projectName: voting,
version: 1.1
},
todo-list: {
projectName: todo-list,
version: latest
}
]
};
module.exports = contracts;
The CLI will reference this file to populate a .contracts/
directory with smart contract ABIs, deployment addresses and documentation. This module also serves to proxy this, so in your react application you can,
import contractRegistry from "contract-registry";
const { abi, env } = contractRegistry.voting;
console.log(env.networks["testnet"].address);
Usage
contract-registry pull
— Read contracts.js and pull ABIs, docs and deployment addressescontract-registry docs
— View smart contract docs in a web browser