You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-2Lines changed: 47 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
## CommitPool Single Player Smart Contract repository
2
2
3
-
4
3
[CommitPool](http://commitpool.com/) helps people meet their personal goals by holding themselves accountable. CommitPool users stake money to credibly commit to meeting their goals, and lose their stake when they don’t.
5
4
6
5
Our MVP focuses on a single goal type for individuals, hence the Single Player mode.
@@ -14,8 +13,54 @@ Currently Ganache and Node 14 are not playing well together. To get started:
14
13
3.```npm run-script build```
15
14
4.```npm test``` (to verify the build)
16
15
17
-
## Features
16
+
#### Deploying to local node
17
+
Buidler
18
+
19
+
1. Use node 12 (using nvm is recommended)
20
+
2.```npx buidler node```
21
+
3. In second terminal```npx buidler run --network localhost scripts/deploy.ts ```
22
+
23
+
Buidler & Ganache
18
24
25
+
1. Use node 12 (using nvm is recommended)
26
+
2. Start Ganache on port 8545
27
+
3. In second terminal```npx buidler run --network localhost scripts/deploy.ts ```
28
+
29
+
Truffle
30
+
31
+
1. Use node 12 (using nvm is recommended)
32
+
2. Start Ganache on port 8545
33
+
3. In terminal```truffle migrate```
34
+
35
+
#### Deploying to Matic
36
+
Deployment to the Mumbai Testnet is configured in ```./truffle-config.js```
37
+
38
+
1.```npm install truffle -g```
39
+
2. Deploy to Mumbai testnet: ```truffle migrate --network matic```
40
+
3. Find your contract based on the address reported by Truffle in the [Matic Explorer](https://explorer-mumbai.maticvigil.com/).
41
+
42
+
Quite note on deploying to Matic:
43
+
* Test deployment using Truffle against a runnning Ganache instance: ```truffle migrate```
44
+
* Configure Matic network in [MetaMask](https://docs.matic.network/docs/develop/metamask/config-matic/)
45
+
* Request funds at [faucet](https://faucet.matic.network/)
46
+
* Use this wallet's seed phrase in the .env file to pay the deployment
47
+
48
+
Interaction with the contract on Matic via Truffle:
49
+
1.```truffle console --network matic```
50
+
2.```compile```
51
+
3.```var singlePlayerCommit = await SinglePlayerCommit.at('<ADDRESS FROM DEPLOYMENT>')```
52
+
4. To test: ```await contractTest.activityKeyList(0)```
A commitment consists of an ```activity```, a ```goalValue``` for given activity, a ```startTime```, and ```stake```. We will automagically set the ```endTime``` 7 days after the startdate.
0 commit comments