Deploying Hyperledger Composer Playground to Bluemix


Since I’ve been deploying my own variations of Composer Playground to Bluemix recently, I thought it might be worth jotting down a few notes for anyone else who wants to do the same. For example, it might be useful to have your own known level of the Playground if you’re giving demos, to avoid any new functionality from the weekly releases causing surprises.

Assuming that you already have a working Composer development environment, a Bluemix account, and the Cloud Foundry CLI installed, here’s how…

First you need the main Composer repository if you don’t have it already

git clone https://github.com/hyperledger/composer.git

 

Next, checkout the code you want to deploy. In most cases you’ll want a release that’s been through one of our weekly release parties. I’ve picked the v0.14.2 release here

cd composer
git checkout -b v0.14.2-deploy v0.14.2

 

Get lerna to do its thing

lerna bootstrap

 

Now build the playground

cd packages/composer-playground
npm run build:prod

 

Create a manifest.yml file for your application with the following content

---
  command: node cli.js
  instances: 2
  memory: 128M
  env:
    COMPOSER_CONFIG: '{"webonly":true}'

 

Log in to Bluemix (you may need to use the –sso option)

cf login

 

Push the new app

cf push <APP_NAME>

 

Enjoy!

Twenty years!


It hardly seems possible but I celebrated 20 years at IBM today! Here’s me foolishly thinking that I’d be staying for up to four years while I work out what I really want to do…

…and now I work just up the stairs from where that photo was taken. I’ve gone far!

Twenty years is a long time but I’ve done a few things on the way, so it hasn’t been at all dull!

MQSeries

I started out in technical support on a machine/OS I’d never heard of, asking such questions as, ‘Where is the design that describes what this command should do?’ Much mirth!
Later I worked in test when I discovered that ‘temporary’ generally means several years… maybe decades… probably still there actually… sorry!

Message Broker

…or whatever it happened to be called in any particular week.

Here I learned that a solution can take on a life of its own, becoming only tenuously related to, or even completely detached from, the problem it was meant to be solving. (If only someone had come up with design thinking sooner!)

Master Data Management

Lots of Master Data Management- almost 10 years of that alone!

Product information management, user interface generators (still gutted this one didn’t make it), model driven development, sketchy thingy, the MDM Developers community and probably more. There was definitely some virtual universe community in there as well.

Plus a really nice office with a window seat! And rats, and floods…

Watson

A tiny amount of Watson! Despite being barely a year, most of that time seemed to involve moving desks! Also the only time I really didn’t want to move on but serendipity led to…

Blockchain

An actual open source project this time, which is something completely new for me! And blockchain which I still think is one of the most interesting technologies to come along in… well, in the last 20 years!

And then

I doubt I’ll be in Hursley for another 20 years, so who knows. Having said that, I never intended to be there by now either!

It has been a privilege to have worked with so many amazing people who together made most of those 20 years an absolute pleasure. There really are too many to list without an Oscar speech but I will just mention two: Mark Phillips, who was a bit of a role model right from the start, and Patrick Wagstrom who you should jump at the chance to work with if you ever get the opportunity!

Game on for Fabric Composer


Earlier in the week I was pondering some blockchain gamification with @howard_is, inspired by a recent GameOn challenge for early professionals in IBM. After helping out with a run through of the IBM InterConnect Fabric Composer lab this morning, it seemed like a good opportunity to make a start.

BlueBlockAlone

Instead of running yet another car auction, I think it could be fun to have a demo based on a ‘business’ network for playing games. To keep some similar elements to the more common trading examples, I’m currently wondering if keeping tabs on multi-player adventure games would work. This is the model I’ve come up with so far, and it seems like something that could be hooked up to a simple text based (powered by Watson Conversation of course!) or graphical game interface.


/**
* Defines a data model for a multi-player game
*/
namespace org.example.game
enum ItemType {
o POTION
o WEAPON
}
asset Item identified by itemId {
o String itemId
o String name
o ItemType type
–> Player owner optional
}
asset Trophy identified by trophyId {
o String trophyId
o String name
–> Player owner optional
}
asset Game identified by gameId {
o String gameId
o Player[] players
–> Trophy prize
}
participant Player identified by characterName {
o String characterName
}

If you’re interested in playing with your own blockchain network, fire up the Fabric Composer Playground and have a go. If you want to know more @danielselman will be at InterConnect next week, or get in touch with the community. Better yet, join in!

A little more conversation


More than a year seems to have vanished somewhere since I left MDM for new adventures with Watson. It’s even been a few months since the new Conversation service first appeared on Bluemix, along with the tools I’ve been helping to build.

If you’re interested in Watson Conversation, or just curious about what I’ve been up to for the last year, these are a few blog posts which I’ve come across which explain everything better than I could:

