<p>You can create command aliases or write bash scripts to automate certain commands. An example of aliases I've written for myself (in Linux):</p>
<pre><code>alias plutus-nix='cd /home/datapool/plutus-apps; GC_DONT_GC=1 nix-shell'
alias plutus-server='cd plutus-playground-client;  GC_DONT_GC=1 plutus- 
         playground-server'
alias plutus-client='cd plutus-playground-client;  GC_DONT_GC=1 npm 
         start'
</code></pre>
<p>So basically I just run commands like plutus-nix -&gt; plutus-server when I want the server, and plutus-nix -&gt; plutus-client when I want the client.</p>
<p>Bear in mind I can do this easily in Linux but I would think it should be OK to write aliases as well in MacOS.</p>

CC BY-SA 4.0
2022-01-31T23:21:51.917Z
yes I could definitely use aliases to help with this.  Any thoughts on what I could do to speed these steps up?
Steve Mason
CC BY-SA 4.0
2022-02-01T06:42:36.057Z
Which shell do you use? You can put the aliases on the configuration file for your shell environment. For instance I use bash so I put my aliases in my .bashrc in my home folder.
d_fajardo
CC BY-SA 4.0
2022-01-31T10:20:09.490Z
2022-01-31T10:20:09.490Z
d_fajardo
<p>My weekly setup steps are similar to yours. But there's a few steps you do that I skip and, so far, haven't had any issues.</p>
<p>I've never ran any of these:</p>
<pre><code>nix-build -A plutus-playground.client
nix-build -A plutus-playground.server
nix-build -A plutus-playground.generate-purescript
nix-build -A plutus-playground.start-backend
</code></pre>
<p>or</p>
<pre><code>plutus-playground-generate-purs
</code></pre>
<p>Everything else I do in basically the same order you do.</p>

CC BY-SA 4.0
2022-01-31T23:20:41.587Z
thanks, I'll try removing these.  They were required in the initial install (at least in the instructions I used). Anybody know why or when these would need to be rerun?  Under what conditions, if ever?
Steve Mason
CC BY-SA 4.0
2022-01-31T02:23:58.710Z
2022-01-31T02:23:58.710Z
Travis
<p>Each week so far it takes me over 1.5 hours to bring my dev environment up to date after updating the plutus-pioneer-program and plutus-app repos. This is really painful.</p>
<p>I'm wondering if someone can show me how to improve this startup time - possibly avoid unneeded steps, suggest some optimization settings (if any exist)...</p>
<p>I've listed my environment update process below. Any advice on how to streamline this and reduce my startup time would be much appreciated. Note I'm running on Intel Mac (BigSur), I'm in Cohort 3, I'm new to nix and cabal and for the first two weeks I had trouble getting the playground up reliably so after much experimenting I'm down to the following process that seems to work, but it takes a long time!</p>
<p>Summary of steps I need to do each week:</p>
<ol>
<li>open a terminal and run from my PPP code directory:</li>
</ol>
<pre><code>cd plutus-pioneers-program
git pull origin plutus-pioneers-program // gets main branch
</code></pre>
<ol start="2">
<li>look inside code/weekxx/cabal.project and find latest plutus-app commit branch -&gt; say ABCDEF</li>
<li>cd to plutus-app directory and do the following</li>
</ol>
<pre><code> a) git pull origin plutus-apps // gets main branch 
 b) git checkout ABCDEF   // to align plutus-apps code with this week's ppp commit
 c) nix-build -A plutus-playground.client
 d) nix-build -A plutus-playground.server
 e) nix-build -A plutus-playground.generate-purescript
 f) nix-build -A plutus-playground.start-backend
</code></pre>
<p>Generally these first steps are reasonably fast although sometimes the nix-builds can take up to 5 min each.</p>
<ol start="4">
<li>Then I run</li>
</ol>
<pre><code>nix-shell -v   // -v gives verbose output... nice to watch that it is doing something  
</code></pre>
<p>this can take a long time each week: 30-60 min</p>
<ol start="5">
<li>within the shell I run</li>
</ol>
<pre><code>cd ../plutus-playground-client
plutus-playground-generate-purs    // this can take a while
GC_DONT_GC=1 plutus-playground-server   // start server
</code></pre>
<ol start="6">
<li>open a new terminal/tab at plutus-app root and run</li>
</ol>
<pre><code>nix-shell -v // again
</code></pre>
<p>generally the second nix shell is faster - completing in 5-10 minutes.</p>
<ol start="7">
<li>within this shell</li>
</ol>
<pre><code>cd ../plutus-playground-client
GC_DONT_GC=1 npm start   // to start the playground ui 
</code></pre>
<ol start="8">
<li>open a 3rd terminal/tab at plutus-app root and run</li>
</ol>
<pre><code>nix-shell -v // again for cabal repl
</code></pre>
<p>similar startup time to 2nd shell</p>
<ol start="9">
<li>within this 3rd shell access cabal repl with</li>
</ol>
<pre><code>cd ppproot/plutus-pioneers-program/code/weekxx   // where xx is week # like 03
cabal repl 
</code></pre>
<p>this takes another 30 minutes to load/build all the dependencies.  <strong>Do I really need them all?</strong></p>
<p>At this point I finally have a stable playground to use !!</p>
<ol start="10">
<li>sometimes I also open another nix-shell and boot up the doc server if I need that.</li>
</ol>

