
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
lblod-blockchain
Advanced tools
Proof of concept rond Lokale Besluiten als Gelinkte Open Data – centrale vindplaats en mandatendatabank.
Proof of concept rond Lokale Besluiten als Gelinkte Open Data – centrale vindplaats en mandatendatabank.
First you need to get lblod into your project. This can be done using the following methods:
npm install lblod-blockchain
bower install lblod-blockchain
meteor add vo-blockchain:lblod-blockchain
dist/index.js
String
- The token to the rest API (Obtained through the network admin)String
- The baseURL to the Rest API (Obtained through the network admin)Boolean
- Indicator whether development mode is enabled or notLBLOD-Blockchain
instance on which you can call any function specified below.
import LBLOD from 'lblod-blockchain';
const lblod = new LBLOD('my-api-token', 'api-base-url', false);
String
- The id of the besluit (Uri typically)String
- The besluit which should be hashed (Object must be able to be stringified)Promise
- Returns the transactionId of the publication on the blockchain
import LBLOD from 'lblod-blockchain';
// besluit MUST be processable by a stringifier and should be a JSON file
const myBesluit = besluit.toJSON();
const lblod = new LBLOD('my-api-token', 'api-base-url', false);
const txId = await lblod.publishBesluit('my-besluit-id', myBesluit);
boolean
- The choice which is made (true = authenticate, false = burn)String
- The transactionId return from the function "publishBesluit" within this packageString
- The assign signer to perform the action on. Signers are obtained through the wallets exportPromise
- Returns the transactionId of the sign action on the blockchain
import LBLOD, { wallets } from 'lblod-blockchain';
// besluit MUST be processable by a stringifier and should be a JSON file
const myBesluit = besluit.toJSON();
// I choose to AUTHENTICATE the asset. True = Authenticate, False = Burn
const myChoice = true;
const lblod = new LBLOD('my-api-token', 'api-base-url', false);
const txId = await lblod.publishBesluit('my-besluit-id', myBesluit);
const result = await lblod.signBesluit(choice, txId, wallets.signer);
txId
- The transactionId return from the function "publishBesluit" within this packageString
- The besluit which should be hashed and compared to the original besluit (Object must be able to be stringified)Promise
- Returns a promise with True or False depending on the comparing results
import LBLOD from 'lblod-blockchain';
// besluit MUST be processable by a stringifier and should be a JSON file
const myBesluit = besluit.toJSON();
// fakeBesluit MUST also be processable by a stringifier and should be a JSON file.
// This process should be the EXACT same operations as the process which
// the original published besluit went through to be able to replicate the same hash and result
const myFakeBesluit = fakeBesluit.toJSON();
const lblod = new LBLOD('my-api-token', 'api-base-url', false);
const txId = await lblod.publishBesluit('my-besluit-id', myBesluit);
const result = await lblod.validateBesluit(txId, myFakeBesluit);
console.log('Is myFakeBesluit tampered? ', result);
This is an example of a service layer in your frontend application which implements all functionalities of this NPM package.
import LBLOD, { wallets } from 'lblod-blockchain';
export default class hlfService {
constructor(token){
this.lblod = new LBLOD(token);
}
publishBesluit = (besluitId, besluit) => {
return this.lblod.publishBesluit(besluitId, besluit, wallets.publisher);
};
sign = (choice, txId, signer) => {
return this.lblod.signBesluit(choice, txId, signer);
};
validate = (txId, besluit) => {
return this.lblod.validateBesluit(txId, besluit);
};
getAssetById = (txId) => {
return this.lblod.getBesluitById(txId);
};
}
- This is project is not intended to be used in any production environment as this is a Proof Of Concept and is not ready for production.
- As identity management is out of the scope of this project, all identities are handled in this package. This is NOT applicable for production and MUST be refactored
- Error handling is not included in the code examples, but don't forget to implement these with the proper try-catches or when using .then chaining, with .catch
FAQs
Proof of concept rond Lokale Besluiten als Gelinkte Open Data – centrale vindplaats en mandatendatabank.
We found that lblod-blockchain demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.