Tuesday, February 11, 2014

The Error You Get When You Try to Run register-new-key.js in in the PaySwarm Examples when disconnected from the Internet

$ node register-new-key.js
Reading config from: "/home/shambaughlab/.config/payswarm1/default"...
[register-new-key] failed to register key:
 Error: getaddrinfo ENOTFOUND
    at errnoException (dns.js:37:11)
    at Object.onanswer [as oncomplete] (dns.js:124:16)

Thursday, February 6, 2014

Notes from PaySwarm Wordpress Plugin., pt 4

I reinstalled Wordpress, but I found some errors of my doing when I did so. The first thing that I noticed was that I forgot to type make in the console, therefore rendering the plugin inoperable. It gave an error that it could not find jsonld.php (if I can recall correctly). After typed make in the console as it suggests on the github website (https://github.com/digitalbazaar/payswarm-wordpress/blob/master/README.md) I ran into another error that involved not registering a key. I saw this error when I was trying to create a new post. It reported an issue with line 1321 of the file payswarm-client.inc with registering a private key (if I can recall correctly). I then ran into another error  when I was trying to register the key. I got an error in a pop-up box with the title, "404 Not Found", and the contents, "Not Found" for the title, and "The requested URL /wordpress/wp-content/plugins/payswarm/payswarm-register.php was not found on this server" for the body.

Right now I figure the next step is to change the title of the payswarm plugin folder from "payswarm-wordpress" to payswarm.

I found that I had trouble getting the wordpress console to recognize the change, so I logged out then reinstalled the payswarm plugin from github in the wordpress plugins folder I took care to avoid the errors that I made before. In addition, I discovered that I needed to publish my posts rather than just preview them. It seems to work now:

Go to the links at http://bshambaugh.org/wordpress/

Wednesday, February 5, 2014

Notes from PaySwarm Wordpress Plugin., pt 3

I went through the Webkeys Demo for Wordpress
(https://www.youtube.com/watch?v=LlXlJj2UeZU) and I got this output:
 /----------------------------------------
Error The vendor that you are attempting to purchase something from has provided us with a bad asset listing. This is typically a problem with their e-commerce software. You may want to notify them of this issue.

Error Details httpStatusCode: 400 listing: http://bshambaugh.org/wordpress/?p=7#listing listingHash: urn:sha256:25722494b760808671d80bbfb9e11a4be9e72825642e1083df47bf4ae9415707 --------------------------------------------/ I am not sure why.

The reason why I was not able to see the Payswarm buttons before, or really anything, must have been because I did not put any Payswarm related stuff in my blog post. Namely stuff like: BEGIN_PAYSWARM_UNPAID_ONLY_CONTENT, END_PAYSWARM_UNPAID_ONLY_CONTENT, PAYSWARM_ACCESS_BUTTON, BEGIN_PAYSWARM_PAID_CONTENT, END_PAYSWARM_PAID_CONTENT which is mentioned where I downloaded the plugin.
https://github.com/digitalbazaar/payswarm-wordpress

Heh, I guess I must have skipped  couple of steps. I was following the video, and not all of the steps are mentioned in it, but they are mentioned on the github site. Time to start again.

Notes from WordPress Plugin for PaySwarm, pt 2

When I clicked on register this site at dev.payswarm.com I found I had to change my password, which involved using a special e-mail in my e-mail account. I am not sure why this was.

Once I did have a usable password I accessed the Payswarm login screen through a pop-up window. I got a warning message at the Access Key Registration Screen that told me that although this page was encrypted the information is being sent over an unencrypted connection. I think this okay, and I think I heard Manu talk about it during a payswarm teleconference.

Once I had the plugin installed I was not sure how to use the plugin to limit the amount of my blog that was viewed without payment.

Actually I do not see the post appearing at all:

http://bshambaugh.org/wordpress/


Notes from PaySwarm WordPress Plugin, pt 1, (about git and ssh and sshfs)

I found it easiest to clone the PaySwarm git repository to my local machine and then copy the files to my Webfaction server. It appears that I can also sshfs into the Webfaction server and run git directly there.

I can unmount my network folder using fusermount -u ~/{truncated_path_to_file_folder} (1), where remote_server where {truncated_path_to_file_folder} is the name that I gave to my network folder that was originally mounted from the command line with the command: sshfs username@server.webfaction.com:{path_to_target_folder} {path_to_folder_on_local_machine} where {truncated_path_to_file_folder} was in my path on the local machine. To get fusermount to work correctly, I must close the console window that is accessing the file folder on the local machine. If I do not I get the error: fusermount: failed to unmount {path_to_folder_on_local_machine}: Device or resource busy.

To simply ssh into my webfaction server I use ssh username@server.webfaction.com (2). I find I can actually run git from there, but not npm which in a terminal that is not sshed into it. I figure git must be installed on the server that I am acessing. If I use sshfs it appears the folder appears as if it was local, so everything that works on my local machine will work in the mounted network folder in a gross extrapolation.

See this for reference:
(1) https://help.ubuntu.com/community/SSHFS
(2) http://docs.webfaction.com/user-guide/access.html#connecting-with-ssh

Sunday, February 2, 2014

Results of Purchasing with PaySwarm

I am going through the PaySwarm Mozilla Hacks tutorial at:

 https://hacks.mozilla.org/2013/04/web-payments-with-payswarm-purchasing-part-3-of-3/

There were some issues with the sqllite database after the merger as detailed in this public-webpayments@w3.org mailing list thread:

http://lists.w3.org/Archives/Public/public-webpayments/2014Feb/0006.html

Purchasing from the console was also difficult, as detailed here:

http://lists.w3.org/Archives/Public/public-webpayments/2014Feb/0011.html

I ended up having two usernames, but I eventually got through things.

Todo: Web Keys Demo - WordPress
https://www.youtube.com/watch?v=LlXlJj2UeZU

Goal: Have some sort of website using PaySwarm


Results of Publishing an Asset with a Payswarm Authority

I went through the tutorial and I got this:

brent@brent-desktop:~/payswarm.js/examples$ curl http://listings.dev.payswarm.com/payswarm.js/143f0b8a0ab#asset | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
103  3199    0  3199    0     0  11259      0 --:--:-- --:--:-- --:--:-- 25388
{
   "@graph" : [
      {
         "assetContent" : "http://listings.dev.payswarm.com/payswarm.js/143f0b8a0ab",
         "creator" : {
            "fullName" : "publish-asset-for-sale.js Example"
         },
         "assetProvider" : "https://dev.payswarm.com/i/brentshambaugh",
         "@context" : "https://w3id.org/payswarm/v1",
         "signature" : {
            "created" : "2014-02-02T03:51:08Z",
            "signatureValue" : "bALjKXXuAbj2XnfyivqWQO6Kzm+JOursrmevlpeK0OmZfC06bZqC9AiO4La6FD7ShZlJizc6uxUxgLWgs5EjyuFsz6BkF3ezxv7fmQAa1v3Vr+zrw4VN+XBu8GTGpIkWAv226Wu8ELtrL72YEStL1YOmetoyC0Ec4lLQDunqYkkSscTOjJIl/l0l9NSjsQj3NYYTxS1dHcMs5j4PDLXCe4pkUoCA9FpJna6SMdgto0wbPSniDsmb6p6n3E/ILYd4VMOnB11eczUIZ94xpJ8EJyJdVTpMw7r/6eDZwVlpwtTIIH75ZZhOrIvW+DVMk7gt/ExNwCqk/5PHchb2jWFQMA==",
            "creator" : "https://dev.payswarm.com/i/brentshambaugh/keys/1",
            "type" : "GraphSignature2012"
         },
         "id" : "http://listings.dev.payswarm.com/payswarm.js/143f0b8a0ab#asset",
         "type" : [
            "Asset",
            "pto:WebPage"
         ],
         "title" : "Test Asset 143f0b8a0ab",
         "listingRestrictions" : {
            "validUntil" : "2015-02-02T03:51:08Z",
            "payeeRule" : [
               {
                  "payeeGroupPrefix" : [
                     "authority"
                  ],
                  "type" : "PayeeRule"
               },
               {
                  "payeeRateType" : "FlatAmount",
                  "payeeGroup" : [
                     "vendor"
                  ],
                  "type" : "PayeeRule",
                  "payeeApplyType" : "ApplyExclusively"
               }
            ],
            "payee" : [
               {
                  "payeeRateType" : "Percentage",
                  "destination" : "https://dev.payswarm.com/i/brentshambaugh/accounts/primary",
                  "currency" : "USD",
                  "comment" : "Asset Provider Royalty",
                  "payeeRate" : "80",
                  "minimumAmount" : "0.01",
                  "payeeGroup" : [
                     "assetProvider"
                  ],
                  "id" : "http://listings.dev.payswarm.com/payswarm.js/143f0b8a0ab#asset-payee-1",
                  "type" : "Payee",
                  "payeeApplyType" : "ApplyInclusively",
                  "payeeApplyGroup" : [
                     "vendor"
                  ]
               }
            ],
            "validFrom" : "2014-02-02T03:51:08Z"
         }
      },
      {
         "licenseHash" : "urn:sha256:d9dcfb7b3ba057df52b99f777747e8fe0fc598a3bb364e3d3eb529f90d58e1b9",
         "payeeRule" : [
            {
               "maximumPayeeRate" : "10",
               "payeeRateType" : "Percentage",
               "payeeGroupPrefix" : [
                  "authority"
               ],
               "type" : "PayeeRule",
               "payeeApplyType" : "ApplyInclusively"
            }
         ],
         "assetHash" : "urn:sha256:02817609f8ffb72502e002defe7a426f8d433802f866ac88fc93c318b9130840",
         "payee" : [
            {
               "payeeRateType" : "FlatAmount",
               "destination" : "https://dev.payswarm.com/i/brentshambaugh/accounts/primary",
               "currency" : "USD",
               "payeeRate" : "0.05",
               "comment" : "Payment for selling Test Asset 143f0b8a0ab.",
               "payeeGroup" : [
                  "vendor"
               ],
               "id" : "http://listings.dev.payswarm.com/payswarm.js/143f0b8a0ab#listing-payee-1",
               "type" : "Payee",
               "payeeApplyType" : "ApplyExclusively"
            }
         ],
         "license" : "https://w3id.org/payswarm/licenses/blogging",
         "validFrom" : "2014-02-02T03:51:08Z",
         "validUntil" : "2015-02-02T03:51:08Z",
         "signature" : {
            "created" : "2014-02-02T03:51:08Z",
            "signatureValue" : "fYb/QH0Ot3NALFtCsRxZR0rCAu76FUKjFwfWzD+PXYj/QtjC8Bcf+0eSlpo/89w/eZbuCqQ5O5SgTHyrhwGUgLFRlwsZYWwG7dgqXBlSh/zIAOf3PQ2IXyvGEQypIwggaJoBUmvRRoE1pJcBdVGXnINu3hTevUJisomPEDV37fi77EV+yihT+FRoQ9si/gXG7PQxD/8PnJ6a+N6Ix9jknRgF1q4xRf9mlBERW8fdP2GbPa2sHcrev4QD1fEUPjBonN+UxM0FEMM9rc7+PkiFribNStrV6F3s66MBF6m7zjkvRqXDuAdL3P2gQpOat9/P5iVmK6loHIHgZPePFoFf/A==",
            "creator" : "https://dev.payswarm.com/i/brentshambaugh/keys/1",
            "type" : "GraphSignature2012"
         },
         "@context" : "https://w3id.org/payswarm/v1",
         "id" : "http://listings.dev.payswarm.com/payswarm.js/143f0b8a0ab#listing",
         "type" : [
            "Listing",
            "gr:Offering"
         ],
         "asset" : "http://listings.dev.payswarm.com/payswarm.js/143f0b8a0ab#asset",
         "vendor" : "https://dev.payswarm.com/i/brentshambaugh"
      }
   ],
   "@context" : "https://w3id.org/payswarm/v1"
}

Saturday, February 1, 2014

Review of the Video "PaySwarm - Asset Registration"

I went through the video "Payswarm - Asset Registration" on YouTube. I found that I needed to install the perl module json_pp by following the instructions in README to complete it. More related information is available at Mozilla Hacks with PaySwarm: Assets and Listings (part 2 of 3) that I will have to check out more tomorrow.

Registering a Key with Payswarm.js

In the past two days I went through "Web Payments with PaySwarm: Identity (part 1 of 3)" on the Mozilla Hacks website. I encountered some difficulty due to an outdated version of payswarm.js and a few missing modules. The latest version of payswarm.js is available at https://github.com/digitalbazaar/payswarm.js. The modules are available at the npm website https://npmjs.org/. The ones I installed were: ursa, async, jsonld, mkdirp, pkginfo, prompt, and commander. I did this with the "npm install [module name]" command, e.g. npm install ursa. I talked on the IRC channel #payswarm and received a response from dlongley archived in this thread on the webpayments mailing list.