Skip to content

Commit f35f71c

Browse files
committed
refactor: modernize repo structure and config
- is now a Yarn Workspace with an offline cache - nests the prototype code in a package as a temporary measure. - removes Jenkins in favour of GH Actions - Adds a docker-compose file with cardano-node-ogmios
1 parent b392ef0 commit f35f71c

File tree

388 files changed

+3062
-4931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

388 files changed

+3062
-4931
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.eslintrc.js
2+
*.d.ts
3+
graphql_types.ts
4+
*jest.config.js

.eslintrc.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"standard"
5+
],
6+
"plugins": [
7+
"@typescript-eslint"
8+
],
9+
"rules": {
10+
"no-unused-vars": 0,
11+
"linebreak-style": [
12+
2,
13+
"unix"
14+
],
15+
"no-unused-expressions": 0,
16+
"no-useless-constructor": 0
17+
}
18+
}

.github/images/cardano-logo.png

10.6 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches: [ "master" ]
6+
push:
7+
branches: [ "master" ]
8+
tags: [ "*.*.*" ]
9+
10+
jobs:
11+
build_and_test:
12+
strategy:
13+
matrix:
14+
os: [ ubuntu-20.04 ]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: 📥 Checkout repository
18+
uses: actions/[email protected]
19+
with:
20+
submodules: true
21+
22+
- name: 🧰 Setup Node.js
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: 14.4
26+
27+
- name: ↪ Set package version
28+
id: package-version
29+
uses: martinbeentjes/npm-get-version-action@master
30+
with:
31+
path: clients/TypeScript
32+
33+
- name: 🔨 Build
34+
working-directory: clients/TypeScript
35+
run: |
36+
yarn install --frozen-lockfile --non-interactive --logevel=error
37+
yarn generate-schema-types
38+
yarn build
39+
yarn lint
40+
41+
- name: 🔬 Test
42+
if: matrix.network == 'testnet'
43+
working-directory: clients/TypeScript
44+
run: |
45+
docker run -d --name cardano-node-ogmios -p 1338:1337 -v ${{ runner.temp }}/db-${{ matrix.network }}:/db cardanosolutions/cardano-node-ogmios:${{ github.sha }}-${{ matrix.network }}
46+
../../scripts/wait-for-sync.sh 1338 1
47+
yarn test
48+
docker stop cardano-node-ogmios
49+
docker rm cardano-node-ogmios
50+
51+
- name: 📦 Pack
52+
run: |
53+
./scripts/pack.sh
54+
55+
- name: 📤 Upload npm packages
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: cardano-ogmios-clients-ts-packages
59+
path: |
60+
packages/prototype/cardano-js-sdk-prototype-${{ steps.package-version.outputs.current-version}}.tgz

.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
11
node_modules
2-
dist
3-
tsconfig.tsbuildinfo
4-
.nyc_output
5-
coverage
6-
documentation

.idea/.gitignore

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/cardano-js-sdk.iml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.nvm

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v14.15.0

.versionrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"skip": {
3+
"commit": true,
4+
"tag": true
5+
},
6+
"tag-prefix": ""
7+
}

.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
yarn-offline-mirror "./packages-cache"
2+
yarn-offline-mirror-pruning true

Jenkinsfile

-36
This file was deleted.

LICENSE

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Apache License
32
Version 2.0, January 2004
43
http://www.apache.org/licenses/
@@ -187,7 +186,7 @@
187186
same "printed page" as the copyright notice for easier
188187
identification within third-party archives.
189188

190-
Copyright [yyyy] [name of copyright owner]
189+
Copyright © 2021 IOHK
191190

192191
Licensed under the Apache License, Version 2.0 (the "License");
193192
you may not use this file except in compliance with the License.

LICENSE_NOTICE NOTICE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Copyright 2019 IOHK
1+
Copyright 2021 IOHK
22

