Skip to content

Commit

Permalink
Merge pull request #112 from blockchain-certificates/doc/updated-readme
Browse files Browse the repository at this point in the history
doc(README): updated broken links; added SR badge
  • Loading branch information
raiseandfall authored Sep 25, 2018
2 parents c3626c8 + a16e9e5 commit e591375
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.com/blockchain-certificates/cert-verifier-js.svg?branch=master)](https://travis-ci.com/blockchain-certificates/cert-verifier-js)
[![codecov](https://codecov.io/gh/blockchain-certificates/cert-verifier-js/branch/master/graph/badge.svg)](https://codecov.io/gh/blockchain-certificates/cert-verifier-js)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

A library to parse and verify [Blockcerts](https://www.blockcerts.org/) certificates.

Expand Down Expand Up @@ -30,7 +31,7 @@ let certificate = new Certificate(certificateDefinition);
```

#### Script tag (iife)
[Check an example here](https://github.com/blockchain-certificates/@blockcerts/cert-verifier-js/blob/master/test/e2e/script-tag.html)
[Check an example here](https://github.com/blockchain-certificates/cert-verifier-js/blob/master/test/e2e/script-tag.html)
```html
<script src='node_modules/@blockcerts/cert-verifier-js/dist/verifier-iife.js'></script>
<script>
Expand Down Expand Up @@ -74,7 +75,7 @@ fs.readFile('./certificate.json', 'utf8', function (err, data) {
console.log(`The step ${code} fails with the error: ${errorMessage}`);
}
});

if (verificationResult.status === 'failure') {
console.log(`The certificate is not valid. Error: ${verificationResult.errorMessage}`);
}
Expand Down Expand Up @@ -123,7 +124,7 @@ The certificate instance has the following properties:
- `rawTransactionLink`: `String`. Raw transaction ID
- `transactionLink`: `String`. Transaction link
- `verificationSteps`: `VerificationStep[]`. The array of steps the certificate will have to go through during verification
- `version`: `CertificateVersion`. [Version of the certificate](https://github.com/blockchain-certificates/@blockcerts/cert-verifier-js/blob/master/src/constants/certificateVersions.js)
- `version`: `CertificateVersion`. [Version of the certificate](https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/constants/certificateVersions.js)

**Note:** `verificationSteps` is generated according to the nature of the certificate. The full steps array is provided ahead of verification in order to give more flexibility to the consumer. For example, you might want to pre-render the verification steps for animation, or render a count of steps and/or sub-steps.

Expand Down Expand Up @@ -156,7 +157,7 @@ console.log(`Verification was a ${certificateVerification.status}:`, certificate
```

#### Parameters
- `({code, label, status, errorMessage}) => {}` (`Function`): callback function called whenever a substep status has changed. The callback parameter has 4 properties:
- `({code, label, status, errorMessage}) => {}` (`Function`): callback function called whenever a substep status has changed. The callback parameter has 4 properties:
- `code`: substep code
- `label`: readable label of the substep
- `status`: substep status (`success`, `failure`, `starting`)
Expand All @@ -176,11 +177,11 @@ Several constants are being exposed:
```javascript
import { BLOCKCHAINS, STEPS, SUB_STEPS, CERTIFICATE_VERSIONS, VERIFICATION_STATUSES } from '@blockcerts/cert-verifier-js';
```
- [`BLOCKCHAINS`](https://github.com/blockchain-certificates/@blockcerts/cert-verifier-js/blob/master/src/constants/blockchains.js): descriptive object of all blockchains supported by the library
- [`STEPS`](https://github.com/blockchain-certificates/@blockcerts/cert-verifier-js/blob/master/src/constants/verificationSteps.js): descriptive object of all verification steps (top level)
- [`SUB_STEPS`](https://github.com/blockchain-certificates/@blockcerts/cert-verifier-js/blob/master/src/constants/verificationSubSteps.js): descriptive object of all verification substeps
- [`CERTIFICATE_VERSIONS`](https://github.com/blockchain-certificates/@blockcerts/cert-verifier-js/blob/master/src/constants/certificateVersions.js): list of all certificate versions
- [`VERIFICATION_STATUSES`](https://github.com/blockchain-certificates/@blockcerts/cert-verifier-js/blob/master/src/constants/verificationStatuses.js)
- [`BLOCKCHAINS`](https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/constants/blockchains.js): descriptive object of all blockchains supported by the library
- [`STEPS`](https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/constants/verificationSteps.js): descriptive object of all verification steps (top level)
- [`SUB_STEPS`](https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/constants/verificationSubSteps.js): descriptive object of all verification substeps
- [`CERTIFICATE_VERSIONS`](https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/constants/certificateVersions.js): list of all certificate versions
- [`VERIFICATION_STATUSES`](https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/constants/verificationStatuses.js)

### i18n
The exposed function `getSupportedLanguages()` returns an array of language codes supported by the library.
Expand All @@ -206,7 +207,7 @@ $ npm run build
The build files are in the `dist` folder.

## Verification process
If you want more details about the verification process, please check out the [documentation](./docs/verification-process.md).
If you want more details about the verification process, please check out the [documentation](https://github.com/blockchain-certificates/cert-verifier-js/blob/master/docs/verification-process.md).

# Contact

Expand Down

0 comments on commit e591375

Please sign in to comment.