This thing seems pretty popular, so there are videos too!

 

There are even a few GitHub repositories:

And of course, tweets

https://twitter.com/jtonline/timelines/755037714479718404

If that’s not enough, you can ask questions on Stack Overflow and dw Answers, or join the Watson Developer Community.

If you’re building something with Watson Conversation, I’d love to hear about it! And finally, if you have any tips or tricks that you could share, I’m trying to collect some for a conversation-starter project on GitHub.

Updated: lots more links!

 

And now for something completely different


After almost 10 years in Master Data Management, most of which with the rather lovely view below, I’ve moved on to Watson.

image

I can’t quite believe I stayed in the same department that long but there were plenty of fresh challenges along the way, and no shortage of people inside and outside IBM to keep it interesting.

I’ve been particularly lucky to have had so much support building up the MDM Developers community, which should be in safe hands to continue growing in the future. (If you’re interested in MDM and haven’t attended one of the live tech talk sessions, I would definitely recommend trying one. There are recordings of all the previous events on YouTube and check out Dany’s OSGi talk for a great example.)

If my first day in Watson is anything to go by, the next challenge is going to be far from dull!

Modelling restful properties


I’ve recently been playing with Liberty and JAX-RS and in an effort to remember some of what I’ve discovered, I’m going to try and keep a few notes and post them here, probably along with a few questions. If anyone else finds them useful, or knows the answers, that’s a bonus!!

To start with Creating an efficient REST API with HTTP provides a nice overview of REST APIs and JAX-RS basics has a great simple sample application to get going with… and break!

JAXRSServiceModel_Main

Armed with the basics I thought it would be interesting to model the sample application to compare the working code with what Rational Software Architect (RSA) would generate for me. Obviously that’s not the most complex model in the world but it was good to have a few examples to follow:

(Those articles made much more sense when I’d tracked down all the likely looking JAXRS, REST and UML features in the RSA installer!)

Before generating any code, it was quite nice to get some basic API documentation out of the model. Not as fancy as using Swagger UI but certainly better than no documentation!

systemproperties-apidoc

It’s only a start but that’s all for part 1. Hopefully there’ll be more posts at some point when I get further, probably along these lines:

  • Creating an OSGi Web project and generating some code
  • Using a REST client to check it works, including a puzzling Wink problem
  • Adding some debug
  • Expanding the sample with some awkward long running processing
  • Deploying to Bluemix
  • Anything else I encounter along the way!

If you know of any good articles/books/fancy new media that would help, please leave recommendations below. If there are better ways to design REST services (Swagger looks interesting but I haven’t had a chance to investigate), please share them. And any other tips, comments, or questions of your own are also very welcome!

 

Java dumps


I recently had to debug a problem with the MDM Workbench where exporting a tailoring project for Information Server didn’t do anything. In fact it didn’t even report any problems!

Unfortunately the code in question likes to put a brave face on things and just reports that everything was OK, even when something goes wrong. This was the perfect opportunity to try out some of the diagnostic tools available for the IBM Java runtime, which I’ve been meaning to try for ages. I had an idea where the problem was likely to be but to find out for sure I started the workbench using the following command line:

eclipsec -vmargs -Xdump:system:events=catch,filter=java/lang/AbstractMethodError#com/ibm/mdm/tools/export/infoserver/job/MDMDatabaseDAO.queryDatabaseWithoutFilter

Sure enough the failing export produced a dump which I could check using the Memory Analyzer tool. You can get the IBM version via IBM Support Assistant but it’s probably easier to get the standard Eclipse Memory Analyzer and add the required IBM plugins from the DTFJ update site.

I’m fortunate enough to work in Hursley so I could pester someone who works on IBM Java runtime diagnostics, but there’s also a helpful article on developerWorks with details of how to trigger dumps, and how to run queries using OQL:

Debugging from dumps: Diagnose more than memory leaks with Memory Analyzer

So mystery solved- if you have an Oracle database and want to exporting tailoring projects for Information Server, make sure you set up the database connection with a more recent JDBC driver than the defaults.

Nissan Leaf Week


This morning I picked up a car for a week long test drive, which I guess wouldn’t normally warrant a blog post, except that it’s currently plugged in to a socket in the garage charging. At least I hope it’s charging: the comedy blue charge lights in the windscreen are flashing away and the Current Cost meter is stuck up at a constant 2.3 KW!

I should come clean up-front and admit that it’s highly unlikely that I’m going to trade in my current car for a Nissan Leaf, but the chance to test drive an electric car for a week was too good an opportunity to miss. I’m hoping to live blog how I get on over the week… excuse the pun.

For anyone interested in what it’s like to actually own a Leaf, there’s at least one other around Hursley already, plus Grant has had his Leaf for a lot longer than a week!

