forked from Agoric/dapp-treasury
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/feature/bootstrap-protocol' into…
… feature/bootstrap-protocol
- Loading branch information
Showing
1 changed file
with
22 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
# Agoric Treasury | ||
# Bytepitch & Agoric - Lending Protocol | ||
|
||
## Development | ||
## Setup | ||
|
||
1. Follow the steps [here](https://agoric.com/documentation/getting-started/before-using-agoric.html) to install the `agoric-sdk` and agoric CLI tool | ||
2. Git clone this repository, and pull down the latest from branch | ||
`main` | ||
3. Navigate to where you cloned `treasury`, and do `agoric install` | ||
4. To start a local chain for development, do `agoric start --reset --verbose` | ||
You may have already installed the Agoric SDK. Unfortunately the newest version currently has an incompatibility with the lending protocol code, so we will need some extra steps to get the right version. If you don't have the agoric SDK installed, you can skip steps 1 and 2. | ||
|
||
5. Open your wallet with `agoric open`. | ||
6. When the UI changes from gray to white (be patient), transfer some | ||
funds from the **Agoric RUN currency** purse to the **Zoe fees** | ||
purse. | ||
### IMPORTANT - Agoric SDK | ||
1. If you have already ran `yarn install` and `yarn build` in the `agoric-sdk` directory, please delete your `agoric-sdk` directory (`sudo rm -r agoric-sdk`). | ||
2. Delete the `cli-link` to agoric's CLI, if you have linked it, `sudo rm <path to agoric binary>` (e.g: `sudo rm ~/bin/agoric`) | ||
3. Clone the agoric SDK repository (`git clone https://github.com/Agoric/agoric-sdk`) | ||
4. `cd agoric-sdk` | ||
5. Check out to the commit hash with the version we need: `git checkout 0ef67d04da3610ea1777b961589a396e835fe637` | ||
6. Now, do: | ||
1. `yarn install` | ||
2. `yarn build` | ||
3. `yarn link-cli ~/bin/agoric` (or other directory you might prefer) | ||
|
||
7. In another terminal, in `treasury`, do | ||
`ui/use-on-chain-config.js`. This will use the default on-chain settings. | ||
8. To start the UI locally, do `cd ui && yarn start` | ||
9. The treasury will ask you to `please approve the Treasury Dapp in | ||
your wallet.` Click on the `enabled` switch to do this. | ||
**NOTE:** If, after the workshop, you wish to return to the latest beta version, just do the same as we did above but checkout to `beta` instead of `0ef67d04da3610ea1777b961589a396e835fe637` | ||
|
||
## Reusing the code with other parameters | ||
### Lending protocol | ||
|
||
Instead of using the default on-chain settings, you can deploy the | ||
contract and api by using the scripts in `exampleDeployScripts`. These are | ||
not intended to be run with the dapp directly as-is, but rather as | ||
starting points for configuring the deployment in different ways. | ||
1. Clone this repository `git clone https://github.com/anilhelvaci/dapp-pool-lending-protocol/` | ||
2. cd `dapp-pool-lending-protocol` | ||
3. Checkout to latest feature branch `git checkout feature/bootstrap-protocol` | ||
4. Install dependencies `agoric install` | ||
5. Verify all went well: | ||
1. `cd contract` | ||
2. Run `node node_modules/.bin/ava --verbose test/lendingPool/test-lendingPool.js --match='adjust-balances-no-interest'`. The test should pass |