Skip to content

Commit

Permalink
feat(plugin-ledger-connector-besu): contract deployment and tests
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed May 19, 2020
1 parent f23e38f commit 3df6b73
Show file tree
Hide file tree
Showing 30 changed files with 3,879 additions and 25 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ docs/main
logs/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

Expand Down
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,21 @@ To protect the Hyperledger Cactus source code, GitHub pull requests are accepted
1. Initiate a pull request from your fork to the base repository
1. Await CI, DCO & linting quality checks, as well as any feedback from reviewers

### Adding a new dependency to one of the packages:
### Adding a new public npm dependency to one of the packages:

For example web3 can be added as a dependency to the besu ledger connector plugin's package this way:

```sh
npx lerna add web3@latest --scope '*/*plugin-ledger-connector-besu' --exact # [--dev] [--peer]
npx lerna add is-port-reachable --scope '*/*test-tooling' --exact # [--dev] [--peer]
```

If you are adding a development dependency you can use the `--dev` option and `--peer` for a peer dependency.

### Adding a sibling package npm dependency to one of the packages:

For example the `bif-test-tooling` can be added as a dev dependency to the besu ledger connector plugin's package this way:

```sh
npx lerna add @hyperledger-labs/bif-test-tooling --scope '*/*plugin-ledger-connector-besu' --exact --dev
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

/**
* Common interface to be implemented by plugins which are implementing the connection to ledgers.
*/
export interface IPluginLedgerConnector {

/**
* Deploys the BIF build-in smart contract written for this ledger to manage the validator's public keys.
*/
deployContract(): Promise<void>;

/**
* Adds the public key to the ledger state.
*
* @param publicKeyHex The HEX representation of a public key of a BIF node.
*/
addPublicKey(publicKeyHex: string): Promise<void>;
}
1 change: 1 addition & 0 deletions packages/bif-core-api/src/main/typescript/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { IPluginLedgerConnector } from './plugin/ledger-connector/i-plugin-ledger-connector';
export { IPluginKVStorage } from './plugin/storage/key-value/i-plugin-kv-storage';
export { IPluginKeychain } from './plugin/keychain/i-plugin-keychain';
export { PluginFactory } from './plugin/plugin-factory';
9 changes: 9 additions & 0 deletions packages/bif-plugin-ledger-connector-besu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# `@hyperledger-labs/bif-plugin-ledger-connector`

> TODO: description
## Usage

```
// TODO: DEMONSTRATE API
```

0 comments on commit 3df6b73

Please sign in to comment.