Day 1

My first journey, driving from Portsmouth to Hursley, is probably the longest I’ll be doing this week, so I’ve got any range anxiety out of the way already. I shouldn’t really be surprised, but it also proved that the Leaf is a ‘proper’ car. Somehow I was expecting there to be more in the way of compromises. Apart from a twitchy left foot, and reaching to change gears every now and then, driving is really no different to normal. That’s just the switch from a manual though- I’m sure I’ll be attempting to drive everywhere in 2nd next week!

One of the comments when I mentioned trying an electric car was about what was used to generate the electricity in the first place. While there is an environmental aspect to electric cars, that’s not really what interests me as far as the test drive goes. What they’re like to drive was the main revelation for day 1. I can see what Grant means by “comfortable refined drive of an electric vehicle” now. It’s so much smoother and more relaxing than any car I’ve driven before. The start of the trip was all motorway, which was a breeze. I did find I had to keep a close eye on the speedo since there’s no engine noise, and no changing up through the gears to give away how fast you’re actually going. It even went up hill quite happily- I was still expecting some flaw at this point!

Talking of which, there’s also an ‘eco’ mode, which I tried out after I got off the motorway. Luckily I don’t think I’ll be needing that for my short commute to work because it feels like there’s a bungee rope between the motor and the wheels when you turn it on!

The only other problem I’ve discovered so far is that the Leaf sat nav doesn’t appear to be able to read maps, so not actually electric car related!

Day 2

The good news was that the car was fully charged this morning! And as a bonus, nothing electrical has melted in the garage! (I can see why they suggest a dedicated charger now.)

Today was also the first chance to try out a completely normal commute. The battery level dropped two bars from an estimated 111 miles to 73 miles on the journey to work. Not being keen on the bungee mode, that was with ‘eco’ off, and via the M27/M3. In theory that’s going to be the least economical commute of the week, unless it gets colder and I need a heater of course!

Strangely, the battery level dropped another bar while the car was parked in Hursley for the day. Not sure whether that’s normal or not- does the battery discharge much when not in use and not charging, or perhaps I almost used three bars on the way in, or maybe temperature has something to do with the reading. Who knows. Anyway, here’s what I had in the ‘tank’ before setting off home:

OLYMPUS DIGITAL CAMERA

Since Grant’s comment defending eco mode below, and because I wasn’t going on the motorway, I decided to give eco a second chance on the way home. It certainly seems to make a difference (only one bar less by the time I got home), and it’s not too bad I suppose.

OLYMPUS DIGITAL CAMERA

Having read a bit more of the owner’s manual, I had a go at setting a timer for charging this evening. Apparently the battery life is better if you let it cool down before charging, and overnight should be better for the grid. (Getting some kind of economy 7 tariff would definitely be a good idea if I was going to be doing this regularly.) Tomorrow night I might see what the 80% charge option does to the range… it’s not far to work… and I have a backup!

Day 3

The Leaf faced its toughest challenge yet today: a mother and baby! I had thought the boot looked a bit small but it’s actually deceptively big. Plenty of space for a buggy and assorted paraphernalia, as well as two golf bags according to the manual, should that be important. The back seat also seems reasonably roomy and ISOFIX points were all present and correct. (There was also a water bottle from a previous occupant!)

With everyone securely fastened we headed to the bright lights of the local super market… and did a few gratuitous laps of the local area on the way home. This has uncovered what could be a major flaw… ‘normal’ cars always send the screaming one off to sleep, whereas there was burbling from the back seat through the whole journey!

I finally got to pull away from a red light though. Which was fun!

Day 4

Today I’ve been thinking about the practicalities of owning an electric car, namely charging. Ok, so I started out not seriously thinking a Leaf was more than a bit of fun for a week, but I’m starting to wonder.

Charging at home, it has been pointed out by Mrs JT, is a faff. While I actually prefer plugging in to charge instead of making detours and trips to petrol stations, I can’t disagree. The current arrangement ­(getting cable out of boot, plugging in to fully unwound heavy duty extension cable, turn on socket in garage) is fine for a week long test drive, but is far from ideal long term. Grant, who seems to be on commission for Nissan, suggested trying to get a free Homecharge-i charging station, which would make things much simpler.

My commute to work is only 1-2 bars, so it’s not likely I’ll need to charge up at Hursley. It would be good to have the option though, especially for a long journey after work. By coincidence the Hursley club motor subsection were meeting up at lunch time, so I went along to drum up some interest in the possibility of getting a free Zero Carbon World charging station for the clubhouse. (Another suggestion from Grant. You see a pattern emerging here!) It sounds like there’s some interest in the idea, and there’s a car rally in Hursley in September where we could try and get support to get something installed, so watch this space.

