-
Notifications
You must be signed in to change notification settings - Fork 199
Getting Started
- Download the latest WAR file
- Save WAR file in a folder of your choice
- Optionally rename WAR file to cakeshop.war
- Java 7+
There are a few ways in which you can run Cakeshop (see the sections below for details on each, as well as this page):
- Default mode: Used when you want Cakeshop to start up an Ethereum node.
Running Cakeshop in the Default mode will start up Cakeshop and also start running a regular geth node (on a private/test network).
- 'Attach/Unmanaged' mode: Used when you want to attach Cakeshop to an already running Ethereum-like node.
Running Cakeshop in 'Attach' a.k.a 'unmanaged' mode will initialize Cakeshop but not start it nor start any Ethereum node. Once Cakeshop initialization is complete you can configure it to use the RPC details of your running node . When you then start Cakeshop it will attach to your node.
NOTE: if different parties on the network are using Cakeshop to deploy contracts to the network then they need to ensure they are using the same ContractRegistry address. See details below for setting up the ContractRegistry address in this case.
- Multi-Instance Set Up: Used when you want to run Cakeshop on more than one node in your network.
Cakeshop is currently designed such that a given instance of Cakeshop works directly with a single Ethereum-like node, however you can set up multiple instances of Cakeshop on the same machine (each which could either have been started in 'Default' mode or 'Attach' mode) such that each can talk to a different node.
NOTE: you can use the Attach mode and/or Multi-Instance setup configuration to run Cakeshop on Quorum nodes. See below for connecting Cakeshop to the 7nodes network from the quorum-examples repo.
-
In a terminal window run:
$ cd path/to/cakeshop/war $ java -jar cakeshop.war
-
Open http://localhost:8080/cakeshop/ in your browser (Firefox/Chrome supported)
-
In a terminal window run:
$ cd path/to/cakeshop/war # The 'example' arg below will unpack the war file and set up the cakeshop data folders but will not actually start a node $ java -jar cakeshop.war example
-
Navigate to path/to/cakeshop/war/data/local
-
Make the following edits to the application.properties file:
- set
geth.url
to therpcport
of your ethereum node, i.e. if your gethrpcport
is 22001 thengeth.url=http\://localhost\:22001
- ensure
geth.auto.start
is set tofalse
- ensure
geth.auto.stop
is set tofalse
-
Run:
$ java -jar cakeshop.war
-
Open http://localhost:8080/cakeshop/ in your browser (Firefox/Chrome supported)
Although Cakeshop currently has a one-to-one mapping with the underlying Ethereum-like node that it connects to, it is possible to have multiple Cakeshop instances running on the same machine, each connecting to a different Ethereum-like node. The best way to achieve this is to create separate Cakeshop folders for each node and then attach to each separately. You should also configure the ContractRegistry address as per the below:
** Cakeshop ContractRegistry contract**
Cakeshop deploys a ContractRegistry contract upon start up that is used to track those contracts that have been deployed to the chain using Cakeshop or the Cakeshop APIs. When running a multi-instance setup, you'll want to ensure that each instance of Cakeshop references the same ContractRegistry contract in order that each provides a consistent view within the Contracts Explorer.
There are two cmd flags that can be set to achieve this:
CAKESHOP_SHARED_CONFIG
(recommended): When this flag is set, Cakeshop will try to load a file called 'shared.properties' and read the ContractRegistry address from it. If the file doesn't exist, Cakeshop will deploy the ContractRegistry contract, create this file and store the address in the file.
USAGE:
$ CAKESHOP_SHARED_CONFIG="{fileLocation}" java -jar cakeshop.war
CAKESHOP_REGISTRY_ADDR
: This flag will directly override whatever ContractRegistry address is configured (or not) and run with that address. Using this flag doesn't change any local Cakeshop settings nor save this address to file and so you would have to run with this flag again to use this address again.
USAGE:
$ CAKESHOP_REGISTRY_ADDR="0xabcdefgh.." java -jar cakeshop.war
-
In terminal window 1 run:
mkdir myNetwork && cd myNetwork cp path/to/cakeshop/download /myNetwork cd myNetwork mkdir node1 node2 cd node1 CAKESHOP_SHARED_CONFIG=".." java -jar ../cakeshop.war example
-
Assuming you want to attach to an existing node, navigate to /myNetwork/node1/ and edit application.properties per the instructions for 'Attach' Mode as described above
-
In terminal window 2 run:
cd myNetwork/node2 CAKESHOP_SHARED_CONFIG=".." java -jar ../cakeshop.war example
-
Navigate to myNetwork/node2 and edit application.properties per the instructions for 'Attach' Mode as described above
-
In terminal window 1 run:
CAKESHOP_SHARED_CONFIG=".." java -jar ../cakeshop.war
-
In terminal window 2 run:
CAKESHOP_SHARED_CONFIG=".." java -Dserver.port=8081 -jar cakeshop.war # Cakeshop will now be available on localhost:8081
-
In browser window 1 open http://localhost:8080/cakeshop/
-
In browser window 2 open http://localhost:8081/cakeshop/
You can use the 'Attach' mode to use Cakeshop to explore the quorum-examples 7nodes network.
To do so:
- Follow the instructions in the 7nodes example to start the 7nodes network (running vagrant up, init.sh, start.sh etc.)
- Follow the instructions listed under the Attach mode as described above, using the
rpcport
of the node you want to explore as found in the 7nodes start.sh file. Equally, follow the Multi-Instance setup to attach to more than one of the Quorum nodes.
In all cases, Cakeshop will be running once you see the below image, which shows the Cakeshop build and url that you can access that instance of Cakeshop on:
- Home
- Getting Started
- Downloading Cakeshop
- Running Cakeshop
- Default Mode
- Attach Mode
- Multi-Instance Setup
- Running on quorum-examples
- Cakeshop Overview
- Console
- Contracts Explorer
- Sandbox
- Chain Explorer
- Wallet
- Peers
- API
- FAQs