Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lukerQuant committed Mar 28, 2023
2 parents 813c538 + 98f729e commit dc8a9a5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 84 deletions.
104 changes: 22 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ If all supported Distributed Ledger Technologies (DLTs) are necessary, the bundl
npm install @quantnetwork/overledger-bundle
```

Or, if you prefer using [yarn](https://yarnpkg.com/):

```
yarn add @quantnetwork/overledger-bundle
```

Alternatively, the suite of node packages allows developers to chose which DLTs they would like to utilise by installing the core overledger package and the individual DLT packages. For example, if you only want to use the Ethereum blockchain, you will need only the overledger-core and overledger-ethereum packages, which you can install via:

Expand All @@ -41,76 +36,9 @@ npm install @quantnetwork/overledger-core
npm install @quantnetwork/overledger-dlt-ethereum
```

Or, if you prefer using [yarn](https://yarnpkg.com/):

```
yarn add @quantnetwork/overledger-core
yarn add @quantnetwork/overledger-dlt-ethereum
```

#### Building

The Overledger JavaScript SDK manages multiple packages through [Lerna](https://lerna.js.org/). To build the SDK, first we need to globally install the lerna dependency:

```
npm install -g lerna@4.0.0
```

To build the project, first download the yarn package manager:

```
npm install -g yarn
```

Then, we can run build:

```
yarn run build
```

>Note: For Windows users, please use git bash as the build currently uses UNIX-based commands. You will also need to make sure you have 'make' installed for windows. This is done by running powershell first as Administrator and then installing make with chocolatey: ```choco install make```
This will build and link the packages together.

To test if the package built correctly, you can run:

```
yarn run test
```

**Note: to run all the tests locally, you will need to have an available completed (and unencrypted) env file. What should go in the env is discussed [here](./examples/README.md).**

#### Installing

After building, you can install it in your own project. Make sure to specify the version if you'd like to use this version of the SDK vs the public one from NPM.

```
npm install @quantnetwork/overledger-bundle@2.2.1
```

Or, if you prefer using [yarn](https://yarnpkg.com/):

```
yarn add @quantnetwork/overledger-bundle@2.2.1
```

Alternatively, the suite of packages allows developers to chose which DLTs they would like to utilise by installing the core package and the individual DLT packages. For example, if you only want to use the Ethereum blockchain, you will need only the overledger-core and overledger-ethereum packages, which you can install via:

```
npm install @quantnetwork/overledger-core@2.2.1
npm install @quantnetwork/overledger-dlt-ethereum@2.2.1
```

Or, if you prefer using [yarn](https://yarnpkg.com/):

```
yarn add @quantnetwork/overledger-core
yarn add @quantnetwork/overledger-dlt-ethereum
```

## Getting started

To get started, you can take a look at the examples folder for basic use cases.
To get started, you can take a look at the examples folder for basic use cases.

Alternatively, you can investigate the exercises used in Quant's Beginner's Guide to Blockchain course [here](https://github.com/quantnetwork/blockchain-developer-exercises-foundations).

Expand All @@ -123,32 +51,36 @@ The functions which interact with the Overledger API (get, post) return a promis

The full Overledger API Swagger docs can be found [here](https://docs.overledger.io/).

## Development
## Development (if you plan to update the SDK itself)

If updating the SDK, please follow this short development guide. Note that when you perform any modification on this SDK, you will need to re-lint, re-test and re-document before merging your code. Your pull request will fail if there is any issue with these three components.

The Overledger JavaScript SDK manages multiple packages through [Lerna](https://lerna.js.org/). To develop the SDK, first install lerna:
### Building

The Overledger JavaScript SDK manages multiple packages through [Lerna](https://lerna.js.org/). To build the SDK, first we need to globally install the lerna dependency:

```
npm install -g lerna
npm install -g lerna@4.0.0
```

To build the project, download the yarn package manager and run:
To build the project, first download the yarn package manager:

```
yarn run build
npm install -g yarn
```

This will build and link the packages together.

### Linting
> Note: For Windows users, please use git bash as the build currently uses UNIX-based commands. Furthermore, depending on your NodeJS installation, you might not be able to use any npm dependencies before you add nodejs and npm to your Environment Variables Path. For example, adding to Path: `C:\Program Files\nodejs` and `C:\Users\your-username\AppData\Roaming\npm`. You will also need to make sure you have 'make' installed for Windows. This is done by running git bash as administrator and installing make with chocolatey: `choco install make`
Make sure to also lint the code base after your updates.

Then, we can run build:

```
yarn run lint
yarn run build
```

This will build and link the packages together.

### Running tests

**Note: to run all the tests locally, you will need to have an available completed (and unencrypted) env file. What should go in the env is discussed [here](./examples/README.md).**
Expand All @@ -161,6 +93,14 @@ yarn test

To run tests on a specific package, change directories to that specific package and run the test command there.

### Linting

Make sure to also lint the code base after your updates.

```
yarn run lint
```

### Documentation

Please update the documentation after your changes by editing the JSDoc annotations inside the source files and then run the following command from the root directory:
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

## Setup

To run the examples we need to modify the file called '.env' in the root directory of the project and paste in the required variables that you will be securing. Before doing so, you will need to create accounts and fund them.
To run the examples we need to modify the file called '.env' in the root directory of the project and paste in the required variables that you will be securing. Then, you will need to create accounts and fund them, before adding further details to the '.env' file and securing it again.

### Creating Accounts

You will need to have DLT accounts to create transactions. The following example will create and console log new DLT accounts for all of the Bitcoin, Ethereum, Substrate and XRP ledger distributed ledger technologies:

```
node examples/account-creation/generate-accounts.js
node examples/create-account/create-account.js
```

**NOTE that key pairs can be reused on different DLT networks of the same DLT type including mainnets, so we recommend for you to only use these generated accounts on one particular DLT network.**
Expand Down

0 comments on commit dc8a9a5

Please sign in to comment.