├── .gitignore ├── 0-README-communication-channels.org ├── 0-README-setup.org ├── 01-start-node-testnet ├── config │ ├── testnet-alonzo-genesis.json │ ├── testnet-byron-genesis.json │ ├── testnet-config.json │ ├── testnet-shelley-genesis.json │ └── testnet-topology.json ├── start-node-testnet └── start-node-testnet.org ├── 02-cardano-cli-example ├── .gitignore ├── cardano-cli-example.org └── send ├── 03-start-testnet-wallet ├── start-testnet-wallet └── start-testnet-wallet.org ├── 04-create-and-fund-wallet ├── TestName-wallet-addr ├── TestName-wallet-recovery-info.json ├── WALLET-2022-04-20-12-47-49-addr ├── WALLET-2022-04-20-12-47-49-recovery-info.json ├── create-and-fund-wallet.org ├── create-wallet-recovery-info └── load-wallet ├── 05-start-testnet-chain-index ├── chain-index-config.json └── start-testnet-chain-index.org ├── 06-pab └── pab.org ├── Lecture-01 ├── .gitignore └── Lecture-01.org ├── Lecture-02 ├── .gitignore ├── Gift.hs ├── Lecture-02.org └── Typed.hs ├── Lecture-03 ├── .gitignore ├── Deploy.hs ├── Lecture-03.org ├── Parameterized.hs ├── Vesting.hs └── testnet │ ├── 01.addr │ ├── 01.skey │ ├── 01.vkey │ ├── 02.addr │ ├── 02.pkh │ ├── 02.skey │ ├── 02.vkey │ ├── give.sh │ ├── grab.sh │ ├── protocol.json │ ├── send.sh │ ├── start-node-testnet.sh │ ├── testnet-alonzo-genesis.json │ ├── testnet-byron-genesis.json │ ├── testnet-config.json │ ├── testnet-shelley-genesis.json │ ├── testnet-topology.json │ ├── unit.json │ ├── vesting.addr │ └── vesting.plutus ├── Lecture-04 ├── .gitignore ├── Contract.hs ├── Lecture-04.org └── Trace.hs ├── Lecture-05 ├── Free.hs ├── Homework1.hs ├── Homework2.hs ├── Lecture-05.org ├── NFT.hs └── Signed.hs ├── Lecture-06 ├── .gitignore ├── Lecture-06.org ├── OffChain.hs └── testnet │ ├── chain-index-config.json │ ├── pab-config.yml │ └── restore-wallet.json ├── Lecture-07 ├── EvenOdd.hs ├── Lecture-07.org ├── RockPaperScissors.hs └── StateMachine.hs ├── Lecture-08 ├── Lecture-08.org └── TokenSale.png ├── Lecture-09 └── Lecture-09.org ├── Lecture-10 ├── Lecture-10.org ├── Staking.hs └── plutus-apps-shell.nix-lecture-10 ├── README.org └── hc-cardano.env /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | dist-* 3 | cabal-dev 4 | *.o 5 | *.hi 6 | *.hie 7 | *.chi 8 | *.chs.h 9 | *.dyn_o 10 | *.dyn_hi 11 | .hpc 12 | .hsenv 13 | .cabal-sandbox/ 14 | cabal.sandbox.config 15 | *.prof 16 | *.aux 17 | *.hp 18 | *.eventlog 19 | .stack-work/ 20 | cabal.project.local 21 | cabal.project.local~ 22 | .HTF/ 23 | .ghc.environment.* 24 | plutus-libs-tweag 25 | *.html 26 | *~ -------------------------------------------------------------------------------- /0-README-communication-channels.org: -------------------------------------------------------------------------------- 1 | Pioneers Third Cohort 2 | 3 | - Discord 4 | place to discuss course with others 5 | https://discord.com/channels/826816523368005654/862912746847993887 6 | 7 | - Canvas 8 | where course materials aggregated 9 | https://canvas.instructure.com/courses/4089198 10 | 11 | - Cardano Stack Exchange (CSE) 12 | post questions and record solutions 13 | https://cardano.stackexchange.com/ 14 | https://cardano.stackexchange.com/questions/tagged/plutus-pioneer-program?tab=Newest 15 | 16 | - Github 17 | Plutus code for each module 18 | https://github.com/input-output-hk/plutus-pioneer-program 19 | 20 | -------------------------------------------------------------------------------- /0-README-setup.org: -------------------------------------------------------------------------------- 1 | #+OPTIONS: H:6 num:nil toc:nil \n:nil @:t ::t |:t ^:t f:t TeX:t ... 2 | 3 | ------------------------------------------------------------------------------ 4 | * Plutus Env: Setup Starter Pack 5 | 6 | https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#heading=h.hf7iqqtf4s2t 7 | 8 | https://playground.plutus.iohkdev.io/ 9 | - easiest : the online playground 10 | 11 | ** local Plutus development environment 12 | 13 | https://docs.plutus-community.com/ 14 | - PROS : detailed setup guide for various OS (Linux, Mac, Windows) 15 | - CONS : later material (lectures and PAB related stuff) is mostly obsolete 16 | 17 | https://developers.cardano.org/docs/smart-contracts/plutus/ 18 | - PROS : focused on big picture explanations of plutus 19 | - CONS : not user friendly 20 | 21 | https://github.com/input-output-hk/plutus-apps 22 | - PROS : the canonical source; sparse but reliable instructions on installing plutus applications 23 | with NIX (e.g., Plutus Playground or Plutus PAB) 24 | What the development team uses. 25 | - CONS : requires Nix 26 | 27 | https://github.com/input-output-hk/plutus-starter 28 | - PROS : for users of VSCode and Docker 29 | - CONS : ditto 30 | 31 | some of the above may be out-of-date 32 | 33 | ------------------------------------------------------------------------------ 34 | * initial setup for Plutus Playground local instance 35 | 36 | To set up a local instance (assumes Nix already installed). 37 | 38 | This worked for 39 | - MacBook Pro (13-inch 2019, Four Thunderbolt 3 ports) 40 | - Processor 2.8 GHz Quad-Core Intel Core i7 41 | - Memory 16GB 2133 MHz LPDDR3 42 | - nix (Nix) 2.5.1 43 | 44 | from 45 | - https://github.com/renzwo/cardano-plutus-apps-install-m1 46 | - =ff71ab6ddd158105ef413f1c8d8cb29bec9714b3= 47 | 48 | edit =/etc/nix/nix.conf= to contain 49 | 50 | #+begin_comment 51 |  (eepitch-shell) 52 |  (eepitch-kill) 53 |  (eepitch-shell) 54 | #+end_comment 55 | 56 | #+begin_src 57 | export C=~/Cardano 58 | #+end_src 59 | 60 | 61 | #+begin_src 62 | build-users-group = nixbld 63 | 64 | substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ 65 | trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= 66 | 67 | system = x86_64-darwin 68 | extra-platforms = x86_64-darwin aarch64-darwin 69 | 70 | sandbox = false 71 | extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env 72 | experimental-features = nix-command 73 | extra-experimental-features = flakes 74 | #+end_src 75 | 76 | restart mac 77 | 78 | #+begin_src 79 | mkdir ${C} 80 | cd ${C} 81 | git clone https://github.com/input-output-hk/plutus-apps 82 | cd plutus-apps 83 | git checkout 829a409ba34bae36c6d99f50e099b0a177d76ceb 84 | # if segfault, try again: 85 | nix-build -A plutus-playground.server 86 | # if errors, try again 87 | nix-build -A plutus-playground.client 88 | nix-shell 89 | cd plutus-playground-server 90 | # if problems, try again 91 | GC_DONT_GC=1 plutus-playground-server 92 | # when success, will print: 93 | plutus-playground-server: for development use only 94 | [Info] Running: (Nothing,Webserver {_port = 8080, _maxInterpretationTime = 80s}) 95 | Initializing Context 96 | Initializing Context 97 | Warning: GITHUB_CLIENT_ID not set 98 | Warning: GITHUB_CLIENT_SECRET not set 99 | Warning: JWT_SIGNATURE not set 100 | Interpreter ready 101 | #+end_src 102 | 103 | in another terminal 104 | 105 | #+begin_src 106 | cd ${C}/plutus-apps 107 | nix-shell 108 | sudo npm install -g npm 109 | cd plutus-playground-client 110 | GC_DONT_GC=1 npm run start 111 | # when success, will print: 112 | webpack compiled with 1 warning 113 | ℹ 「wdm」: Compiled with warnings. 114 | #+end_src 115 | 116 | if the client takes to long, see renzwo about timeouts 117 | 118 | in browser 119 | 120 | #+begin_src 121 | https://localhost:8009/ 122 | #+end_src 123 | 124 | ------------------------------------------------------------------------------ 125 | <> 126 | * weekly steps (after doing above initial steps) 127 | 128 | ** pull and checkout tag 129 | 130 | #+begin_src 131 | cd ${C}/plutus-pioneer-program 132 | git checkout main 133 | git pull 134 | # ?? == number of the week/lecture 135 | cd ${C}/plutus-pioneer-program/code/week?? 136 | TAG=`cat ./cabal.project | grep -A 1 "https://github.com/input-output-hk/plutus-apps" | grep tag | cut -d':' -f2` 137 | echo ${TAG} 138 | cd ${C}/plutus-apps 139 | git checkout main 140 | git pull 141 | git checkout ${TAG} 142 | #+end_src 143 | 144 | ** =cabal repl= 145 | 146 | To do =cabal repl= for a particular week: 147 | 148 | #+begin_src 149 | cd ${C}/plutus-apps 150 | nix-shell 151 | cd ${C}/plutus-pioneer-program/code/week??/ 152 | cabal clean 153 | cabal update 154 | cabal build 155 | cabal repl 156 | #+end_src 157 | 158 | ** playground 159 | 160 | The following steps are only needed to use the playground. 161 | 162 | They are not needed for using =cabal repl=. 163 | 164 | #+begin_src 165 | nix-build -A plutus-playground.server 166 | nix-shell 167 | cd plutus-playground-server/ 168 | plutus-playground-server 169 | 170 | -------------------------- 171 | 172 | # in another terminal 173 | cd ${C}/plutus-apps 174 | nix-shell 175 | cd plutus-playground-client 176 | # start Plutus Playground Client 177 | npm run start 178 | #+end_src 179 | 180 | ------------------------------------------------------------------------------ 181 | * a problem and solution/hack 182 | 183 | When I was trying to do =cabal repl= for Week4, I had the following problem: 184 | 185 | #+begin_src 186 | > cd ${C}/plutus-apps 187 | 188 | > git checkout ea1bfc6a49ee731c67ada3bfb326ee798001701a 189 | HEAD is now at ea1bfc6a4 SCP-3305 reverted #57 (#275) 190 | 191 | > nix-shell 192 | ... 193 | 194 | [nix-shell:~/plutus-apps]$ cd ../plutus-pioneer-program/code/week04/ 195 | 196 | # note: I also tried 197 | # cabal clean; cabal update; cabal build 198 | # before this next step, but ended up with the same problem 199 | 200 | [nix-shell:~/plutus-pioneer-program/code/week04]$ cabal repl 201 | Build profile: -w ghc-8.10.4.20210212 -O1 202 | In order, the following will be built (use -v for more details): 203 | - cardano-ledger-shelley-0.1.0.0 (lib) (requires build) 204 | - plutus-core-0.1.0.0 (lib) (requires build) 205 | ... 206 | Starting plutus-core-0.1.0.0 (lib) 207 | Starting cardano-ledger-shelley-0.1.0.0 (lib) 208 | Building cardano-ledger-shelley-0.1.0.0 (lib) 209 | Installing cardano-ledger-shelley-0.1.0.0 (lib) 210 | Completed cardano-ledger-shelley-0.1.0.0 (lib) 211 | 212 | Failed to build plutus-core-0.1.0.0. The failure occurred during the configure 213 | step. 214 | Build log ( 215 | /Users/hcarr/.cabal/logs/ghc-8.10.4.20210212/plts-cr-0.1.0.0-ae5e7239.log ): 216 | Configuring library for plutus-core-0.1.0.0.. 217 | cabal: The program 'happy' version >=1.17.1 is required but the version of 218 | /Users/hcarr/.cabal/store/ghc-8.10.4.20210212/hppy-1.20.0-a2383844/bin/happy 219 | could not be determined. 220 | 221 | cabal: Failed to build plutus-core-0.1.0.0 (which is required by 222 | plutus-pioneer-program-week04-0.1.0.0). See the build log above for details. 223 | #+end_src 224 | 225 | So I tried to execute the =happy=. I see a complaint: 226 | 227 | #+begin_src 228 | > /Users/hcarr/.cabal/store/ghc-8.10.4.20210212/hppy-1.20.0-a2383844/bin/happy 229 | dyld: Library not loaded: /nix/store/xxda2m8nqqrjygyppid1pff15kxf3fg4-libffi-3.4.2/lib/libffi.8.dylib 230 | #+end_src 231 | 232 | Looking in =/nix/store=, I see that =xxda...= does not exist. 233 | 234 | I do not know how to make it exist. 235 | 236 | But I see other versions of =libffi-3.4.2= are in the store, so I tried (yuck): 237 | 238 | #+begin_src 239 | > sudo ln -s /nix/store/4jm4isrbhbdx9wgkbsgkqgrdwqcyail3-libffi-3.4.2 /nix/store/xxda2m8nqqrjygyppid1pff15kxf3fg4-libffi-3.4.2 240 | #+end_src 241 | 242 | Then tried =happy= again: 243 | 244 | #+begin_src 245 | > /Users/hcarr/.cabal/store/ghc-8.10.4.20210212/hppy-1.20.0-a2383844/bin/happy 246 | Usage: happy [OPTION...] file 247 | ... 248 | #+end_src 249 | 250 | Now =happy= is happy and =cabal build= and =cabal repl= work. 251 | 252 | If anyone knows how to correctly install that particular hash version of =libffi=, 253 | please let me know. 254 | 255 | -------------------------------------------------------------------------------- /01-start-node-testnet/config/testnet-alonzo-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "lovelacePerUTxOWord": 34482, 3 | "executionPrices": { 4 | "prSteps": 5 | { 6 | "numerator" : 721, 7 | "denominator" : 10000000 8 | }, 9 | "prMem": 10 | { 11 | "numerator" : 577, 12 | "denominator" : 10000 13 | } 14 | }, 15 | "maxTxExUnits": { 16 | "exUnitsMem": 10000000, 17 | "exUnitsSteps": 10000000000 18 | }, 19 | "maxBlockExUnits": { 20 | "exUnitsMem": 50000000, 21 | "exUnitsSteps": 40000000000 22 | }, 23 | "maxValueSize": 5000, 24 | "collateralPercentage": 150, 25 | "maxCollateralInputs": 3, 26 | "costModels": { 27 | "PlutusV1": { 28 | "sha2_256-memory-arguments": 4, 29 | "equalsString-cpu-arguments-constant": 1000, 30 | "cekDelayCost-exBudgetMemory": 100, 31 | "lessThanEqualsByteString-cpu-arguments-intercept": 103599, 32 | "divideInteger-memory-arguments-minimum": 1, 33 | "appendByteString-cpu-arguments-slope": 621, 34 | "blake2b-cpu-arguments-slope": 29175, 35 | "iData-cpu-arguments": 150000, 36 | "encodeUtf8-cpu-arguments-slope": 1000, 37 | "unBData-cpu-arguments": 150000, 38 | "multiplyInteger-cpu-arguments-intercept": 61516, 39 | "cekConstCost-exBudgetMemory": 100, 40 | "nullList-cpu-arguments": 150000, 41 | "equalsString-cpu-arguments-intercept": 150000, 42 | "trace-cpu-arguments": 150000, 43 | "mkNilData-memory-arguments": 32, 44 | "lengthOfByteString-cpu-arguments": 150000, 45 | "cekBuiltinCost-exBudgetCPU": 29773, 46 | "bData-cpu-arguments": 150000, 47 | "subtractInteger-cpu-arguments-slope": 0, 48 | "unIData-cpu-arguments": 150000, 49 | "consByteString-memory-arguments-intercept": 0, 50 | "divideInteger-memory-arguments-slope": 1, 51 | "divideInteger-cpu-arguments-model-arguments-slope": 118, 52 | "listData-cpu-arguments": 150000, 53 | "headList-cpu-arguments": 150000, 54 | "chooseData-memory-arguments": 32, 55 | "equalsInteger-cpu-arguments-intercept": 136542, 56 | "sha3_256-cpu-arguments-slope": 82363, 57 | "sliceByteString-cpu-arguments-slope": 5000, 58 | "unMapData-cpu-arguments": 150000, 59 | "lessThanInteger-cpu-arguments-intercept": 179690, 60 | "mkCons-cpu-arguments": 150000, 61 | "appendString-memory-arguments-intercept": 0, 62 | "modInteger-cpu-arguments-model-arguments-slope": 118, 63 | "ifThenElse-cpu-arguments": 1, 64 | "mkNilPairData-cpu-arguments": 150000, 65 | "lessThanEqualsInteger-cpu-arguments-intercept": 145276, 66 | "addInteger-memory-arguments-slope": 1, 67 | "chooseList-memory-arguments": 32, 68 | "constrData-memory-arguments": 32, 69 | "decodeUtf8-cpu-arguments-intercept": 150000, 70 | "equalsData-memory-arguments": 1, 71 | "subtractInteger-memory-arguments-slope": 1, 72 | "appendByteString-memory-arguments-intercept": 0, 73 | "lengthOfByteString-memory-arguments": 4, 74 | "headList-memory-arguments": 32, 75 | "listData-memory-arguments": 32, 76 | "consByteString-cpu-arguments-intercept": 150000, 77 | "unIData-memory-arguments": 32, 78 | "remainderInteger-memory-arguments-minimum": 1, 79 | "bData-memory-arguments": 32, 80 | "lessThanByteString-cpu-arguments-slope": 248, 81 | "encodeUtf8-memory-arguments-intercept": 0, 82 | "cekStartupCost-exBudgetCPU": 100, 83 | "multiplyInteger-memory-arguments-intercept": 0, 84 | "unListData-memory-arguments": 32, 85 | "remainderInteger-cpu-arguments-model-arguments-slope": 118, 86 | "cekVarCost-exBudgetCPU": 29773, 87 | "remainderInteger-memory-arguments-slope": 1, 88 | "cekForceCost-exBudgetCPU": 29773, 89 | "sha2_256-cpu-arguments-slope": 29175, 90 | "equalsInteger-memory-arguments": 1, 91 | "indexByteString-memory-arguments": 1, 92 | "addInteger-memory-arguments-intercept": 1, 93 | "chooseUnit-cpu-arguments": 150000, 94 | "sndPair-cpu-arguments": 150000, 95 | "cekLamCost-exBudgetCPU": 29773, 96 | "fstPair-cpu-arguments": 150000, 97 | "quotientInteger-memory-arguments-minimum": 1, 98 | "decodeUtf8-cpu-arguments-slope": 1000, 99 | "lessThanInteger-memory-arguments": 1, 100 | "lessThanEqualsInteger-cpu-arguments-slope": 1366, 101 | "fstPair-memory-arguments": 32, 102 | "modInteger-memory-arguments-intercept": 0, 103 | "unConstrData-cpu-arguments": 150000, 104 | "lessThanEqualsInteger-memory-arguments": 1, 105 | "chooseUnit-memory-arguments": 32, 106 | "sndPair-memory-arguments": 32, 107 | "addInteger-cpu-arguments-intercept": 197209, 108 | "decodeUtf8-memory-arguments-slope": 8, 109 | "equalsData-cpu-arguments-intercept": 150000, 110 | "mapData-cpu-arguments": 150000, 111 | "mkPairData-cpu-arguments": 150000, 112 | "quotientInteger-cpu-arguments-constant": 148000, 113 | "consByteString-memory-arguments-slope": 1, 114 | "cekVarCost-exBudgetMemory": 100, 115 | "indexByteString-cpu-arguments": 150000, 116 | "unListData-cpu-arguments": 150000, 117 | "equalsInteger-cpu-arguments-slope": 1326, 118 | "cekStartupCost-exBudgetMemory": 100, 119 | "subtractInteger-cpu-arguments-intercept": 197209, 120 | "divideInteger-cpu-arguments-model-arguments-intercept": 425507, 121 | "divideInteger-memory-arguments-intercept": 0, 122 | "cekForceCost-exBudgetMemory": 100, 123 | "blake2b-cpu-arguments-intercept": 2477736, 124 | "remainderInteger-cpu-arguments-constant": 148000, 125 | "tailList-cpu-arguments": 150000, 126 | "encodeUtf8-cpu-arguments-intercept": 150000, 127 | "equalsString-cpu-arguments-slope": 1000, 128 | "lessThanByteString-memory-arguments": 1, 129 | "multiplyInteger-cpu-arguments-slope": 11218, 130 | "appendByteString-cpu-arguments-intercept": 396231, 131 | "lessThanEqualsByteString-cpu-arguments-slope": 248, 132 | "modInteger-memory-arguments-slope": 1, 133 | "addInteger-cpu-arguments-slope": 0, 134 | "equalsData-cpu-arguments-slope": 10000, 135 | "decodeUtf8-memory-arguments-intercept": 0, 136 | "chooseList-cpu-arguments": 150000, 137 | "constrData-cpu-arguments": 150000, 138 | "equalsByteString-memory-arguments": 1, 139 | "cekApplyCost-exBudgetCPU": 29773, 140 | "quotientInteger-memory-arguments-slope": 1, 141 | "verifySignature-cpu-arguments-intercept": 3345831, 142 | "unMapData-memory-arguments": 32, 143 | "mkCons-memory-arguments": 32, 144 | "sliceByteString-memory-arguments-slope": 1, 145 | "sha3_256-memory-arguments": 4, 146 | "ifThenElse-memory-arguments": 1, 147 | "mkNilPairData-memory-arguments": 32, 148 | "equalsByteString-cpu-arguments-slope": 247, 149 | "appendString-cpu-arguments-intercept": 150000, 150 | "quotientInteger-cpu-arguments-model-arguments-slope": 118, 151 | "cekApplyCost-exBudgetMemory": 100, 152 | "equalsString-memory-arguments": 1, 153 | "multiplyInteger-memory-arguments-slope": 1, 154 | "cekBuiltinCost-exBudgetMemory": 100, 155 | "remainderInteger-memory-arguments-intercept": 0, 156 | "sha2_256-cpu-arguments-intercept": 2477736, 157 | "remainderInteger-cpu-arguments-model-arguments-intercept": 425507, 158 | "lessThanEqualsByteString-memory-arguments": 1, 159 | "tailList-memory-arguments": 32, 160 | "mkNilData-cpu-arguments": 150000, 161 | "chooseData-cpu-arguments": 150000, 162 | "unBData-memory-arguments": 32, 163 | "blake2b-memory-arguments": 4, 164 | "iData-memory-arguments": 32, 165 | "nullList-memory-arguments": 32, 166 | "cekDelayCost-exBudgetCPU": 29773, 167 | "subtractInteger-memory-arguments-intercept": 1, 168 | "lessThanByteString-cpu-arguments-intercept": 103599, 169 | "consByteString-cpu-arguments-slope": 1000, 170 | "appendByteString-memory-arguments-slope": 1, 171 | "trace-memory-arguments": 32, 172 | "divideInteger-cpu-arguments-constant": 148000, 173 | "cekConstCost-exBudgetCPU": 29773, 174 | "encodeUtf8-memory-arguments-slope": 8, 175 | "quotientInteger-cpu-arguments-model-arguments-intercept": 425507, 176 | "mapData-memory-arguments": 32, 177 | "appendString-cpu-arguments-slope": 1000, 178 | "modInteger-cpu-arguments-constant": 148000, 179 | "verifySignature-cpu-arguments-slope": 1, 180 | "unConstrData-memory-arguments": 32, 181 | "quotientInteger-memory-arguments-intercept": 0, 182 | "equalsByteString-cpu-arguments-constant": 150000, 183 | "sliceByteString-memory-arguments-intercept": 0, 184 | "mkPairData-memory-arguments": 32, 185 | "equalsByteString-cpu-arguments-intercept": 112536, 186 | "appendString-memory-arguments-slope": 1, 187 | "lessThanInteger-cpu-arguments-slope": 497, 188 | "modInteger-cpu-arguments-model-arguments-intercept": 425507, 189 | "modInteger-memory-arguments-minimum": 1, 190 | "sha3_256-cpu-arguments-intercept": 0, 191 | "verifySignature-memory-arguments": 1, 192 | "cekLamCost-exBudgetMemory": 100, 193 | "sliceByteString-cpu-arguments-intercept": 150000 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /01-start-node-testnet/config/testnet-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "AlonzoGenesisFile": "testnet-alonzo-genesis.json", 3 | "AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874", 4 | "ApplicationName": "cardano-sl", 5 | "ApplicationVersion": 0, 6 | "ByronGenesisFile": "testnet-byron-genesis.json", 7 | "ByronGenesisHash": "96fceff972c2c06bd3bb5243c39215333be6d56aaf4823073dca31afe5038471", 8 | "LastKnownBlockVersion-Alt": 0, 9 | "LastKnownBlockVersion-Major": 3, 10 | "LastKnownBlockVersion-Minor": 0, 11 | "MaxKnownMajorProtocolVersion": 2, 12 | "Protocol": "Cardano", 13 | "RequiresNetworkMagic": "RequiresMagic", 14 | "ShelleyGenesisFile": "testnet-shelley-genesis.json", 15 | "ShelleyGenesisHash": "849a1764f152e1b09c89c0dfdbcbdd38d711d1fec2db5dfa0f87cf2737a0eaf4", 16 | "TraceAcceptPolicy": true, 17 | "TraceBlockFetchClient": false, 18 | "TraceBlockFetchDecisions": false, 19 | "TraceBlockFetchProtocol": false, 20 | "TraceBlockFetchProtocolSerialised": false, 21 | "TraceBlockFetchServer": false, 22 | "TraceChainDb": true, 23 | "TraceChainSyncBlockServer": false, 24 | "TraceChainSyncClient": false, 25 | "TraceChainSyncHeaderServer": false, 26 | "TraceChainSyncProtocol": false, 27 | "TraceConnectionManager": true, 28 | "TraceDNSResolver": true, 29 | "TraceDNSSubscription": true, 30 | "TraceDiffusionInitialization": true, 31 | "TraceErrorPolicy": true, 32 | "TraceForge": true, 33 | "TraceHandshake": false, 34 | "TraceInboundGovernor": true, 35 | "TraceIpSubscription": true, 36 | "TraceLedgerPeers": true, 37 | "TraceLocalChainSyncProtocol": false, 38 | "TraceLocalErrorPolicy": true, 39 | "TraceLocalHandshake": false, 40 | "TraceLocalRootPeers": true, 41 | "TraceLocalTxSubmissionProtocol": false, 42 | "TraceLocalTxSubmissionServer": false, 43 | "TraceMempool": true, 44 | "TraceMux": false, 45 | "TracePeerSelection": true, 46 | "TracePeerSelectionActions": true, 47 | "TracePublicRootPeers": true, 48 | "TraceServer": true, 49 | "TraceTxInbound": false, 50 | "TraceTxOutbound": false, 51 | "TraceTxSubmissionProtocol": false, 52 | "TracingVerbosity": "NormalVerbosity", 53 | "TurnOnLogMetrics": true, 54 | "TurnOnLogging": true, 55 | "defaultBackends": [ 56 | "KatipBK" 57 | ], 58 | "defaultScribes": [ 59 | [ 60 | "StdoutSK", 61 | "stdout" 62 | ] 63 | ], 64 | "hasEKG": 12788, 65 | "hasPrometheus": [ 66 | "127.0.0.1", 67 | 12798 68 | ], 69 | "minSeverity": "Info", 70 | "options": { 71 | "mapBackends": { 72 | "cardano.node.metrics": [ 73 | "EKGViewBK" 74 | ], 75 | "cardano.node.resources": [ 76 | "EKGViewBK" 77 | ] 78 | }, 79 | "mapSubtrace": { 80 | "cardano.node.metrics": { 81 | "subtrace": "Neutral" 82 | } 83 | } 84 | }, 85 | "rotation": { 86 | "rpKeepFilesNum": 10, 87 | "rpLogLimitBytes": 5000000, 88 | "rpMaxAgeHours": 24 89 | }, 90 | "setupBackends": [ 91 | "KatipBK" 92 | ], 93 | "setupScribes": [ 94 | { 95 | "scFormat": "ScText", 96 | "scKind": "StdoutSK", 97 | "scName": "stdout", 98 | "scRotation": null 99 | } 100 | ] 101 | } 102 | -------------------------------------------------------------------------------- /01-start-node-testnet/config/testnet-shelley-genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "activeSlotsCoeff": 0.05, 3 | "protocolParams": { 4 | "protocolVersion": { 5 | "minor": 0, 6 | "major": 2 7 | }, 8 | "decentralisationParam": 1, 9 | "eMax": 18, 10 | "extraEntropy": { 11 | "tag": "NeutralNonce" 12 | }, 13 | "maxTxSize": 16384, 14 | "maxBlockBodySize": 65536, 15 | "maxBlockHeaderSize": 1100, 16 | "minFeeA": 44, 17 | "minFeeB": 155381, 18 | "minUTxOValue": 1000000, 19 | "poolDeposit": 500000000, 20 | "minPoolCost": 340000000, 21 | "keyDeposit": 2000000, 22 | "nOpt": 150, 23 | "rho": 0.003, 24 | "tau": 0.20, 25 | "a0": 0.3 26 | }, 27 | "genDelegs": { 28 | "2f56e87d67b8e5216582cfeb95dbdc9083110a3ef68faaa51bef3a80": { 29 | "delegate": "bd5933d3c5417f17a64c7214711a26abc3bc03e2c90dc1bb38e0c39f", 30 | "vrf": "9a0b0f537874d089cedfa9e250150405e47ea29acee87c40a223ae0a175d26f8" 31 | }, 32 | "514e81afb082fce01678809eebd90eda4f7918354ec7d0433ad16274": { 33 | "delegate": "eff1b5b26e65b791d6f236c7c0264012bd1696759d22bdb4dd0f6f56", 34 | "vrf": "e6f70fb10c7523aa76648e20d17e65fd9b2ed53960fbd20b308f223b703f2e23" 35 | }, 36 | "2fca486b4d8f1a0432f5bf18ef473ee4294c795a1a32e3132bc6b90f": { 37 | "delegate": "de665a71064706f946030505eae950583f08c316f0f58997961092b1", 38 | "vrf": "c3fde629add60e30142cd7ef3c680610975208b08aee42203a5c40ad5992e8f6" 39 | }, 40 | "4ee98623920698b77c1c7f77288cbdac5f9011ff8970b1f507567d0d": { 41 | "delegate": "bf07107c6f632de95e34af7e009d2aafa19916c7ba89b944fbedcd72", 42 | "vrf": "9d7d12e3d6b02835be3e76cfc6ae93d937035ee0e006d04a0eef9dea19754e21" 43 | }, 44 | "0d06d2547ed371fdf95fb5c4c735eecdd53e6a5bb831561bd0fcfd3d": { 45 | "delegate": "6df3e1b4b8a84c63c805076a85e5aa00924997a4eae85fddf0aee3ca", 46 | "vrf": "0774e5810fe02a014ec97ef424797172f2b8c5dcfb6e4cfc98b411c31d5096d8" 47 | }, 48 | "581e23030b6038bae716e5d64b9e053db10541b12e6b0b4eff485454": { 49 | "delegate": "b0dca078b823cde627da136200d6618c49ad712b77972a1c5e135763", 50 | "vrf": "16a4e883b72ddbd09a4f8a1170fc346ab11e4202f814faa73e9d2433ee03e7b0" 51 | }, 52 | "e5f27655371b54aed91cc916b2569060978be80056768fee2cc5ce1b": { 53 | "delegate": "b3873a254459f506e47b9a252ee7912e538b364447f31576a170db65", 54 | "vrf": "cc5c897fdf5db0017326656fe35aeb20c72b175540793f9b9b8dc9ade001bbc4" 55 | } 56 | }, 57 | "updateQuorum": 5, 58 | "networkId": "Testnet", 59 | "initialFunds": {}, 60 | "maxLovelaceSupply": 45000000000000000, 61 | "networkMagic": 1097911063, 62 | "epochLength": 432000, 63 | "systemStart": "2019-07-24T20:20:16Z", 64 | "slotsPerKESPeriod": 129600, 65 | "slotLength": 1, 66 | "maxKESEvolutions": 62, 67 | "securityParam": 2160 68 | } 69 | -------------------------------------------------------------------------------- /01-start-node-testnet/config/testnet-topology.json: -------------------------------------------------------------------------------- 1 | { 2 | "Producers": [ 3 | { 4 | "addr": "relays-new.cardano-testnet.iohkdev.io", 5 | "port": 3001, 6 | "valency": 2 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /01-start-node-testnet/start-node-testnet: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | HERE="${BASH_SOURCE%/*}" 4 | 5 | . "${HOME}/Cardano/plutus-pioneer-program-me/hc-cardano.env" 6 | 7 | cardano-node run \ 8 | --topology "${HERE}"/config/testnet-topology.json \ 9 | --database-path "${HC_CARDANO_NODE_DB}" \ 10 | --socket-path "${CARDANO_NODE_SOCKET_PATH}" \ 11 | --host-addr "${HC_CARDANO_NODE_HOST_ADDR}" \ 12 | --port "${HC_CARDANO_NODE_PORT=3001}" \ 13 | --config "${HERE}"/config/testnet-config.json 14 | -------------------------------------------------------------------------------- /01-start-node-testnet/start-node-testnet.org: -------------------------------------------------------------------------------- 1 | #+OPTIONS: H:6 num:nil toc:nil \n:nil @:t ::t |:t ^:t f:t TeX:t ... 2 | 3 | #+begin_comment 4 |  (eepitch-shell) 5 |  (eepitch-kill) 6 |  (eepitch-shell) 7 | #+end_comment 8 | 9 | ------------------------------------------------------------------------------ 10 | * start a node 11 | 12 | Assumes [[configuration]] (below) has been done. 13 | 14 | Note: the first time this is run, it will take hours until the test-net data 15 | is downloaded and up-to-date. 16 | 17 | it creates ~srwx------ 1