Exploring JPM’s Quorum: 0.1
This document describes my initial experiments trying to understand JPM’s Quorum, a flavour of the Go-Ethereum client.
On my machine I have multiple versions of go-ethereum
(also known as geth
or goethe
) installed. I was fairly confident that when I issued the following terminal command:
geth — testnet — rpc — mine
What was being executed was the version of goethe
that lives in my $GOPATH
, i.e.:
/Users/s.matthew.english/go/src/github.com/ethereum/go-ethereum
Turns out- that is accurate.
For instance, even though I was in the quorum
directory, the output of which geth
was the one on my $GOPATH
:
However…
What I wanted to do was to run the JPM’s quorum
(a different version of goethe
), which lives in a separate directory, namely:
/Users/s.matthew.english/clients/quorum/0.0_quorum/quorum
Finally, it is possible to specify on start-up which version of goethe
is executed.
The first attempt I made was to try and edit /etc/paths
, like so:
subl /etc/paths
Note:
subl
refers to Sublime Text, you can also do that just as well withnano
orvim
.
At first my /etc/path
looked like this:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
I changed it to this:
/Users/s.matthew.english/clients/quorum/0.0_quorum/quorum/
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
But that didn’t work!
So I asked a question on StackOverflow [0], which also failed to yield any interesting information.
Let me back-up for a second — the reason that I was trying to change /etc/paths
was because of the $PATH
hierarchy. When you call terminal commands to start some program, the program referenced in the directory that comes earlier in your $PATH
is the one that get executed. So the reason the version of geth
(goethe
) that lived in my $GOPATH
was running — as opposed to the quorum
version (despite the fact that I was sitting inside of the quorum
directory), was because my $PATH
looked like this:
Here you can see that the directory with quorum
:
/Users/s.matthew.english/ConsenSys/PegaSys/clients/quorum/0.0_quorum/quorum/
comes last in the $PATH
.
Finally I was able to move the quorum
directory to the front of my $PATH
by appending the following code snippet to my “bash profile”, which in my case is actually ~/.zshrc
:
#-------------------------------------------------------------
# attempt to add some Quorum stuff...
#-------------------------------------------------------------export PATH=$HOME/ConsenSys/PegaSys/clients/quorum/0.0_quorum/quorum/build/bin:$PATH
This needs to come at the end of your bash profile. If you think (and look) closely you can see that what is actually happening is, at last — right before the bash profile is consummated — I slip the quorum
directory up front and append the rest of the $PATH
behind it ;)
So by virtue of that neat trick we’re able to get the quorum
directory to the front as we can see here:
Why then does the $GOPATH
variant of geth
show up when we issue the which geth
command?
Simple — we’d forgotten to actually build the executable binary file!
After cloning the qurorum
repo and configuring a correct fork configuration [1], I’d never actually went to the base of my quorum
project and issued the command make geth
which is what creates the runnable program file in the sub-directory /build/bin
.
Having done completed that step, I also added the further-specified sub-directory structure to the $PATH
— I’m not 100% sure that you actually need to add that level of detail, maybe your machine is smart enough to figure it out — so finally I had this as my $PATH
:
Next thing I did was fire up my local version of quorum
like so:
Resources
- [0] https://stackoverflow.com/questions/45787522/path-macos-move-directory-up-in-the-hierarchy-to-prefer-execution-of-particul
- [1] https://medium.com/@s.matthew.english/configuring-a-fork-github-3576a4ec26e8
- [2] https://ethereum.stackexchange.com/questions/24779/specify-and-run-particular-version-of-geth-goethe-on-my-machine-with-more-t