March 2019
Intermediate to advanced
636 pages
27h 50m
English
As you can see in app.js, the API functions from channel creation to chaincode instantiation are implemented as express routes:
app.post('/channel/create', async function(req, res) { ... });app.post('/channel/join', async function(req, res) { ... });app.post('/chaincode/install', async function(req, res) { ... });app.post('/chaincode/instantiate', async function(req, res) { ... });
To exercise these routes, the end user must log in as an administrator and use the returned token. Taking the output from the previous call, we can request channel creation as follows:
curl -s -X POST http://localhost:4000/channel/create -H "authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1MjUwMDU4OTEsInVzZXJuYW1lIjoiYWRtaW4iLCJvcmdOYW1lIjoiaW1wb3J0ZXJvcmciLCJpYXQiOjE1MjUwMDE3NTF9.BYIEBO_MZzQa52_LW2AKVhLVag9OpSiZsI3cYHI9_oA" ...
Read now
Unlock full access