CC BY-SA 4.0
2022-01-31T13:36:42.430Z
I don't see anything here that can't be automated with a bit of shell scripting. Checking for the newest branch could probably be done with something like 'git branch | tail -1'. Why not write a cron job that starts all of this at 4 am, so it's ready when you get up?
Guntram Blohm
CC BY-SA 4.0
2022-01-31T23:23:36.587Z
yeah I can do the scripting, just wondering if I'm including stuff that doesn't need to be done.  For example do I really need all the nix-shells or is there some way I launch some of these processes as background processes from one nix-shell -  I've tried but things don't seem to work
Steve Mason
<plutus-pioneer-program><cabal><nix-shell><install>
How can I set up my dev environment faster after pulling the pioneer code repos for each week
# How can I set up my dev environment faster after pulling the pioneer code repos for each week

(Asked by: username_0 on 2022-01-31)

Each week so far it takes me over 1.5 hours to bring my dev environment up to date after updating the plutus-pioneer-program and plutus-app repos. This is really painful.
I'm wondering if someone can show me how to improve this startup time - possibly avoid unneeded steps, suggest some optimization settings (if any exist)...
I've listed my environment update process below. Any advice on how to streamline this and reduce my startup time would be much appreciated. Note I'm running on Intel Mac (BigSur), I'm in Cohort 3, I'm new to nix and cabal and for the first two weeks I had trouble getting the playground up reliably so after much experimenting I'm down to the following process that seems to work, but it takes a long time!
Summary of steps I need to do each week:

open a terminal and run from my PPP code directory:

cd plutus-pioneers-program
git pull origin plutus-pioneers-program // gets main branch


look inside code/weekxx/cabal.project and find latest plutus-app commit branch -> say ABCDEF
cd to plutus-app directory and do the following

 a) git pull origin plutus-apps // gets main branch 
 b) git checkout ABCDEF   // to align plutus-apps code with this week's ppp commit
 c) nix-build -A plutus-playground.client
 d) nix-build -A plutus-playground.server
 e) nix-build -A plutus-playground.generate-purescript
 f) nix-build -A plutus-playground.start-backend

Generally these first steps are reasonably fast although sometimes the nix-builds can take up to 5 min each.

Then I run

nix-shell -v   // -v gives verbose output... nice to watch that it is doing something  

this can take a long time each week: 30-60 min

within the shell I run

cd ../plutus-playground-client
plutus-playground-generate-purs    // this can take a while
GC_DONT_GC=1 plutus-playground-server   // start server


open a new terminal/tab at plutus-app root and run

nix-shell -v // again

generally the second nix shell is faster - completing in 5-10 minutes.

within this shell

cd ../plutus-playground-client
GC_DONT_GC=1 npm start   // to start the playground ui 


open a 3rd terminal/tab at plutus-app root and run

nix-shell -v // again for cabal repl

similar startup time to 2nd shell

within this 3rd shell access cabal repl with

cd ppproot/plutus-pioneers-program/code/weekxx   // where xx is week # like 03
cabal repl 

this takes another 30 minutes to load/build all the dependencies.  Do I really need them all?
At this point I finally have a stable playground to use !!

sometimes I also open another nix-shell and boot up the doc server if I need that.

**Tags:** plutus-pioneer-program, cabal, nix-shell, install
> **Comments:**
> **username_1**: I don't see anything here that can't be automated with a bit of shell scripting. Checking for the newest branch could probably be done with something like 'git branch | tail -1'. Why not write a cron job that starts all of this at 4 am, so it's ready when you get up?  
> **username_0**: yeah I can do the scripting, just wondering if I'm including stuff that doesn't need to be done.  For example do I really need all the nix-shells or is there some way I launch some of these processes as background processes from one nix-shell -  I've tried but things don't seem to work  

---

## 2 answers

### Answer by username_3 on 2022-01-31. Score: 4

My weekly setup steps are similar to yours. But there's a few steps you do that I skip and, so far, haven't had any issues.
I've never ran any of these:
nix-build -A plutus-playground.client
nix-build -A plutus-playground.server
nix-build -A plutus-playground.generate-purescript
nix-build -A plutus-playground.start-backend

or
plutus-playground-generate-purs

Everything else I do in basically the same order you do.

> **Comments:**
> **username_0**: thanks, I'll try removing these.  They were required in the initial install (at least in the instructions I used). Anybody know why or when these would need to be rerun?  Under what conditions, if ever?  

---

### Answer by username_2 on 2022-01-31. Score: 2

You can create command aliases or write bash scripts to automate certain commands. An example of aliases I've written for myself (in Linux):
alias plutus-nix='cd /home/datapool/plutus-apps; GC_DONT_GC=1 nix-shell'
alias plutus-server='cd plutus-playground-client;  GC_DONT_GC=1 plutus- 
         playground-server'
alias plutus-client='cd plutus-playground-client;  GC_DONT_GC=1 npm 
         start'

So basically I just run commands like plutus-nix -> plutus-server when I want the server, and plutus-nix -> plutus-client when I want the client.
Bear in mind I can do this easily in Linux but I would think it should be OK to write aliases as well in MacOS.

> **Comments:**
> **username_0**: yes I could definitely use aliases to help with this.  Any thoughts on what I could do to speed these steps up?  
> **username_2**: Which shell do you use? You can put the aliases on the configuration file for your shell environment. For instance I use bash so I put my aliases in my .bashrc in my home folder.  

---

