sob.rb - Automatically Post OpenBazaar Listings on GOLOS #openbazaar
Overview
This script (sob.rb
) allows you to automatically post and update OpenBazaar listings on the GOLOS blockchain.
Install
To use this Radiator script:
Linux
$ sudo apt-get install ruby-full git openssl libssl1.0.0 libssl-dev
$ gem install bundler
macOS
$ gem install bundler
I've tested it on various versions of ruby. The oldest one I got it to work was:
ruby 2.2.5, with native extensions
First, clone this gist and install the dependencies:
$ git clone https://gist.github.com/95ff25885035e6c9eae6e97ef84ba591.git sob
$ cd sob
$ bundle install
Edit the file sob.yml
and set your store API information. Also set the account you want to post with. You must use the posting-wif.
Upgrade
Typically, you can upgrade to the latest version by this command, from the original directory you cloned into:
$ git pull
Usually, this works fine as long as you haven't modified anything. If you get an error, try this:
$ git stash --all
$ git pull --rebase
$ git stash pop
If you're still having problems, I suggest starting a new clone.
Usage
To do the actual post/update (this will post all contracts):
$ ruby sob.rb contract:all broadcast:true
The sob.rb
script will now post all contracts on your store. If you update any of your contracts, you can run the same script again to update the blockchain. When updating, in order to avoid blockchain bloat, this script will automatically send a diff
patch of changes.
To only post/update a single contract, pass the GUID:
$ ruby sob.rb contract:<contract guid> broadcast:true
Check here to see an updated version of this script:
https://gist.github.com/inertia186/95ff25885035e6c9eae6e97ef84ba591
Troubleshooting
Problem: What does this error mean?
sob.yml:1: syntax error, unexpected ':', expecting end-of-input
Solution: You ran ruby sob.yml
but you should run ruby sob.rb
.
See my previous Ruby How To posts in: #radiator #ruby
Get in touch!
If you're using sob, I'd love to hear from you. Drop me a line and tell me what you think! I'm @inertia on STEEM and SteemSpeak.
License
I don't believe in intellectual "property". If you do, consider sob as licensed under a Creative Commons License.