33
Licensed under the Apache License, Version 2.0 (the "License”). You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.txt
44

5-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

README.md

+9-53
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,12 @@
1-
# Cardano JS SDK
1+
<p align="center">
2+
<big><strong>Cardano JS SDK</strong></big>
3+
</p>
24

3-
[![Build Status](http://13.238.211.79:8080/buildStatus/icon?job=cardano-js-sdk%2Fdevelop)](http://13.238.211.79:8080/blue/organizations/jenkins/cardano-js-sdk/)
5+
<p align="center">
6+
<img width="200" src=".github/images/cardano-logo.png"/>
7+
</p>
8+
<hr/>
49

5-
JavaScript SDK for interacting with Cardano, providing various key management options including support for popular hardware wallets. The library supports multiple Cardano APIs by establishing a [_Provider_](src/Provider/Provider.ts) interface. This is beneficial for both development workflow and production scenarios, as application logic does not become coupled to any one implementation.
10+
## Overview
611

7-
There are two _provider_ types, and it is important to understand the difference when using the SDK. We have defined the _CardanoProvider_ and _WalletProvider_.
8-
9-
To satisfy the _CardanoProvider_ interface, the _provider_ must be able to supply a complete, queryable interface into the chain state. Any address should be queryable for both historic transactions and current UTXOs. When interfacing with a _CardanoProvider_, we use the _ClientWallet_ implementation to satisfy wallet behaviour.
10-
11-
A _WalletProvider_ satisfies a smaller interface than _CardanoProvider_. The _WalletProvider_ maintains historic chain state only for address sets derived from known parent public keys, which are stored server side. When interfacing with a _WalletProvider_, we use the _RemoteWallet_ implementation to satisfy wallet behaviour, which is in most cases a simple mapping directly to the _WalletProvider_.
12-
13-
- [Style Guide](docs/style_guide.md)
14-
- [More documentation](docs)
15-
16-
## Project State: Alpha
17-
18-
This SDK is a work in progress and should not be used in production. The initial _provider_ and Cardano _primitive_ implementations are in the base package at this stage, but the intention is to publish separate packages to allow for composition into a clean and minimal bundle.
19-
20-
### Feature progress
21-
22-
- [x] Build a transaction and estimate fees
23-
- [x] Transaction input selection
24-
- [ ] Transaction signing
25-
- [x] memory
26-
- [x] Ledger Nano S
27-
- [ ] Trezor
28-
- [ ] Message signing and verification
29-
- [x] memory
30-
- [ ] Ledger Nano S
31-
- [ ] Trezor
32-
- [ ] Cardano Providers
33-
- [ ] [cardano-wallet](https://github.com/input-output-hk/cardano-wallet)
34-
- [ ] [Yoroi/Soshen](https://soshen.io/api-docs.html)
35-
- [ ] Staking and Delegation
36-
37-
## Examples
38-
The below examples are implemented as integration tests, they should be very easy to understand.
39-
40-
- [Generate a keypair in memory from a BIP39 mnemonic](src/test/MemoryKeyManager.spec.ts)
41-
- [Message signatures](src/test/SignAndVerify.spec.ts)
42-
- [Get the wallet balance for a BIP44 Account](src/test/WalletBalance.spec.ts)
43-
- [Determine the next change and receipt addresses for a BIP44 Account](src/test/DetermineNextAddressForWallet.spec.ts)
44-
- [Transaction input selection](src/test/SelectInputsForTransaction.spec.ts)
45-
- [Interact with a remote wallet](src/test/RemoteWalletIntegration.spec.ts)
46-
47-
## Tests
48-
49-
Run the test suite with `npm test`.
50-
51-
### Ledger Nano S Specs
52-
To run the ledger specs:
53-
- Have a Ledger device connect, unlocked and in the Cardano app
54-
- Run `LEDGER_SPECS=true npm test`
55-
56-
You will need to interact with the device during the test run.
12+
A Yarn Workspace containing packages the collectively forms the SDK, written in TypeScript.

docker-compose.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3.5"
2+
3+
services:
4+
cardano-node-ogmios:
5+
image: cardanosolutions/ogmios:v4.0.0-beta.4-${NETWORK:-mainnet}
6+
logging:
7+
driver: "json-file"
8+
options:
9+
max-size: "400k"
10+
max-file: "20"
11+
ports:
12+
- ${OGMIOS_PORT:-1337}:1337
13+
restart: on-failure
14+
volumes:
15+
- node-db:/db
16+
17+
volumes:
18+
node-db:

docs/README.md

-2
This file was deleted.

docs/setup_a_local_cardano_network_and_provider_using_docker.md

-10
This file was deleted.

0 commit comments

Comments
 (0)