Skip to content

Instantly share code, notes, and snippets.

@drwasho
Last active November 18, 2020 22:50
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save drwasho/a39a9a2c730b8d8d2c29c61bfc953b2e to your computer and use it in GitHub Desktop.
Save drwasho/a39a9a2c730b8d8d2c29c61bfc953b2e to your computer and use it in GitHub Desktop.
Install OpenBazaar-Go on a Linux Digital Ocean Droplet

Install OpenBazaar-Go on Linux Digital Ocean Droplet

First off I'm going to assume you have created a user with sudo permissions, and that you're not running from root. I'm also assuming you have a satisfactory knowledge of the Linux terminal/bash commands.

If you have any trouble, join our OpenBazaar Slack group, and pop into the #openbazaar-ipfs channel.

Step 1: Create the install script

  • In your terminal, type: sudo nano install.sh
  • Paste in the following script:
#!bin/bash

# README
# Give the script executable permissions by typing: sudo chmod +x install.sh
# Run the script: sudo bash install.sh

# Install Dependencies and Tools
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install git build-essential autoconf automake pkg-config libtool htop tree libssl-dev

# Install ZeroMQ
(cd /$HOME/; sudo git clone https://github.com/zeromq/libzmq)
(cd /$HOME/libzmq; sudo ./autogen.sh && sudo ./configure && sudo make -j 4)
(cd /$HOME/libzmq; sudo make check && sudo make install && sudo ldconfig)

# Install Golang
(cd /$HOME/; sudo wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz)
sudo mkdir /$HOME/golang
sudo mkdir /$HOME/go
(cd /$HOME/; sudo tar -C /$HOME/golang -xzf go1.6.2.linux-amd64.tar.gz)
export PATH=$PATH:/$HOME/golang/go/bin
echo $PATH
export GOPATH=/$HOME/go
export PATH=$PATH:$GOPATH/bin
echo $GOPATH
export GOROOT=/$HOME/golang/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

# Install and Run OpenBazaar-Go and Dependencies
go get github.com/OpenBazaar/openbazaar-go
(cd $GOPATH/src/github.com/OpenBazaar/openbazaar-go; make toolkit_upgrade && make install)
(cd $GOPATH/src/github.com/OpenBazaar/openbazaar-go; go run openbazaard.go start)
  • Save and exit the file
  • Now you need to give the script executable permissions: sudo chmod +x install.sh

Step 2: Run the install script

  • Type: sudo bash install.sh
    • You'll be prompted to say 'yes' in a couple of places
    • If the install script worked well, the OpenBazaar node should start at the end of the process

Step 3. Run OpenBazaar-Go

  • To run OpenBazaar-Go, type in: (cd $GOPATH/src/github.com/OpenBazaar/openbazaar-go; go run openbazaard.go start)
  • To make life easier, you can write another script to help you: sudo nano run.sh
#!bin/bash
(cd $GOPATH/src/github.com/OpenBazaar/openbazaar-go; go run openbazaard.go start)
  • Don't forget to give this script executable permissions to: sudo chmod +x run.sh
  • To run the script: sudo bash run.sh

Step 4: Update your node

  • Any time you need to update your node, type: (cd $GOPATH/src/github.com/OpenBazaar/openbazaar-go; sudo git pull)
  • Again, you can create a script: sudo nano update.sh
#!bin/bash
(cd $GOPATH/src/github.com/OpenBazaar/openbazaar-go; sudo git pull)
  • Give executable permissions to the script: sudo chmod +x update.sh
  • To run the script: sudo bash update.sh
@ajsingh007
Copy link

Thanks for the writeup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment