Developer-Guide
Overview
This guide shows you how to setup the developer environment to contribute to project.
We recommend reading the SmartVault Design Document for background information and design choices taken.
Install the CLI
The CLI provides all the wallet operations without having to install or setup the source code. Run npm install -g @hashmesan/smartvault
. For usage, see our examples.
Setup Development Environment
The main branch has the stable changes. The develop branch is used for development. Features are merged into develop, tested, and merged back to main.
Checkout the source
Install global dependencies
Install dependencies
Always install dependencies at the base directory because there are common libraries (in library) which are shared across relayer, cli, and webclient.
Compile smart contracts
Setup Web client
Setup Relayer
Configure the keys for relayer.
Create a file in relayer/.env
Get an IPFS account from infura and they will provide an IPFS ID and Secret to fill out in the config. Create a harmony wallet & provide a private key with some ONE coins to pay for transaction fees as a relayer. On testnet, you can get this for free on https://faucet.pops.one/
You can run without IPFS account. When you create an account, don't pass domains information and it will skip register ENS. See code
Development Workflow
Depending on the feature you are building, you do not have to run all of the components. We already run the mainnet0 (shard0) and testnet3 (shard0 and shard3). If your work is limited to testnet & mainnet, you don't have to run relayer. If you are doing heavy development on the smart contract it may be more efficient to do your testing on development
network.
Untar a prebuilt ganache db which contains the ENS smart contracts already deployed to 0xD29154f92F4825202768961ca44d1ffE26C11F76
and run it sh ganache.sh
on a separate terminal.
Webclient config.js refers to development
Truffle always refers to development
. Make sure you run truffle with --network development
.
Send ONE in development
Building Dapps
There's a world of possibilities in implementing dapps, and defi into the wallet. Aave, Balancer, Curve, Uniswap, Yearn, Compound can be found in other wallets like argents, loopring, and gnosis.