First, make (or get into) a folder to work in:
mkdir devel; cd devel #For example
If you plan to do any programming on any of the support libraries, you may find it helpful for this folder to be used only for MyCHIPs. Otherwise, you can put the source wherever you like.
The software depends on Node.js of at least version 16. You can check your current version with:
node -v
If you need to upgrade, one pretty easy way is:
sudo npm install -g n
sudo n stable
Important: if you are developing on a Mac or Windows machine, these steps are not referring to the software on your native host, but rather on the Linux environment where the server will run. That environment will have to be one of:
- Native Linux on a dedicated server
- Native Linux in a VM (VirtualBox, cloud, etc)
- Docker (which install correct software versions on its own)
If you're only going to be running things in docker (like the simulator) and not the native installed version, you can skip the parts having to do with node (including "npm install").
Now clone the MyCHIPs source code from the github repository. If the folder gets created as "MyCHIPs" (because you copied the github clone link) rather than "mychips", it may cause some problems on some platforms, so consider renaming it to (lower case) "mychips."
git clone https://github.com/gotchoices/mychips
cd mychips
npm install #Install dependencies (run on Linux)
Now that the software is installed, you have 3 basic options to give it a try. Note: the docker methods will require docker engine >= 20.10.10.
-
Docker Test Instance: This is probably the easiest option and should work on Linux, Mac or Windows. But it is not going to get you to a production server. It will also help if you are already familiar with Docker. For Windows users, here are some known issues to be aware of:
- Make sure docker can mount your windows volumes.
- The "npm run docker" command will make use of the unixy "pwd" command (see inside package.json scripts). If you configure npm to use bash, this should work correctly. Otherwise you may have to execute the docker-compose command manually with the (MYCHIPS_ROOT and MYCHIPS_DIR environment variables set correctly). Some Windows users have better success running things in the bash shell that comes with Git.
- Git on windows may automatically map UNIX text file LF terminators to CR-LF. This will alter certain scripts so the #!shebang command at the top doesn't work right. Hopefully, this has been addressed with a .gitattributes file in mychips/bin but if it pops up somewhere else, this explains how to configure your git when you clone the repo to avoid this.
-
Regular Linux Installation: You will need to install some dependencies and do a little configuration of the environment. But for a dedicated server, this is the way to go--at least for now. This should work fine on a Linux VM or a regular installation on physical hardware.
-
Docker Simulation: There are several simulation environments located in the test/sim directory. The latest version, based on docker, allows you to launch a number of MyCHIPs server instances in docker containers. There is also an agent model module that runs on behalf of simulated users to create a data set of random CHIP trades.
To run the simulation, install Docker on your machine and then get into the test/sim folder and follow the instructions here. The current simulation Model 3 docs are found here, and contain a summary of the instructions and implementation details. We suggest referring to Model 3 docs first when trying to run the most current version of the simulation.
The simulation environment was developed on MacOS but it should also be possible (though not well tested) to run on a Linux host. Not much testing has been done on Windows but it may work with some effort.