-
Notifications
You must be signed in to change notification settings - Fork 14
/
eosdacfactory.sh
executable file
·949 lines (853 loc) · 40.6 KB
/
eosdacfactory.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
#!/bin/bash
source ./conf.sh
source ./functions.sh
git submodule update --init --recursive
prompt_color=`tput setaf 6`
reset=`tput sgr0`
WORKINGDIR="$(pwd)"
KEOSD_PID="$(pgrep -x keosd)"
if (( KEOSD_PID > 0 )); then
echo "keosd running with process ID $KEOSD_PID"
else
echo "Please run ./keosd.sh in a separate terminal window to start the EOS key server before running this script."
exit
fi
LIB=""
TOKENSYBMOL=""
DACPREFIX=""
prompt_for_input=true
if [ -f ./dac_conf.sh ]; then
read -p " > ${prompt_color} It looks like you have a dac_conf.sh file. Would you like to use the values in that file (Y/N)?${reset} " response
if [[ "$response" == "Y" || "$response" == "y" ]]; then
echo "Using variables imported from dac_conf.sh:"
source ./dac_conf.sh
prompt_for_input=false
fi
fi
# If you ever don't have enough RAM for an account to set a contract, you can get more with this command:
# ./jungle.sh system buyram dacfactory11 dacfac11cust "10.000 EOS"
echo ""
echo "______ ___ _____ ______ ___ _____ _____ _____________ __"
echo "| _ \/ _ \/ __ \ | ___/ _ \/ __ \_ _| _ | ___ \ \ / /"
echo "| | | / /_\ \ / \/ | |_ / /_\ \ / \/ | | | | | | |_/ /\ V / "
echo "| | | | _ | | | _|| _ | | | | | | | | / \ / "
echo "| |/ /| | | | \__/\ | | | | | | \__/\ | | \ \_/ / |\ \ | | "
echo "|___/ \_| |_/\____/ \_| \_| |_/\____/ \_/ \___/\_| \_| \_/ "
echo ""
echo ""
echo "=============================================================="
echo "= ="
echo "= Welcome to the DAC Factory! ="
echo "= ="
echo "= provided by eosDAC ="
echo "= ="
echo "=============================================================="
echo " "
if $prompt_for_input ; then
if [ "$extensions_github" == "" ]; then
read -p " > ${prompt_color} Enter your forked and customized eosdac-client-extension repository .git url. If you'd like to use the default eosDAC branding, hit enter to use https://github.com/eosdac/eosdac-client-extension.git${reset} " extensions_github
if [ "$extensions_github" == "" ]; then
extensions_github="https://github.com/eosdac/eosdac-client-extension.git"
fi
fi
fi
if $prompt_for_input ; then
read -p " > ${prompt_color} What is the name of your DAC?${reset} " dacname
fi
#: <<'END_COMMENT'
if [[ "$dacname" == "" ]]; then
echo "You need a DAC Name"
exit
fi
echo "Thank you, $dacname"
if [ "$LIB" == "" ]; then
LIB="$(cleos --wallet-url $WALLET_URL -u $API_URL get info | grep 'last_irreversible_block_num' | awk '{print $2}' | sed 's/,$//')"
fi
if $prompt_for_input ; then
read -p " > ${prompt_color} Have you already created an EOS account for your DAC (Y/N)?${reset} " response
if [[ "$response" == "Y" || "$response" == "y" ]]; then
if $prompt_for_input ; then
echo " > ${prompt_color} Please paste the private key:${reset} "
read -s DAC_PVT
read -p " > ${prompt_color} Please paste the public key:${reset} " DAC_PUB
read -p " > ${prompt_color} Please paste the EOS account name:${reset} " EOS_ACCOUNT
fi
else
echo "Generating keys..."
KEYS="$(cleos create key --to-console | awk '{ print $3 }')"
DAC_PVT="$(echo $KEYS | head -n1 | awk '{print $1;}')"
DAC_PUB="$(echo $KEYS | head -n1 | awk '{print $2;}')"
read -p " > ${prompt_color} Are you ready to view a private key on screen and save it securely (Y/N)?:${reset} " response
if [[ "$response" == "Y" || "$response" == "y" ]]; then
echo "Private Key: $DAC_PVT"
read -p " > ${prompt_color} Press any key to clear the screen and continue${reset}" response
clear
echo " > ${prompt_color} Please verify your private key:${reset} "
read -s response
if [[ $response != $DAC_PVT ]]; then
echo "Private Key does not match!"
exit
fi
echo "Use the following key to create an account using the Jungle Testnet https://monitor.jungletestnet.io/#home"
echo "Public Key: $DAC_PUB"
read -p " > ${prompt_color} Please verify your public key:${reset} " response
if [[ $response != $DAC_PUB ]]; then
echo "Public Key does not match!"
exit
fi
read -p " > ${prompt_color} Please paste the EOS account name you created:${reset} " EOS_ACCOUNT
echo "Fantastic! Now go back to the Jungle Testnet https://monitor.jungletestnet.io/#home page, click the faucet link, put in the account $EOS_ACCOUNT, check the Google Captcha, and push Send Coins."
read -p " > ${prompt_color} Press any key after you are done using the Jungle Testnet faucet for $EOS_ACCOUNT.${reset} " response
else
exit
fi
fi
fi
run_cmd "get account $EOS_ACCOUNT"
if [ "$?" != "0" ]; then
echo "The account you specified could not be found."
exit
fi
if [ -f $EOS_ACCOUNT.wallet_password ]; then
run_cmd "wallet unlock --name $EOS_ACCOUNT < $EOS_ACCOUNT.wallet_password"
else
run_cmd "wallet create --file $EOS_ACCOUNT.wallet_password --name $EOS_ACCOUNT"
run_cmd "wallet import --name $EOS_ACCOUNT --private-key $DAC_PVT"
fi
echo "Next we'll create EOS accounts (if they don't already exist) for your DAC. Use only letters and numbers 1-5. The account name needs to be exactly 12 characters."
if $prompt_for_input ; then
read -p " > ${prompt_color} Would you like to use an 8-character prefix for your DAC accounts, and we'll create them with suffixes like cust, auth, mult, tokn, ownr, prop? (Y/N):${reset} " response
if [[ "$response" == "Y" || "$response" == "y" ]]; then
read -p " > ${prompt_color} Please enter an 8 charcater DAC prefix using only letters and numbers 1-5:${reset} " DACPREFIX
fi
fi
if $prompt_for_input ; then
if [ "$DACPREFIX" == "" ]; then
read -p " > ${prompt_color} The account holding the custodian (voting) contract (Custodian Account):${reset} " daccustodian
else
daccustodian="${DACPREFIX}cust"
fi
fi
run_cmd "get account $daccustodian" &>/dev/null
if [ "$?" != "0" ]; then
read -p " > ${prompt_color} Would you like to create the daccustodian account ($daccustodian) now (Y/N)?${reset} " response
if [[ $response == "Y" || $response == "y" ]]; then
create_act $EOS_ACCOUNT $daccustodian $DAC_PUB
echo "Before we continue, let's hit that faucet again so we'll have enough EOS for RAM. This time put in the $daccustodian account: https://monitor.jungletestnet.io/#home"
read -p "After you are done with the faucet, hit any key." response
run_cmd "transfer $daccustodian $EOS_ACCOUNT \"100 EOS\" \"\" -p $daccustodian"
else
exit
fi
fi
if $prompt_for_input ; then
if [ "$DACPREFIX" == "" ]; then
read -p " > ${prompt_color} An empty account used to represent various permission levels. All other DAC accounts will eventually point back to this (Authority Account):${reset} " dacauthority
else
dacauthority="${DACPREFIX}auth"
fi
fi
run_cmd "get account $dacauthority" &>/dev/null
if [ "$?" != "0" ]; then
read -p " > ${prompt_color} Would you like to create the dacauthority account ($dacauthority) now (Y/N)?${reset} " response
if [[ $response == "Y" || $response == "y" ]]; then
create_act $EOS_ACCOUNT $dacauthority $DAC_PUB
else
exit
fi
fi
if $prompt_for_input ; then
if [ "$DACPREFIX" == "" ]; then
read -p " > ${prompt_color} The token contract account (Token Account):${reset} " dactoken
else
dactoken="${DACPREFIX}tokn"
fi
fi
run_cmd "get account $dactoken" &>/dev/null
if [ "$?" != "0" ]; then
read -p " > ${prompt_color} Would you like to create the dactoken account ($dactoken) now (Y/N)?${reset} " response
if [[ $response == "Y" || $response == "y" ]]; then
create_act $EOS_ACCOUNT $dactoken $DAC_PUB
else
exit
fi
fi
if $prompt_for_input ; then
if [ "$DACPREFIX" == "" ]; then
read -p " > ${prompt_color} The money owning account. It is assumed that all tokens owned will be kept here (Owner Account):${reset} " dacowner
else
dacowner="${DACPREFIX}ownr"
fi
fi
run_cmd "get account $dacowner" &>/dev/null
if [ "$?" != "0" ]; then
read -p " > ${prompt_color} Would you like to create the dacowner account ($dacowner) now (Y/N)?${reset} " response
if [[ $response == "Y" || $response == "y" ]]; then
create_act $EOS_ACCOUNT $dacowner $DAC_PUB
else
exit
fi
fi
if $prompt_for_input ; then
dacservice=""
read -p " > ${prompt_color} Will your DAC use a service provider for legal contracts (Y/N)?${reset} " response
if [[ $response == "Y" || $response == "y" ]]; then
if [ "$DACPREFIX" == "" ]; then
read -p " > ${prompt_color} Service provider. If your DAC will not use a service provider, enter none. (Service Account):${reset} " dacservice
else
dacservice="${DACPREFIX}serv"
fi
fi
fi
if [[ "$dacservice" == "none" || "$dacservice" == "" ]]; then
dacservice=""
else
run_cmd "get account $dacservice" &>/dev/null
if [ "$?" != "0" ]; then
read -p " > ${prompt_color} Would you like to create the dacservice account ($dacservice) now (Y/N)?${reset} " response
if [[ $response == "Y" || $response == "y" ]]; then
create_act $EOS_ACCOUNT $dacservice $DAC_PUB
echo "Okay, let's hit that faucet again so we'll have enough EOS for RAM. This time put in the $dacservice account: https://monitor.jungletestnet.io/#home"
read -p "After you are done with the faucet, hit any key." response
run_cmd "transfer $dacservice $EOS_ACCOUNT \"100 EOS\" \"\" -p $dacservice"
else
exit
fi
fi
fi
if $prompt_for_input ; then
if [ "$DACPREFIX" == "" ]; then
read -p " > ${prompt_color} Multisig relay (Multisig Account):${reset} " dacmultisigs
else
dacmultisigs="${DACPREFIX}mult"
fi
fi
run_cmd "get account $dacmultisigs" &>/dev/null
if [ "$?" != "0" ]; then
read -p " > ${prompt_color} Would you like to create the dacmultisigs account ($dacmultisigs) now (Y/N)?${reset} " response
if [[ $response == "Y" || $response == "y" ]]; then
create_act $EOS_ACCOUNT $dacmultisigs $DAC_PUB
else
exit
fi
fi
if $prompt_for_input ; then
if [ "$DACPREFIX" == "" ]; then
read -p " > ${prompt_color} Worker Proposals account (Proposals Account):${reset} " dacproposals
else
dacproposals="${DACPREFIX}prop"
fi
fi
run_cmd "get account $dacproposals" &>/dev/null
if [ "$?" != "0" ]; then
read -p " > ${prompt_color} Would you like to create the dacproposals account ($dacproposals) now (Y/N)?${reset} " response
if [[ $response == "Y" || $response == "y" ]]; then
create_act $EOS_ACCOUNT $dacproposals $DAC_PUB
else
exit
fi
fi
echo "Set token contract on $dactoken ..."
run_cmd "set contract "$dactoken" "$DACCONTRACTS/_compiled_contracts/eosdactokens/jungle/eosdactokens" -p $dactoken"
if $prompt_for_input ; then
if [ "$TOKENSYBMOL" == "" ]; then
read -p " > ${prompt_color} What Token Symbol do you want to create for your DAC?${reset} " TOKENSYBMOL
fi
fi
token_stats="$(cleos --wallet-url $WALLET_URL -u $API_URL get currency stats $dactoken $TOKENSYBMOL)"
if [ "$token_stats" == "{}" ]; then
if $prompt_for_input ; then
read -p " > ${prompt_color} How many tokens do you want to create for your DAC?${reset} " DACTOKEN_COUNT_CREATE
read -p " > ${prompt_color} How many tokens do you want to issue for your DAC?${reset} " DACTOKEN_COUNT_ISSUE
fi
run_cmd "push action $dactoken create '[\"$dactoken\", \"$DACTOKEN_COUNT_CREATE.0000 $TOKENSYBMOL\", 0]' -p $dactoken"
run_cmd "push action $dactoken issue '[\"$dactoken\", \"$DACTOKEN_COUNT_ISSUE.0000 $TOKENSYBMOL\", \"Issue\"]' -p $dactoken"
else
echo "Token already created and issued."
echo "$token_stats"
fi
echo "Adjusting compile script for custodian contract..."
sed_compatible "s/kasdactokens/$dactoken/" "$DACCONTRACTS/_compiled_contracts/daccustodian/jungle/compile.sh"
echo "Compiling custodian contract..."
cd $DACCONTRACTS/daccustodian
./compile.sh
cd ../..
echo "Set custodian contract on $daccustodian ..."
run_cmd "set contract "$daccustodian" "$DACCONTRACTS/_compiled_contracts/daccustodian/jungle/daccustodian" -p $daccustodian"
echo "Adjusting compile script for multisig contract..."
sed_compatible "s/dacauthority/$dacauthority/" "$DACCONTRACTS/dacmultisigs/dacmultisigs.cpp"
sed_compatible "s/eosio.msig/eosiomsigold/" "$DACCONTRACTS/dacmultisigs/dacmultisigs.cpp"
echo "Compiling multisig contract..."
cd $DACCONTRACTS/dacmultisigs
./compile.sh
cd ../..
echo "Set multisig contract on $dacmultisigs ..."
run_cmd "set contract "$dacmultisigs" "$DACCONTRACTS/_compiled_contracts/dacmultisigs/dacmultisigs" -p $dacmultisigs"
echo "Set proposals contract on $dacproposals ..."
run_cmd "set contract "$dacproposals" "$DACCONTRACTS/_compiled_contracts/dacproposals/jungle/dacproposals" -p $dacproposals"
#if $prompt_for_input ; then
# echo ""
# echo "============================================================="
# echo "Time to see some configuration variables for your proposals contract. Just hit enter to go with the defaults"
# echo "============================================================="
# echo ""
# TODO: change this to "escrow_account" instead of service account?
#echo "What escrow account would you like to use for your DAC proposals system?"
#read -p " > ${prompt_color} service_account (): ${reset}" service_account
#if [ "$service_account" == "" ]; then
# service_account=""
#fi
# echo "Number of required votes to participate in voting for a proposal?"
# read -p " > ${prompt_color} proposal_threshold (3): ${reset}" proposal_threshold
# if [ "$proposal_threshold" == "" ]; then
# proposal_threshold="3"
# fi
# echo "Required percentage of positive votes to approve a proposal?"
# read -p " > ${prompt_color} proposal_approval_threshold_percent (50): ${reset}" proposal_approval_threshold_percent
# if [ "$proposal_approval_threshold_percent" == "" ]; then
# proposal_approval_threshold_percent="50"
# fi
# echo "Number of required votes to participate in voting for completing a proposal?"
# read -p " > ${prompt_color} claim_threshold (2): ${reset}" claim_threshold
# if [ "$claim_threshold" == "" ]; then
# claim_threshold="2"
# fi
# echo "Required percentage of positive votes to approve a proposal claim?"
# read -p " > ${prompt_color} claim_approval_threshold_percent (30): ${reset}" claim_approval_threshold_percent
# if [ "$claim_approval_threshold_percent" == "" ]; then
# claim_approval_threshold_percent="30"
# fi
# echo "The expiry time set on the created escrow transaction (number of seconds)? This has a default value of 30 days"
# read -p " > ${prompt_color} escrow_expiry (86400): ${reset}" escrow_expiry
# if [ "$escrow_expiry" == "" ]; then
# escrow_expiry="86400"
# fi
# echo "The approval expiry time set on the created escrow transaction (number of seconds)? This has a default value of 30 days"
# read -p " > ${prompt_color} approval_expiry (86400): ${reset}" approval_expiry
# if [ "$approval_expiry" == "" ]; then
# approval_expiry="86400"
# fi
#fi
# Commenting out for now as this requires dacdirectory integration to function.
#echo "Setting configuration on $dacproposals"
#echo "{\"new_config\": {\"service_account\": \"\",\"authority_account\": \"$dacauthority\",\"member_terms_account\": \"$dactoken\",\"treasury_account\": \"$dacowner\",\"proposal_threshold\": $proposal_threshold,\"claim_threshold\": 5,\"finalize_threshold\": 4,\"escrow_expiry\": $escrow_expiry, \"approval_expiry\": $approval_expiry}, \"dac_scope\": \"$dacproposals\"}" > proposal_config.json
#cat proposal_config.json
#config="$(cleos --wallet-url $WALLET_URL -u $API_URL get table $dacproposals $dacproposals config | grep rows | awk '{print $2}')"
#if [ "$config" == "[]," ]; then
# run_cmd "push action $dacproposals updateconfig proposal_config.json -p $dacproposals"
#else
# run_cmd "push action $dacproposals updateconfig proposal_config.json -p $dacauthority"
#fi
#rm -f proposal_config.json
if $prompt_for_input ; then
read -p " > ${prompt_color} Next you need a constitution. You can fork the github repo at https://github.com/eosdac/constitution to start, but ultimately you'll need to consult your own lawyers to ensure your DAC is set up according to your own legal needs. Once you have a raw markdown file of your constitution available online as a URL, enter that here. If you just want to start with our default, just hit enter to use https://raw.githubusercontent.com/eosdac/constitution/v4/constitution.md${reset}: " CONSTITUTION_URL
fi
if [ "$CONSTITUTION_URL" == "" ]; then
CONSTITUTION_URL="https://raw.githubusercontent.com/eosdac/constitution/v4/constitution.md"
fi
wget -O constitution.md "$CONSTITUTION_URL"
if [[ "$OSTYPE" == "darwin"* ]]; then
CON_MD5=$(md5 constitution.md | cut -d' ' -f4)
else
CON_MD5=$(md5sum constitution.md | cut -d' ' -f1)
fi
#echo "Constitution hash: $CON_MD5"
rm -f constitution.md
echo "[\"$CONSTITUTION_URL\", \"$CON_MD5\"]" > terms.json
cat terms.json
run_cmd "push action $dactoken newmemterms terms.json -p $dactoken"
rm -f terms.json
echo "[$daccustodian]" > token_config.json
run_cmd "push action $dactoken updateconfig token_config.json -p $dactoken"
rm -f token_config.json
if $prompt_for_input ; then
echo ""
echo "============================================================="
echo "Time to see some configuration variables for your DAC. Just hit enter to go with the defaults"
echo "============================================================="
echo ""
echo "How many $TOKENSYBMOL does a member need to lock up in order to register as a custodian candidate? This ensure candidates have skin in the game to protect the value of the $TOKENSYBMOL token which secures the DAC."
read -p " > ${prompt_color} lockupasset (35000): ${reset}" lockupasset
if [ "$lockupasset" == "" ]; then
lockupasset="35000"
fi
echo "How many votes does each member get when voting for custodians?"
read -p " > ${prompt_color} maxvotes (2): ${reset}" maxvotes
if [ "$maxvotes" == "" ]; then
maxvotes="2"
fi
echo "How many custodians will be elected to the custodian board?"
read -p " > ${prompt_color} numelected (5): ${reset}" numelected
if [ "$numelected" == "" ]; then
numelected="5"
fi
echo "How long will each custodian period be in seconds (default is 7 days, but you can set this to something small like 60 for testing)?"
read -p " > ${prompt_color} periodlength (604800):${reset} " periodlength
if [ "$periodlength" == "" ]; then
periodlength="604800"
fi
authaccount="$dacauthority"
tokenholder="$dacowner"
serviceprovider="$dacservice"
if [ "$serviceprovider" == "" ]; then
should_pay_via_service_provider=0
else
should_pay_via_service_provider=1
fi
echo "What percentage of tokens are needed for a quorum to initially launch the DAC?"
read -p " > ${prompt_color} initial_vote_quorum_percent (15): ${reset}" initial_vote_quorum_percent
if [ "$initial_vote_quorum_percent" == "" ]; then
initial_vote_quorum_percent="15"
fi
echo "Amount of token value in votes required to trigger the allow a new set of custodians to be set after the initial threshold has been achieved."
read -p " > ${prompt_color} vote_quorum_percent (10):${reset} " vote_quorum_percent
if [ "$vote_quorum_percent" == "" ]; then
vote_quorum_percent="10"
fi
echo "How many custodians are required to approve highest level actions?"
read -p " > ${prompt_color} auth_threshold_high (4)${reset}: " auth_threshold_high
if [ "$auth_threshold_high" == "" ]; then
auth_threshold_high="4"
fi
echo "How many custodians are required to approve mid actions?"
read -p " > ${prompt_color} auth_threshold_mid (3):${reset} " auth_threshold_mid
if [ "$auth_threshold_mid" == "" ]; then
auth_threshold_mid="3"
fi
echo "How many custodians are required to approve low actions?"
read -p " > ${prompt_color} auth_threshold_low (2): ${reset}" auth_threshold_low
if [ "$auth_threshold_low" == "" ]; then
auth_threshold_low="2"
fi
echo "How much time before locked up stake can be released back to the candidate using the unstake action (defaults to 90 days)?"
read -p " > ${prompt_color} lockup_release_time_delay (7776000): ${reset}" lockup_release_time_delay
if [ "$lockup_release_time_delay" == "" ]; then
lockup_release_time_delay="7776000"
fi
echo "What is the maximum amount of $TOKENSYBMOL pay a custodian can request as a candidate?"
read -p " > ${prompt_color} requested_pay_max (50): ${reset}" requested_pay_max
if [ "$requested_pay_max" == "" ]; then
requested_pay_max="50"
fi
fi
echo "[[\"$lockupasset.0000 $TOKENSYBMOL\", $maxvotes, $numelected, $periodlength, \"$authaccount\", \"$tokenholder\", \"$serviceprovider\", $should_pay_via_service_provider, $initial_vote_quorum_percent, $vote_quorum_percent, $auth_threshold_high, $auth_threshold_mid, $auth_threshold_low, $lockup_release_time_delay, \"$requested_pay_max.0000 $TOKENSYBMOL\"]]" > dac_config.json
echo "Setting dac configuration on $daccustodian"
cat dac_config.json
config="$(cleos --wallet-url $WALLET_URL -u $API_URL get table $daccustodian $daccustodian config | grep rows | awk '{print $2}')"
if [ "$config" == "[]," ]; then
run_cmd "push action $daccustodian updateconfig dac_config.json -p $daccustodian"
else
run_cmd "push action $daccustodian updateconfig dac_config.json -p $dacauthority"
fi
rm -f dac_config.json
echo "== Set up DAC client =="
cd eosdac-client
yarn
if [ -z "$(ls -A ./src/extensions)" ]; then
yarn add_extensions $extensions_github extensions
fi
echo "Modify DAC client config..."
cat > ./src/extensions/statics/config/build.config.json <<EOL
{
"host_no_backslash": "http://localhost:8080",
"meta_description": "Come to the $dacname Member Client to register and interact with your Decentralized Autonomous Community."
}
EOL
# TODO: add bot
#sed_compatible "s/piecesnbitss/piecesnbitss/" "./src/extensions/statics/config/config.jungle.json"
# TODO: add escrow
#sed_compatible "s/eosdacescrow/eosdacescrow/" "./src/extensions/statics/config/config.jungle.json"
cat > ./src/extensions/statics/config/config.jungle.json <<EOL
{
"dacName": "$DACPREFIX",
"dacScope": "$DACPREFIX",
"contracts": {
"token": {
"name": "$dactoken",
"symbol": "$TOKENSYBMOL",
"totalSupply": $DACTOKEN_COUNT_CREATE.0000,
"decimals": 4
},
"system_token": {
"name": "eosio.token",
"symbol": "EOS",
"decimals": 4
},
"custodian": {
"name": "$daccustodian",
"memo": "$daccustodian",
"enable_voting" : true
},
"bot":{
"name": "piecesnbitss"
},
"system_msig": {
"name": "eosiomsigold"
},
"dac_msig": {
"name": "$dacmultisigs"
},
"wpproposal":{
"name": "$dacproposals"
},
"escrow":{
"name": "eosdacescrow"
}
},
"bpAccount": {
"name": "eosdacserval"
},
"treasuryAccount":{
"name": "$dacowner"
},
"authAccount": {
"name": "dacfac24auth",
"controlling": [
{
"name":"$dacowner",
"linkedAuths": [
{"contract": "eosio.token", "action": "transfer", "permission": "xfer", "label": "Transfer EOS"}
]
},
{
"name":"$daccustodian",
"linkedAuths": [
{"contract": "$dactoken", "action": "transfer", "permission": "xfer", "label": "Transfer DACFAC"}
]
},
{
"name":"$dactoken",
"linkedAuths": [
{"contract": "$dactoken", "action": "newmemterms", "permission": "active", "label": "Update Constitution"}
]
},
{
"name":"$dacauthority",
"linkedAuths":[
{"contract": "$daccustodian", "action": "firecust", "permission": "med", "label": "Fire Custodian"},
{"contract": "$daccustodian", "action": "firecand", "permission": "med", "label": "Fire Candidate"}
]
}
]
},
"api": {
"default_eos_node": "https://jungle2.cryptolions.io:443",
"bpnodes": "https://eosdac.io/topnodes.json",
"memberclient": "",
"memberclient_state_api": "http://localhost:8383/v1/eosdac",
"hyperion": "https://jungle.hyperion.eosrio.io/v2/state",
"firehose": "ws://jungle.eosdac.io:1337"
},
"external":{
"homepage": "https://eosdac.io",
"explorer": "https://jungle.bloks.io"
}
}
EOL
echo "Building dac client with quasar build..."
quasar build
cd ..
echo "Building eosio-statereceiver..."
cd eosio-statereceiver
npm install
cd ..
echo "Configuring eosdac-api..."
cd eosdac-api
npm install
cat > jungle.config.js <<EOL
module.exports = {
fillClusterSize: 4,
clusterSize: 10,
mongo: {
url: 'mongodb://localhost:27017',
dbName: '$DACPREFIX',
traceCollection: 'traces',
stateCollection: 'states'
},
amq: {
connectionString: 'amqp://guest:guest@localhost/'
},
eos: {
contracts: ['$dactoken', '$daccustodian', '$dacowner', '$dacmultisigs', 'eosiomsigold'],
chainId: "e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473",
endpoint: 'http://jungle2.eosdac.io:8882',
wsEndpoint: 'ws://jungle2.eosdac.io:8080',
authContract: '$dacauthority',
msigContract: 'eosiomsigold',
custodianContract: '$daccustodian',
dacMsigContract: '$dacmultisigs',
proposalsContract: '$dacproposals',
dacGenesisBlock: $LIB // the first block that includes any dac contract actions including the initial setcode
}
};
EOL
cat > ecosystem.config.js <<EOL
module.exports = {
apps: [
{
name: "eosdac-filler-jungle",
script: "./eosdac-filler.js",
node_args: ["--max-old-space-size=8192"],
autorestart: true,
kill_timeout: 3600,
env: {
'CONFIG': 'jungle'
}
},
{
name: 'eosdac-processor-jungle',
script: "./eosdac-processor.js",
autorestart: true,
env: {
'CONFIG': 'jungle'
}
},
{
name: 'eosdac-api-jungle',
script: "./eosdac-api.js",
autorestart: true,
env: {
'CONFIG': 'jungle',
'SERVER_PORT': 8383,
'SERVER_ADDR': '0.0.0.0',
'HOST_NAME': 'localhost'
}
}
]
};
EOL
cd ..
echo "Configuring permissions..."
echo "{
\"threshold\" : 1,
\"keys\" : [],
\"accounts\": [{\"permission\":{\"actor\":\"$dacauthority\", \"permission\":\"active\"}, \"weight\":1}],
\"waits\": []
}" > resign.json
echo "{
\"threshold\": 2,
\"keys\": [],
\"accounts\": [
{\"permission\":{\"actor\":\"$dacauthority\", \"permission\":\"med\"}, \"weight\":2},
{\"permission\":{\"actor\":\"$daccustodian\", \"permission\":\"eosio.code\"}, \"weight\":1}
],
\"waits\": [{\"wait_sec\":3600, \"weight\":1}]
}" > daccustodian_transfer.json
## NOTE: When you are confident, change the keys part to just []
echo "{
\"threshold\": 1,
\"keys\": [{\"key\":\"$DAC_PUB\", \"weight\":1}],
\"accounts\": [
{\"permission\":{\"actor\":\"$dacauthority\", \"permission\":\"high\"}, \"weight\":1}
],
\"waits\": []
}" > dacauthority_active.json
## NOTE: When you are confident, change the keys part to just []
echo "{
\"threshold\": 1,
\"keys\": [{\"key\":\"$DAC_PUB\", \"weight\":1}],
\"accounts\": [
{\"permission\":{\"actor\":\"$daccustodian\", \"permission\":\"eosio.code\"}, \"weight\":1}
],
\"waits\": []
}" > dacauthority_owner.json
# These have to be set now because they are required in daccustodian_transfer.json
# These permissions are set in new period to the custodians with each configured threshold
run_cmd "set account permission $dacauthority high $DAC_PUB active -p $dacauthority@owner"
run_cmd "set account permission $dacauthority med $DAC_PUB high -p $dacauthority@owner"
run_cmd "set account permission $dacauthority low $DAC_PUB med -p $dacauthority@owner"
run_cmd "set account permission $dacauthority one $DAC_PUB low -p $dacauthority@owner"
# resign dactokens account to dacauthority@active
run_cmd "set account permission $dactoken active ./resign.json owner -p $dactoken@owner"
run_cmd "set account permission $dactoken owner ./resign.json '' -p $dactoken@owner"
# resign dacmultisigs account to dacauthority@active
run_cmd "set account permission $dacmultisigs active ./resign.json owner -p $dacmultisigs@owner"
run_cmd "set account permission $dacmultisigs owner ./resign.json '' -p $dacmultisigs@owner"
# resign dacowner account to dacauthority@active, must allow timelocked transfers
# from [email protected]
# daccustodian_transfer.json allows the contract to make transfers with a time delay, or
# dacauthority@med without a time delay. dacowner must have permission in xfer to transfer tokens
run_cmd "set account permission $dacowner xfer ./daccustodian_transfer.json active -p $dacowner@owner"
run_cmd "set action permission $dacowner eosio.token transfer xfer -p $dacowner@owner"
# Resign eosdacthedac
run_cmd "set account permission $dacowner active ./resign.json owner -p $dacowner@owner"
run_cmd "set account permission $dacowner owner ./resign.json '' -p $dacowner@owner"
# Create xfer permission and give it permission to transfer TESTDAC tokens
run_cmd "set account permission $daccustodian xfer ./daccustodian_transfer.json active -p $daccustodian@owner"
run_cmd "set action permission $daccustodian $dactoken transfer xfer -p $daccustodian@owner"
# Resign daccustodian
run_cmd "set account permission $daccustodian active ./resign.json owner -p $daccustodian@owner"
run_cmd "set account permission $daccustodian owner ./resign.json '' -p $daccustodian@owner"
# Allow high to call any action on daccustodian
run_cmd "set action permission $dacauthority $daccustodian '' high -p $dacauthority@owner"
# These 2 actions require a medium permission
run_cmd "set action permission $dacauthority $daccustodian firecust med -p $dacauthority@owner"
run_cmd "set action permission $dacauthority $daccustodian firecand med -p $dacauthority@owner"
# Allow one to call the multisig actions
run_cmd "set action permission $dacauthority $dacmultisigs '' one -p $dacauthority@owner"
# set dacauthority@active to point to [email protected]
run_cmd "set account permission $dacauthority active ./dacauthority_active.json owner -p $dacauthority@owner"
run_cmd "set account permission $dacauthority owner ./dacauthority_owner.json "" -p $dacauthority@owner"
rm ./resign.json
rm ./daccustodian_transfer.json
rm ./dacauthority_active.json
rm ./dacauthority_owner.json
if [[ ($prompt_for_input == true || "$create_test_custodians" == "") && DACPREFIX != "" ]]; then
read -p " > ${prompt_color} Would you like to create test custodians, vote them in, and call new period to activate the DAC? (Y/N) ${reset}" create_test_custodians
if [[ $create_test_custodians == "Y" || $create_test_custodians == "y" ]]; then
create_test_custodians="Y"
else
create_test_custodians="N"
fi
fi
if [[ "$create_test_custodians" == "Y" && DACPREFIX != "" ]]; then
if [[ "$CUSTODIAN_PVT" == "" && "$CUSTODIAN_PUB" == "" ]]; then
echo "Generating keys for custodians..."
CUSTODIAN_KEYS="$(cleos create key --to-console | awk '{ print $3 }')"
CUSTODIAN_PVT="$(echo $CUSTODIAN_KEYS | head -n1 | awk '{print $1;}')"
CUSTODIAN_PUB="$(echo $CUSTODIAN_KEYS | head -n1 | awk '{print $2;}')"
read -p " > ${prompt_color} Are you ready to view a private key on screen and save it securely (Y/N)?:${reset} " response
if [[ "$response" == "Y" || "$response" == "y" ]]; then
echo "Private Key: $CUSTODIAN_PVT"
read -p " > ${prompt_color} Press any key to clear the screen and continue${reset}" response
clear
echo " > ${prompt_color} Please verify your private key:${reset} "
read -s response
if [[ $response != $CUSTODIAN_PVT ]]; then
echo "Private Key does not match!"
exit
fi
echo "Public Key: $CUSTODIAN_PUB"
read -p " > ${prompt_color} Please verify your public key:${reset} " response
if [[ $response != $CUSTODIAN_PUB ]]; then
echo "Public Key does not match!"
exit
fi
else
exit
fi
fi
# TODO: loop through and create as many custodians as needed based on the config
# TODO: for now, just create 5
custodian1="${DACPREFIX}cu11"
run_cmd "get account $custodian1" &>/dev/null
if [ "$?" != "0" ]; then
# Do a bit of hacky work on the first one.
run_cmd "wallet unlock --name $EOS_ACCOUNT < $EOS_ACCOUNT.wallet_password"
run_cmd "wallet import --name $EOS_ACCOUNT --private-key $CUSTODIAN_PVT"
echo "Before we continue, let's hit the faucet so we'll have enough EOS for RAM. This time put in the $dactoken account: https://monitor.jungletestnet.io/#home"
read -p "After you are done with the faucet, hit any key." response
run_cmd "transfer $dactoken $EOS_ACCOUNT \"100 EOS\" \"\" -p $dactoken"
echo "And one more time with the faucet for the $dacowner account: https://monitor.jungletestnet.io/#home"
read -p "After you are done with the faucet, hit any key." response
run_cmd "transfer $dacowner $EOS_ACCOUNT \"100 EOS\" \"\" -p $dacowner"
read -p " > ${prompt_color} How many tokens would you like to transfer to each of your test custodians? Keep in mind you have $DACTOKEN_COUNT_ISSUE tokens and need $initial_vote_quorum_percent percent used to launch the DAC. ${reset}" test_custodian_transfer_amount
create_act $EOS_ACCOUNT $custodian1 $CUSTODIAN_PUB
## TODO: adjust the amount transferred based on settings to reach active DAC
run_cmd "transfer -c $dactoken $dactoken $custodian1 \"$test_custodian_transfer_amount.0000 $TOKENSYBMOL\" \"$custodian1\" -p $dactoken"
run_cmd "push action $dactoken memberreg '[\"$custodian1\", \"$CON_MD5\"]' -p $custodian1"
run_cmd "transfer -c $dactoken $custodian1 $daccustodian \"$lockupasset.0000 $TOKENSYBMOL\" \"$daccustodian\" -p $custodian1"
run_cmd "push action $daccustodian nominatecand '[\"$custodian1\", \"1.0000 $TOKENSYBMOL\"]' -p $custodian1"
run_cmd "push action $daccustodian votecust '[\"$custodian1\",[\"$custodian1\"]]' -p $custodian1"
fi
custodian2="${DACPREFIX}cu12"
run_cmd "get account $custodian2" &>/dev/null
if [ "$?" != "0" ]; then
create_act $EOS_ACCOUNT $custodian2 $CUSTODIAN_PUB
run_cmd "transfer -c $dactoken $dactoken $custodian2 \"$test_custodian_transfer_amount.0000 $TOKENSYBMOL\" \"$custodian2\" -p $dactoken"
run_cmd "push action $dactoken memberreg '[\"$custodian2\", \"$CON_MD5\"]' -p $custodian2"
run_cmd "transfer -c $dactoken $custodian2 $daccustodian \"$lockupasset.0000 $TOKENSYBMOL\" \"$daccustodian\" -p $custodian2"
run_cmd "push action $daccustodian nominatecand '[\"$custodian2\", \"1.0000 $TOKENSYBMOL\"]' -p $custodian2"
run_cmd "push action $daccustodian votecust '[\"$custodian2\",[\"$custodian2\"]]' -p $custodian2"
fi
custodian3="${DACPREFIX}cu13"
run_cmd "get account $custodian3" &>/dev/null
if [ "$?" != "0" ]; then
create_act $EOS_ACCOUNT $custodian3 $CUSTODIAN_PUB
run_cmd "transfer -c $dactoken $dactoken $custodian3 \"$test_custodian_transfer_amount.0000 $TOKENSYBMOL\" \"$custodian3\" -p $dactoken"
run_cmd "push action $dactoken memberreg '[\"$custodian3\", \"$CON_MD5\"]' -p $custodian3"
run_cmd "transfer -c $dactoken $custodian3 $daccustodian \"$lockupasset.0000 $TOKENSYBMOL\" \"$daccustodian\" -p $custodian3"
run_cmd "push action $daccustodian nominatecand '[\"$custodian3\", \"1.0000 $TOKENSYBMOL\"]' -p $custodian3"
run_cmd "push action $daccustodian votecust '[\"$custodian3\",[\"$custodian3\"]]' -p $custodian3"
fi
custodian4="${DACPREFIX}cu14"
run_cmd "get account $custodian4" &>/dev/null
if [ "$?" != "0" ]; then
create_act $EOS_ACCOUNT $custodian4 $CUSTODIAN_PUB
run_cmd "transfer -c $dactoken $dactoken $custodian4 \"$test_custodian_transfer_amount.0000 $TOKENSYBMOL\" \"$custodian4\" -p $dactoken"
run_cmd "push action $dactoken memberreg '[\"$custodian4\", \"$CON_MD5\"]' -p $custodian4"
run_cmd "transfer -c $dactoken $custodian4 $daccustodian \"$lockupasset.0000 $TOKENSYBMOL\" \"$daccustodian\" -p $custodian4"
run_cmd "push action $daccustodian nominatecand '[\"$custodian4\", \"1.0000 $TOKENSYBMOL\"]' -p $custodian4"
run_cmd "push action $daccustodian votecust '[\"$custodian4\",[\"$custodian4\"]]' -p $custodian4"
fi
custodian5="${DACPREFIX}cu15"
run_cmd "get account $custodian5" &>/dev/null
if [ "$?" != "0" ]; then
create_act $EOS_ACCOUNT $custodian5 $CUSTODIAN_PUB
## TODO: adjust the amount transferred based on settings to reach active DAC
run_cmd "transfer -c $dactoken $dactoken $custodian5 \"$test_custodian_transfer_amount.0000 $TOKENSYBMOL\" \"$custodian5\" -p $dactoken"
run_cmd "push action $dactoken memberreg '[\"$custodian5\", \"$CON_MD5\"]' -p $custodian5"
run_cmd "transfer -c $dactoken $custodian5 $daccustodian \"$lockupasset.0000 $TOKENSYBMOL\" \"$daccustodian\" -p $custodian5"
run_cmd "push action $daccustodian nominatecand '[\"$custodian5\", \"1.0000 $TOKENSYBMOL\"]' -p $custodian5"
run_cmd "push action $daccustodian votecust '[\"$custodian5\",[\"$custodian5\"]]' -p $custodian5"
fi
fi
run_cmd "push action $daccustodian newperiod '{\"message\":\"New Period\"}' -p $daccustodian"
echo ""
echo ""
echo ""
echo "====== CONGRATULATIONS! ======"
echo ""
echo ""
echo ""
echo "Next you'll want to get mongod running, along with the DAC API and the memberclient."
read -p " > ${prompt_color} Would you like to save all your DAC variables to dac_conf.sh so you can easily run this again? Note, this will include your private key. (Y/N)?${reset} " response
if [[ "$response" == "Y" || "$response" == "y" ]]; then
echo "" > dac_conf.sh
echo "dacname=\"$dacname\"" >> dac_conf.sh
echo "DAC_PVT=\"$DAC_PVT\"" >> dac_conf.sh
echo "DAC_PUB=\"$DAC_PUB\"" >> dac_conf.sh
echo "EOS_ACCOUNT=\"$EOS_ACCOUNT\"" >> dac_conf.sh
echo "DACPREFIX=\"$DACPREFIX\"" >> dac_conf.sh
echo "daccustodian=\"$daccustodian\"" >> dac_conf.sh
echo "dacauthority=\"$dacauthority\"" >> dac_conf.sh
echo "dactoken=\"$dactoken\"" >> dac_conf.sh
echo "dacowner=\"$dacowner\"" >> dac_conf.sh
echo "dacservice=\"$dacservice\"" >> dac_conf.sh
echo "dacmultisigs=\"$dacmultisigs\"" >> dac_conf.sh
echo "dacproposals=\"$dacproposals\"" >> dac_conf.sh
echo "TOKENSYBMOL=\"$TOKENSYBMOL\"" >> dac_conf.sh
echo "DACTOKEN_COUNT_CREATE=\"$DACTOKEN_COUNT_CREATE\"" >> dac_conf.sh
echo "DACTOKEN_COUNT_ISSUE=\"$DACTOKEN_COUNT_ISSUE\"" >> dac_conf.sh
echo "CONSTITUTION_URL=\"$CONSTITUTION_URL\"" >> dac_conf.sh
echo "CON_MD5=\"$CON_MD5\"" >> dac_conf.sh
echo "lockupasset=\"$lockupasset\"" >> dac_conf.sh
echo "maxvotes=\"$maxvotes\"" >> dac_conf.sh
echo "numelected=\"$numelected\"" >> dac_conf.sh
echo "periodlength=\"$periodlength\"" >> dac_conf.sh
echo "authaccount=\"$authaccount\"" >> dac_conf.sh
echo "tokenholder=\"$tokenholder\"" >> dac_conf.sh
echo "serviceprovider=\"$serviceprovider\"" >> dac_conf.sh
echo "should_pay_via_service_provider=\"$should_pay_via_service_provider\"" >> dac_conf.sh
echo "initial_vote_quorum_percent=\"$initial_vote_quorum_percent\"" >> dac_conf.sh
echo "vote_quorum_percent=\"$vote_quorum_percent\"" >> dac_conf.sh
echo "auth_threshold_high=\"$auth_threshold_high\"" >> dac_conf.sh
echo "auth_threshold_mid=\"$auth_threshold_mid\"" >> dac_conf.sh
echo "auth_threshold_low=\"$auth_threshold_low\"" >> dac_conf.sh
echo "lockup_release_time_delay=\"$lockup_release_time_delay\"" >> dac_conf.sh
echo "requested_pay_max=\"$requested_pay_max\"" >> dac_conf.sh
# echo "proposal_threshold=\"$proposal_threshold\"" >> dac_conf.sh
# echo "proposal_approval_threshold_percent=\"$proposal_approval_threshold_percent\"" >> dac_conf.sh
# echo "claim_threshold=\"$claim_threshold\"" >> dac_conf.sh
# echo "claim_approval_threshold_percent=\"$claim_approval_threshold_percent\"" >> dac_conf.sh
# echo "escrow_expiry=\"$escrow_expiry\"" >> dac_conf.sh
# echo "approval_expiry=\"$approval_expiry\"" >> dac_conf.sh
echo "create_test_custodians=\"$create_test_custodians\"" >> dac_conf.sh
echo "CUSTODIAN_PVT=\"$CUSTODIAN_PVT\"" >> dac_conf.sh
echo "CUSTODIAN_PUB=\"$CUSTODIAN_PUB\"" >> dac_conf.sh
echo "test_custodian_transfer_amount=\"$test_custodian_transfer_amount\"" >> dac_conf.sh
echo "extensions_github=\"$extensions_github\"" >> dac_conf.sh
echo "LIB=\"$LIB\"" >> dac_conf.sh
echo "dac_conf.sh saved. Please be careful with this file as it contains your private key.\n"
fi
echo "\nNow start mongod, run pm2 start in the eosdac-api folder, and then run DEFAULT_NETWORK=jungle quasar dev from the eosdac-client folder.\n"