Verifying that "christroutner.id" is my Blockstack ID. https://onename.com/christroutner
<!DOCTYPE html> | |
<!-- | |
Note: This is a proof of concept for creating a new listing on OpenBazaar 2.0 beta sever v0.10.0. | |
Based on this API guide: | |
https://api.openbazaar.org/ | |
Documentation is pretty sparse in the OB repo right now, so this took a lot of hacking and reverse engineering. | |
For this example to work, you have to set up your config file. On linux, the config file is locted in ~/openbazaar2.0/ |
This is an iptables script that should be copied to the /etc/iptables/rules.v4
file.
This script is based on this blog entry.
The goal is to setup a Docker container that is restricted from attacking the host.
The code below allows DNS to pass through, but blocks the Docker container from direct access to the 192.168.x.x subnet. It also enforces this same rule on the Host, in case it was to get hacked.
This script needs to be customized for each hardware target, as the name of the ethernet port will change. I also want to incorporate some ideas from this article:
- Prevent DoS Attack
The file below is a very insecure, but easy, way to set up an OpenBazaar BCH store.
The reason it's insecure is because it turns on CORS and sets the login and password to yourUsername/yourPassword.
{
"API": {
"HTTPHeaders": null
},
"Addresses": {
I hereby claim:
- I am christroutner on github.
- I am christroutner (https://keybase.io/christroutner) on keybase.
- I have a public key ASChDmOrWQCAjODenzwkjqFLU-qYn0-dRWOSNGpKS6C8zwo
To claim this, I am signing this object:
[ | |
{ | |
owner: 'bcoe', | |
repo: 'top-npm-users', | |
description: ':star: Generate a list of top npm users by based on monthly downloads.', | |
language: 'JavaScript', | |
isFork: false, | |
stargazers: 27, | |
watchers: 27 | |
} |
It took me way too long and way too much trial and error to figure out how to turn on Cross Origin Resource Sharing (CORS) on my Koa 2 API. The problem is that there are too many ways and too many versions of all the pieces. It's not difficult if you follow the example below.
Note: You can download working code using this Koa 2 API Boilerplate repository.
The key insight that finally enabled me to success was this blog post, which used kcors library in favor of the koa-cors library.
{ | |
"API": { | |
"HTTPHeaders": null | |
}, | |
"Addresses": { | |
"API": "", | |
"Announce": null, | |
"Gateway": "/ip4/0.0.0.0/tcp/4002", | |
"NoAnnounce": null, | |
"Swarm": [ |
/* | |
*/ | |
"use strict"; | |
console.log('hello world.'); |
This gist is an example of how unit tests could be written for the Wormholecash
repo. The example below is taken from the balancesForAddress
test in the
dataRetrieval.js
test file.
The original test looks like this:
// This is technically an 'integration' test because it makes a live HTTP call.
describe("#balancesForAddress", () => {