Skip to content

Commit 3df6b73

Browse files
committed
feat(plugin-ledger-connector-besu): contract deployment and tests
Signed-off-by: Peter Somogyvari <[email protected]>
1 parent f23e38f commit 3df6b73

File tree

30 files changed

+3879
-25
lines changed

30 files changed

+3879
-25
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ docs/main
77
logs/
88
jspm_packages/
99

10-
# TypeScript v1 declaration files
11-
typings/
12-
1310
# Optional npm cache directory
1411
.npm
1512

CONTRIBUTING.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,21 @@ To protect the Hyperledger Cactus source code, GitHub pull requests are accepted
2727
1. Initiate a pull request from your fork to the base repository
2828
1. Await CI, DCO & linting quality checks, as well as any feedback from reviewers
2929

30-
### Adding a new dependency to one of the packages:
30+
### Adding a new public npm dependency to one of the packages:
3131

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

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

3839
If you are adding a development dependency you can use the `--dev` option and `--peer` for a peer dependency.
40+
41+
### Adding a sibling package npm dependency to one of the packages:
42+
43+
For example the `bif-test-tooling` can be added as a dev dependency to the besu ledger connector plugin's package this way:
44+
45+
```sh
46+
npx lerna add @hyperledger-labs/bif-test-tooling --scope '*/*plugin-ledger-connector-besu' --exact --dev
47+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
/**
3+
* Common interface to be implemented by plugins which are implementing the connection to ledgers.
4+
*/
5+
export interface IPluginLedgerConnector {
6+
7+
/**
8+
* Deploys the BIF build-in smart contract written for this ledger to manage the validator's public keys.
9+
*/
10+
deployContract(): Promise<void>;
11+
12+
/**
13+
* Adds the public key to the ledger state.
14+
*
15+
* @param publicKeyHex The HEX representation of a public key of a BIF node.
16+
*/
17+
addPublicKey(publicKeyHex: string): Promise<void>;
18+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export { IPluginLedgerConnector } from './plugin/ledger-connector/i-plugin-ledger-connector';
12
export { IPluginKVStorage } from './plugin/storage/key-value/i-plugin-kv-storage';
23
export { IPluginKeychain } from './plugin/keychain/i-plugin-keychain';
34
export { PluginFactory } from './plugin/plugin-factory';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# `@hyperledger-labs/bif-plugin-ledger-connector`
2+
3+
> TODO: description
4+
5+
## Usage
6+
7+
```
8+
// TODO: DEMONSTRATE API
9+
```

0 commit comments

Comments
 (0)