Commit dfb89b9d authored by Krystian Gaus's avatar Krystian Gaus

meetup model added

parent 5210a5f1
# Hyperledger meetup-network
\ No newline at end of file
/**
* createDelivery function.
* @param {org.trackntrace.models.assets.delivery.createDelivery} tx - The createDelivery transaction instance.
* @param {org.meetup.models.assets.delivery.createDelivery} tx - The createDelivery transaction instance.
* @transaction
*/
async function createDelivery(tx)
......@@ -41,7 +41,7 @@ async function createDelivery(tx)
/**
* updateDelivery transaction processor function.
* @param {org.trackntrace.models.assets.delivery.updateDelivery} tx - The updateDelivery transaction instance.
* @param {org.meetup.models.assets.delivery.updateDelivery} tx - The updateDelivery transaction instance.
* @transaction
*/
async function updateDelivery(tx)
......
......@@ -2,7 +2,7 @@
* getHash function.
*
* The returned value is always an integer casted to string.
* Probably there are better hash functions, but for short term use it's okay,
* There are better hash functions, but for short term use it's okay,
* source: https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript
*
* @param {string} str - The string to hash
......
/**
* getLocation function.
* @param {org.trackntrace.models.assets.delivery.createDelivery} tx - The createDelivery transaction instance.
* @param {org.meetup.models.assets.delivery.createDelivery} tx - The createDelivery transaction instance.
*/
async function getLocation(tx)
{
......
const factory = getFactory();
const nsDelivery = 'org.trackntrace.models.assets.delivery';
const nsLocation = 'org.trackntrace.models.assets.location';
const nsPerson = 'org.trackntrace.models.participants.person';
const nsDelivery = 'org.meetup.models.assets.delivery';
const nsLocation = 'org.meetup.models.assets.location';
const nsPerson = 'org.meetup.models.participants.person';
const tDelivery = 'Delivery';
const tLocation = 'Location';
......
/**
* createPerson function.
* @param {org.trackntrace.models.participants.person.createPerson} tx - The createPerson transaction instance.
* @param {org.meetup.models.participants.person.createPerson} tx - The createPerson transaction instance.
* @transaction
*/
async function createPerson(tx)
......
/deployment/admin@trackntrace-network.card
/deployment/REST_SERVER_PID
\ No newline at end of file
# Hyperledger trackntrace-network
\ No newline at end of file
prerequisites:
- installed 'jq'. this can be installed in a terminal via 'sudo apt install jq'
\ No newline at end of file
#!/bin/bash
echo "Start creating new trackntrace-network.bna..."
composer archive create -a ../trackntrace-network.bna -t dir -n ../
\ No newline at end of file
#!/bin/bash
NEW_REST_SERVER_PID=$(ps -o pid= | head -n 1)
installedNetworkVersion=$(composer network ping -c admin@trackntrace-network | head -n 2 | tail -1 | cut -d':' -f2 | tr -d ' ')
version=$(cat ../package.json | jq .version | tr -d \")
echo "Installed Business Network version:" $installedNetworkVersion
echo "Latest found Business Network version:" $version
if [ $installedNetworkVersion == 'Commandfailed' ]
then
# The Business Network must be installed and started for the first time
composer network install -a ../trackntrace-network.bna -c PeerAdmin@hlfv1
composer network start -n trackntrace-network -V $version -c PeerAdmin@hlfv1 -A admin -S adminpw
else
if [ $installedNetworkVersion == $version ]
then
echo "Skipping installation and start/upgrade of Business Network because latest version is already installed."
else
# The installedNetworkVersion and the latest found version differ, thus the Business Network has to be upgraded
composer network install -a ../trackntrace-network.bna -c PeerAdmin@hlfv1
composer network upgrade -c PeerAdmin@hlfv1 -n trackntrace-network -V $version
fi
echo "Killing process of running Composer REST Server..."
kill -9 $(head -1 REST_SERVER_PID)
fi
echo "Writing new process number" $NEW_REST_SERVER_PID "of terminal to REST_SERVER_PID file..."
echo $NEW_REST_SERVER_PID > REST_SERVER_PID
echo "Process number saved successfully."
echo "Starting Composer REST Server..."
composer-rest-server -c admin@trackntrace-network -n required -w true
#use the following line if a api key is needed
#composer-rest-server -c admin@trackntrace-network -n required -y u4nyxpcrc3frPjszkjgxunu3wqmiBiyz -w true
\ No newline at end of file
{"name":"trackntrace-network","author":"author","description":"Start from scratch with a blank business network","version":"0.0.112","devDependencies":{"browserfs":"^1.2.0","chai":"^3.5.0","composer-admin":"latest","composer-cli":"latest","composer-client":"latest","composer-connector-embedded":"latest","eslint":"^3.6.1","istanbul":"^0.4.5","jsdoc":"^3.4.1","mkdirp":"^0.5.1","mocha":"^3.2.0","moment":"^2.19.3"},"keywords":[],"license":"Apache 2.0","repository":{"type":"e.g. git","url":"URL"},"scripts":{"deploy":"./scripts/deploy.sh","doc":"jsdoc --pedantic --recurse -c jsdoc.conf","lint":"eslint .","postlicchk":"npm run doc","postlint":"npm run licchk","prepublish":"mkdirp ./dist && composer archive create --sourceType dir --sourceName . -a ./dist/unnamed-network.bna","pretest":"npm run lint","test":"mocha --recursive"}}
namespace org.trackntrace.models.assets.delivery
namespace org.meetup.models.assets.delivery
import org.trackntrace.models.assets.location.Location
import org.trackntrace.models.participants.person.Person
import org.meetup.models.assets.location.Location
import org.meetup.models.participants.person.Person
asset Delivery identified by shippingId
{
......
namespace org.trackntrace.models.assets.location
namespace org.meetup.models.assets.location
asset Location identified by id
{
......
namespace org.trackntrace.models.participants.person
namespace org.meetup.models.participants.person
participant Person identified by name
{
......
{"name":"meetup-network","author":"author","description":"Start from scratch with a blank business network","version":"0.0.1","devDependencies":{"browserfs":"^1.2.0","chai":"^3.5.0","composer-admin":"latest","composer-cli":"latest","composer-client":"latest","composer-connector-embedded":"latest","eslint":"^3.6.1","istanbul":"^0.4.5","jsdoc":"^3.4.1","mkdirp":"^0.5.1","mocha":"^3.2.0","moment":"^2.19.3"},"keywords":[],"license":"Apache 2.0","repository":{"type":"e.g. git","url":"URL"},"scripts":{"deploy":"./scripts/deploy.sh","doc":"jsdoc --pedantic --recurse -c jsdoc.conf","lint":"eslint .","postlicchk":"npm run doc","postlint":"npm run licchk","prepublish":"mkdirp ./dist && composer archive create --sourceType dir --sourceName . -a ./dist/unnamed-network.bna","pretest":"npm run lint","test":"mocha --recursive"}}
......@@ -14,7 +14,7 @@
/**
* Access control rules for trackntrace-network
* Access control rules for meetup-network
*/
rule Default
......@@ -22,7 +22,7 @@ rule Default
description: "Allow all participants access to all resources"
participant: "ANY"
operation: ALL
resource: "org.trackntrace.models.participants.person.*"
resource: "org.meetup.models.participants.person.*"
action: ALLOW
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment