Skip to content
An API to enable the storage of non-repudiable data using different mechanisms.
JavaScript Shell Go Dockerfile HTML CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
selinux @ ac687fb

NR API front-end

An API to enable the storage of non-repudiable data.

Prerequisites: NR mechanisms

1. Fabric


Install (older version of) Fabric docker images.

$ curl -sSL | bash -s -- 1.4.0 1.4.0 0.4.15 -s -b

setup and run chain

From :

Besides Fabric SDK, we also needs handling X509 certificate and cryptography.

inside chain/basic-network

Bring up Basic Network and check if all five containers are up and running. After that the Basic Network is up and running with a channel mychannel is created and the peer node joins the channel.

$ ./ && docker-compose -f docker-compose.yml up -d cli
$ docker ps

Check all five containers are up and running.

any directory

After Basic Network is up and running, we can work on the chaincode installation and instantiation.

$ docker exec cli peer chaincode install -n docrec -v 1.0 -p ""
$ docker exec cli peer chaincode instantiate -o -C mychannel -n docrec -v 1.0 -c '{"Args":[]}' -P "OR ('Org1MSP.member')"

setup chain for NR (docker)

Fabric NR setup happens alongside API setup.

setup chain for NR (non-docker)

inside chain/docrec

$ npm init -y
$ npm install fabric-ca-client fabric-network crypto-js jsrsasign -S

Use enrollAdmin.js to enrol an admin. If admin is in docrec/wallet, it is already enrolled and it will be used later.

$ node enrollAdmin.js
$ ls wallet

Use registerUser.js to enrol users alice and bob. If they are already in the docrec/wallet, they are already enrolled and can be used later.

$ node registerUser.js alice
$ ls wallet

We later needs the certificate from alice for signature validation. The certificate can be found inside the wallet. The directory is docrec/wallet/alice/alice.

$ cat wallet/alice/alice

Use any editor to extract it and keep them into a file: wallet/alicecert.

2. Bucket

inside bucket/certs


Generate certschain/basic-network


inside bucket

run (docker)

docker-compose build
docker-compose up -d

run (non-docker)


3. SELinux

Checkout submodule:

git submodule init
git submodule update

Change into vagrant directory:

cd selinux/_vagrant

Startup Vagrant machine:

vagrant up --no-provision
vagrant provision

NB. as of now, openssh-selinux can only be installed into the Vagrant VM with --nocheck.

Enable Selinux enforcement in VM:

vagrant ssh
sudo setsebool secure_mode_policyload on
sudo setenforce 1

Note IP address of main interface:



inside main repo

installation (docker)

Add IP address of vagrant machine to api/routes/selinux.js.

$ docker-compose up -d

installation (non-docker)

inside api
$ npm init -y
$ npm install fabric-ca-client fabric-network crypto-js jsrsasign -S

Install and bring up API.

$ npm install
$ npm start

Reference certs for SSL bucket use:

export NODE_EXTRA_CA_CERTS=../bucket/certs/nr.crt



You can’t perform that action at this time.