While I like the Leaf a lot, I’m still not convinced I would do journeys beyond the range of a single charge, or very rarely. Maybe an extended visit to family or friends with a suitable socket. (It’s odd that the Leaf’s range map doesn’t have a return journey option, or maybe it does and I just haven’t found it yet.) The coverage of charging points seems patchy and, worse, out of date- there’s definitely not a Best Buy charging station in Hedge End any more! Still, it looks like there might be a Waterlooville Nissan rapid charger, so I may give that a try when I have to drop the Leaf off.

Day 5

I’ve phoned the Waterlooville Nissan dealer to check on their charger, so it looks like I’ll be taking a trip there on Sunday to see what fast charging is like. I’ve also been reading a few posts on the Leaf Talk forums and there seems to be more choice in free home chargers than I was expecting. Still surprised that you don’t need an electric car to sign up for one but might be worth doing in advance.

Instead of going on about how nice it is to drive again (it is), it might be more interesting to see what’s under the bonnet…

OLYMPUS DIGITAL CAMERA

Not quite what you were expecting? Superficially it doesn’t look much different to any other car, and there’s even a 12v battery in there which is funny.

In the interests of a balanced review, one thing that is a bit weird is the contrast between all the smart key stuff for opening the doors and turning the car on, and a padlock to lock the charging cable to the car! It’s a bit annoying that you have to dig around for a key just for that padlock. (Somehow I keep losing the padlock as well!) On the subject of the charge cable, why is it stealth black? I’m amazed it’s not bright yellow or orange or something.

OLYMPUS DIGITAL CAMERA

For any UK IBMers interested in a week long Leaf test drive of their own, details are on the environment community forum.

(The lost water bottle was also reunited with its owner today!)

Day 6

Almost didn’t go anywhere in the Leaf at all today, so not much to report. Luckily there was a last minute pizza emergency providing an ideal excuse to at least do one trip. It was so short that I haven’t bothered to plug it back in to charge tonight.

Over all I think I still prefer my current car in lots of ways (better visibility, better interior, no nasty computer interfaces) but electric propulsion wins hands down. If only they did an electric Yaris!

Day 7

Unfortunately the newest member of the family is not emission free, so I didn’t get a chance to experiment with the fast charger. It would probably have been a very short experiment anyway: the battery was over 80% when I dropped the car off!

After a week with the Leaf I definitely want to drive an electric car again, and the Leaf does look like it’s the most practical of the available options. I’m tempted enough to do some investigation in to charge stations- being able to get a charger at work and for home would certainly make things more interesting. It will also be interesting going back to the old car in the morning! (Any bets on how many times I’ll stall it on the way to work?!)

This may not be the last electric car post.

Recent hacktivity


This time of year seems to be hacking season and over the last few days I’ve been along to two hackdays!

Friday was IBM’s internal Social Business Hackday. There was some MQTT hacking, a z/OS hack, hacks with Lotus Connections, hacks that could be the future of Lotus Connections, and I was attempting to hack a work around for a Jazz work item. And that was just at the Hursley local event! We were able to link up with a few other labs, but over two days there were IBMers hacking around the globe. There are going to be a lot of amazing projects to choose from when it comes to voting.

(There are a few more photos from HackDay X, and previous hackdays, on the IBM hackday group on flickr.)

For round two, today was the soutHACKton hack day. By the time I arrived the soldering and drilling had already begun!! Unfortunately I wasn’t able to stay long so I’m hoping there’ll me more of these in the future. I did just about have time to try out an idea I had to hack an old doorbell to sense people using the door knocker. A while ago I had accidentally created a touch sensor with a 555 timer while attempting to build another circuit. So my cunning plan was to deliberately create a 555 touch switch and connect it to the bolt on the inside of the front door. Unfortunately the best I could manage today was a two wire touch sensor, which isn’t going to work. At least not without leaving a wire hanging out of the letter box with some instructions attached! Unless someone who knows more about electronics can suggest a plan B, I may just resort to a boring doorbell button instead!!

DIY SOS


Last Friday was definitely the best day at work for a while: I wasn’t in the office, or anywhere near a computer!

Last year IBM celebrated it’s 100th anniversary with a celebration of service, and this year they donated 1000 hours to the Jubilee Hour book of service. Twelve of us spent a few of those hours volunteering for the Society of St James on a DIY SOS day:

Fortunately they seemed pleased with our painting skills and we managed to paint the communal corridors in one of their units of self contained flats. It’s amazing how much you can get painted in a day with that many people. Unfortunately, while there was time to start on the fences outside, I wasn’t able to con anyone in to coming home and finishing off my house!!

Thanks to Matthew Comer for organising the day and the photographic evidence.