Convector Rest Server BETA 1.0

Walter Montes
Jun 19 · 3 min read

As some of you know, we have had an experimental project called conv-rest-api that aims to create REST servers without a single line of code from your smart contract.

The project initially contributed by Luca Tamburrano has raised enormous interest in developers, so we decided to get involved in the matter and help the development with our core team.

We are glad to announce the first BETA release of the Convector Rest Server. The project is published here.

The idea is simple, build your smart contract, get a back end REST server without coding extra pieces.

You create your smart contract, regularly, through the Convector CLI and then use that spec to create your backend server.

During these months, we came to realise that even if our initial hypothesis behind Convector was that, since it was JavaScript-based (TypeScript), it would make things way easier for devs getting into blockchain, however, the reality is that not everybody has experience with NodeJS and its concepts, even if they know JavaScript or other C-derived programming languages.

Want to give it a try?

The general pre-requisites for Convector and Hyperledger Fabric are:

Make sure you have all the utils necessary.

Let’s create a testing project:

Open it with your preferred code editor.

You’ll see your whole project structure bootstrapped for you. Now let’s make a few changes on the car smart contract.

We simply added a new function called get that will return 1 car by Id.

Create your new REST server 🛠

Here’s an example of how this JSON file should be structured:

It basically says function X in controller Y will be mapped to verb Z in the API Server.

Once, we have this file ready, we can call the util to generate the API and compile the dependencies.

That’s all! 🎉 Now you have a Rest server autogenerated. If you need to refresh changes you did on your smart contract, just run the previous command before (beware that that will erase any customizations you did).

Start the server, the local blockchain network with Hurley, and send a few transactions.

As you can see, now you have a fully working API Server auto-generated from your smart contract. 🎊

You can now call that API from any application you may have ready to consume the blockchain such an SAP, Salesforce, SharePoint, or your own Java, C#, Python server, or even frontend technologies like Angular or React, and IoT devices.

Host the REST server anywhere you want to access your development local network with Hurley or your production network with Forma or a custom Hyperledger Fabric deployment.

This server will automatically expose your smart contract to the world, give it an identity, and handle the complexities of multi-node communication into a single endpoint.

Join the conversation in our Discord chat app! Find help, discover other devs, build your community!


WorldSibu is the core contributor to Convector, a Hyperledger Labs project, and one of the preferred enterprise open source frameworks for smart contract systems.

Covalent

A unified development platform to create and deploy enterprise smart contract systems.

Walter Montes

Written by

CEO @ Covalent — https://covalentx.com

Covalent

Covalent

A unified development platform to create and deploy enterprise smart contract systems.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade