Skip to content

Commit

Permalink
chore(cleanup): high-level rename, cleanup & simplified of code gover…
Browse files Browse the repository at this point in the history
…nance for #1370 (#1371)

* high-level name rename and remove

* clean up docs and examples

* cleanup apps README.md

* simplified package.json details

* update website and README.md to point to new repo
  • Loading branch information
fuxingloh authored Apr 25, 2022
1 parent 2266340 commit 7a8c318
Show file tree
Hide file tree
Showing 42 changed files with 118 additions and 337 deletions.
1 change: 0 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ labels:

checks:
- context: "Semantic Pull Request"
url: "https://github.com/DeFiCh/jellyfish/blob/main/.github/labeler.yml"
description:
success: Ready for review & merge.
failure: "Missing semantic title or label for merge [kind(directory): title]"
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DeFi Jellyfish Contributing Guide

You need `node v16`, and `npm v8` for this project, it's required to set
up [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces).
up [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces).

```shell
npm install
Expand Down Expand Up @@ -91,16 +91,16 @@ TODO comments should usually include the author's github username in parentheses
## Publishing

`"version": "0.0.0"` is used because publishing will be done automatically
by [GitHub releases](https://github.com/DeFiCh/jellyfish/releases) with connected workflows. On
by [GitHub releases](https://github.com/JellyfishSDK/jellyfish/releases) with connected workflows. On
release `types: [ published ]`, GitHub Action will automatically build all packages in this repo and publish it into
npm. All packages in this mono-repo will require `"peerDependencies": "defichain"` this setup ensures all
subsequent `@defichain/*` package uses the same version.

For packages with accompanying docker images, they are published automatically to GitHub Container Registry
(ghcr.io/defich). When a new [GitHub releases](https://github.com/DeFiCh/whale/releases) is triggered, GitHub Action
will automatically build the docker image in this repo and publish it. Two images are created for each release
targeting `linux/amd64` and `linux/arm64`. The latest tag will always be updated with the last release and semantic
release is enforced for each release.
(ghcr.io/jellyfishsdk). When a new [GitHub releases](https://github.com/JellyfishSDK/jellyfish/releases) is triggered,
GitHub Action will automatically build the docker image in this repo and publish it. Two images are created for each
release targeting `linux/amd64` and `linux/arm64`. The latest tag will always be updated with the last release and
semantic release is enforced for each release.

## Explicit over implicit

Expand Down Expand Up @@ -143,7 +143,7 @@ mass of code concentration within project that were better separated.
## Code of conduct

Please follow the guidelines outlined at https://github.com/DeFiCh/.github/blob/main/CODE_OF_CONDUCT.md
Please follow the guidelines outlined at https://github.com/JellyfishSDK/.github/blob/main/CODE_OF_CONDUCT.md

## IntelliJ IDEA

Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[![CI](https://github.com/DeFiCh/jellyfish/actions/workflows/ci.yml/badge.svg)](https://github.com/DeFiCh/jellyfish/actions/workflows/ci.yml)
[![CI](https://github.com/JellyfishSDK/jellyfish/actions/workflows/ci.yml/badge.svg)](https://github.com/JellyfishSDK/jellyfish/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/DeFiCh/jellyfish/branch/main/graph/badge.svg?token=IYL9K0WROA)](https://codecov.io/gh/DeFiCh/jellyfish)
[![Maintainability](https://api.codeclimate.com/v1/badges/7019f1d74a0500951b2a/maintainability)](https://codeclimate.com/github/DeFiCh/jellyfish/maintainability)
[![npm](https://img.shields.io/npm/v/@defichain/jellyfish-network)](https://www.npmjs.com/package/@defichain/jellyfish-network)
[![Netlify Status](https://api.netlify.com/api/v1/badges/c5b7a65e-aeec-4e12-a7b7-300cbc1a8069/deploy-status)](https://app.netlify.com/sites/cranky-franklin-5e59ef/deploys)

# [@defichain/jellyfish](https://jellyfish.defichain.com)
# [@defichain/jellyfish](https://jellyfishsdk.com)

> https://jellyfish.defichain.com
> https://jellyfishsdk.com
DeFiChain Jellyfish SDK. A collection of TypeScript + JavaScript tools and libraries to build Native DeFi products.

Expand All @@ -17,8 +16,7 @@ We are consolidating all jellyfish ecosystem projects ocean, whale and playgroun

- For better synergy of DeFiChain open source development across all concerns.
- Consistent versioning for all ecosystem releases with a single source of truth.
- Documentation for the entirety of the jellyfish ecosystem via `jellyfish.defichain.com`. Incorporating sample and
playground.
- Documentation for the entirety of the jellyfish ecosystem via `jellyfishsdk.com`. Incorporating sample and playground.
- Early regression detection upstream to downstream changes with monolithic repo structure.

</details>
Expand All @@ -36,10 +34,11 @@ the way to make it merge-able. Here are some of our documented [contributing gui
## Security issues

If you discover a security vulnerability in
`DeFiCh/jellyfish`, [please see submit it privately](https://github.com/DeFiCh/.github/blob/main/SECURITY.md).
`JellyfishSDK/jellyfish`,
[please see submit it privately](https://github.com/JellyfishSDK/.github/blob/main/SECURITY.md).

## License & Disclaimer

By using `DeFiCh/jellyfish` (this repo), you (the user) agree to be bound by [the terms of this license](LICENSE).
By using `JellyfishSDK/jellyfish` (this repo), you (the user) agree to be bound by [the terms of this license](LICENSE).

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FDeFiCh%2Fjellyfish.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FDeFiCh%2Fjellyfish?ref=badge_large)
13 changes: 7 additions & 6 deletions apps/ocean-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ DeFiChain Ocean API, next^2 generation API for building scalable Native DeFi App

## Motivation

> https://github.com/DeFiCh/jellyfish/issues/580
> https://github.com/JellyfishSDK/jellyfish/issues/580
As part of [#580](https://github.com/DeFiCh/jellyfish/issues/580) consolidation efforts. We had multiple projects that
were extensions of the jellyfish project. The separated projects allowed us to move quickly initially but proves to be a
bottleneck when it comes to development.
As part of [#580](https://github.com/JellyfishSDK/jellyfish/issues/580) consolidation efforts. We had multiple projects
that were extensions of the jellyfish project. The separated projects allowed us to move quickly initially but proves to
be a bottleneck when it comes to development.

By including Ocean API development with jellyfish, it creates a better synergy of DeFiChain open source development
across concerns. Singular versioning, source of truth, documentation of entirety of defichain
via [jellyfish.defichain.com](https://jellyfish.defichain.com).
via [jellyfishsdk.com](https://jellyfishsdk.com).

## `/apps/ocean-api`

Expand All @@ -23,7 +23,8 @@ of `ocean-api`. Featuring 2 main directories `/controllers` and `/modules`.

### `/packages/ocean-api-client`

> Provides the protocol core for communicating between client and server. Within `ocean-api-client`, it contains a shared response and exception structure.
> Provides the protocol core for communicating between client and server. Within `ocean-api-client`, it contains a
> shared response and exception structure.
The official JS client for ocean-api. As the development of ocean-api client and server are closely intertwined, this
allows the project to move iteratively together. With them packaged together within the same repo, the server and client
Expand Down
5 changes: 2 additions & 3 deletions apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
"private": true,
"name": "@defichain-apps/nest-apps",
"version": "0.0.0",
"description": "A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin",
"repository": "DeFiCh/jellyfish",
"bugs": "https://github.com/DeFiCh/jellyfish/issues",
"description": "SDK & Ecosystem for building modern lite DeFi Applications at scale.",
"repository": "JellyfishSDK/jellyfish",
"license": "MIT",
"scripts": {
"build": "nest build",
Expand Down
18 changes: 9 additions & 9 deletions apps/playground-api/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# DeFiChain Playground API (DeFiCh/playground)
# Playground API

Migration of the entire `DeFiCh/playground` project into `DeFiCh/jellyfish/apps/playground-api`. This project is
different from `DeFiCh/jellyfish/packages/playground`.
Migration of the entire `JellyfishSDK/playground` project into `JellyfishSDK/jellyfish/apps/playground-api`. This
project is different from `JellyfishSDK/jellyfish/packages/playground`.

## Motivation

> https://github.com/DeFiCh/jellyfish/issues/580
> https://github.com/JellyfishSDK/jellyfish/issues/580
As part of [#580](https://github.com/DeFiCh/jellyfish/issues/580) consolidation efforts. We had multiple projects that
were extensions of the jellyfish project. The separated projects allowed us to move quickly initially but proves to be a
bottleneck when it comes to development.
As part of [#580](https://github.com/JellyfishSDK/jellyfish/issues/580) consolidation efforts. We had multiple projects
that were extensions of the jellyfish project. The separated projects allowed us to move quickly initially but proves to
be a bottleneck when it comes to development.

> https://github.com/DeFiCh/jellyfish/issues/978
> https://github.com/JellyfishSDK/jellyfish/issues/978
We need to maintain this project regardless of the slated deprecation. By migrating this project into
`DeFiCh/jellyfish`, we can maintain it in one place.
`JellyfishSDK/jellyfish`, we can maintain it in one place.

13 changes: 9 additions & 4 deletions apps/rich-list-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ DeFiChain Rich List API, a stateful microservice to compute and keep rich list.

## Motivation

> https://github.com/DeFiCh/jellyfish/issues/1053
> https://github.com/JellyfishSDK/jellyfish/issues/1053
Introduce a new application as microservice allows [Ocean API](https://github.com/DeFiCh/jellyfish/tree/main/apps/ocean-api) to push in active addresses (which conducted transaction on DeFiChain) and publishs rich list.
Introduce a new application as microservice
allows [Ocean API](https://github.com/JellyfishSDK/jellyfish/tree/main/apps/ocean-api) to push in active addresses
(which conducted transaction on DeFiChain) and publishes rich list.

## `/apps/rich-list-api`

Expand All @@ -20,12 +22,15 @@ The server of rich-list-api, build with @nestjs, consists of implementation for

### `/packages/rich-list-client`

> Provides the protocol core for communicating between client and server. Within `rich-api-client`, it contains a shared response and exception structure.
> Provides the protocol core for communicating between client and server. Within `rich-api-client`, it contains a shared
> response and exception structure.
The TypeScript client to interact with [rich-list-api](###/api).

### `/packages/rich-list-core`

> This package is not published, for internal use within `@defichain-apps/rich-list-api` only.
`@defichain/rich-list-core` consists of most of the core logic and implementation of `rich-list-api` with two dependency modules being injectable. By providing dependencies specification (interface) to allows core logic being developed and tested without any specified infrastructure.
`@defichain/rich-list-core` consists of most of the core logic and implementation of `rich-list-api` with two dependency
modules being injectable. By providing dependencies specification (interface) to allows core logic being developed and
tested without any specified infrastructure.
6 changes: 3 additions & 3 deletions apps/status-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ DeFiChain Status API, providing the statuses of different DeFiChain services.


## Motivation
> https://github.com/DeFiCh/jellyfish/issues/1270
> https://github.com/JellyfishSDK/jellyfish/issues/1270
To decouple the DeFiChain products from the status page, the approach of having a centralised provider to determine each DeFiChain service status with a pre-defined logic will allow it to be maintained consistently throughout. This will allow other apps or services to share the status from the same Status APIs.

### `/blockchain`
>https://github.com/DeFiCh/jellyfish/issues/1271
>https://github.com/JellyfishSDK/jellyfish/issues/1271
To provide the status of the blockchain based on the block creation time interval

Expand All @@ -31,7 +31,7 @@ To provide the status of each oracle given the address based on the last publish


### `/overall`
>https://github.com/DeFiCh/jellyfish/issues/1274
>https://github.com/JellyfishSDK/jellyfish/issues/1274
To provide the aggregated status of all services required by Light Wallet & Scan (Blockchain & Ocean).

50 changes: 2 additions & 48 deletions apps/whale/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
[![CI](https://github.com/DeFiCh/whale/actions/workflows/ci.yml/badge.svg)](https://github.com/DeFiCh/whale/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/DeFiCh/whale/branch/main/graph/badge.svg?token=kBCC9qSRrA)](https://codecov.io/gh/DeFiCh/whale)
[![Maintainability](https://api.codeclimate.com/v1/badges/593ffda9c1d91261a37b/maintainability)](https://codeclimate.com/github/DeFiCh/whale/maintainability)
[![TS-Standard](https://badgen.net/badge/code%20style/ts-standard/blue?icon=typescript)](https://github.com/standard/ts-standard)

# DeFi Whale

The super index for DeFi Blockchain to simplify DeFi light implementation.

> 🚧 Work in progress, DeFi Whale is considered Alpha Software. Use at your own risk, APIs are yet not finalized.
## Developing & Contributing

Thanks for contributing, appreciate all the help we can get. Feel free to make a pull-request, we will guide you along
the way to make it merge-able. Here are some of our documented [contributing guidelines](CONTRIBUTING.md).

You need `node v14`, and `npm v7` for this project, it's required to set
up [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces).

```shell
npm install
```

### Testing

There are three types of tests required for DeFi Whale.

All types of tests required Docker
as [`@defichain/testcontainers`](https://github.com/DeFiCh/jellyfish/tree/main/packages/testcontainers) will
automatically spin up `regtest` instances for testing. The number of containers it will spin up concurrently is
All types of tests required Docker as [`@defichain/testcontainers`](https://jellyfishsdk.com/testing/testcontainers)
will automatically spin up `regtest` instances for testing. The number of containers it will spin up concurrently is
dependent on your jest `--maxConcurrency` count. Test are known to be flaky due to the usage of multiple Docker
containers for test concurrency.

Expand Down Expand Up @@ -59,27 +37,3 @@ Coverage is collected for unit and e2e tests at each pull request to main with `
```shell
jest
```

### Publishing

Docker images are published automatically to GitHub Container Registry (ghcr.io/defich). When a
new [GitHub releases](https://github.com/DeFiCh/whale/releases) is triggered, GitHub Action will automatically build the
docker image in this repo and publish it. Two images are created for each release targeting `linux/amd64`
and `linux/arm64`. The latest tag will always be updated with the last release and semantic release is enforced for each
release.

### IntelliJ IDEA

IntelliJ IDEA is the IDE of choice for writing and maintaining this library. IntelliJ's files are included for
convenience with basic toolchain setup but use of IntelliJ is totally optional.

### Security issues

If you discover a security vulnerability in `DeFi Whale`,
[please see submit it privately](https://github.com/DeFiCh/.github/blob/main/SECURITY.md).

## License & Disclaimer

By using `DeFi Whale` (this repo), you (the user) agree to be bound by [the terms of this license](LICENSE).

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FDeFiCh%2Fwhale.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FDeFiCh%2Fwhale?ref=badge_large)
2 changes: 1 addition & 1 deletion docs/node/02-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {blocks} = await client.mining.getMiningInfo()
## IEEE-754 arbitrary precision

Due to the dynamic nature of the JavaScript language, it forces all number to be interpolated as IEEE-754 which can
cause precision to be lost. [DeFiCh/jellyfish/issues/18](https://github.com/DeFiCh/jellyfish/issues/18)
cause precision to be lost. [JellyfishSDK/jellyfish/issues/18](https://github.com/JellyfishSDK/jellyfish/issues/18)

```js
it('lost precision converting DFI 😥', () => {
Expand Down
10 changes: 5 additions & 5 deletions docs/ocean/01-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ slug: /
:::info BETA API v0 & beyond

Ocean REST API is currently in public BETA, all endpoint is prefixed with `/v0`. As part of
[DeFiCh/jellyfish#580](https://github.com/DeFiCh/jellyfish/issues/580) consolidation effort to creating better
development synergy, `/v1` of the API is undergoing redesign and will look very different from `/v0`.
`/v0` of the API is **used in production by `DeFiCh/wallet` and `DeFiCh/scan`**, the API will be long-lived with
[JellyfishSDK/jellyfish#580](https://github.com/JellyfishSDK/jellyfish/issues/580) consolidation effort to creating
better development synergy, `/v1` of the API is undergoing redesign and will look very different from `/v0`.
`/v0` of the API is **used in production by `JellyfishSDK/wallet` and `DeFiCh/scan`**, the API will be long-lived with
frequent incremental change with backward compatibility.

:::
Expand All @@ -19,8 +19,8 @@ frequent incremental change with backward compatibility.

Ocean REST API is a global infrastructure project hosted by DeFiChain to simplify building decentralized light
applications. Powered by the Jellyfish Ecosystem, it features a super index that extends the capability of `defid`. The
project is currently housed in [DeFiCh/whale](https://github.com/DeFiCh/whale), they are getting consolidated into
`DeFiCh/jellyfish` as a single monorepo project.
project is currently housed in [JellyfishSDK/whale](https://github.com/JellyfishSDK/whale), they are getting
consolidated into `JellyfishSDK/jellyfish` as a single monorepo project.

Ocean Nodes are globally distributed around the world, any API request is served by the node nearest to the requester
with auto fail-over.
Expand Down
2 changes: 1 addition & 1 deletion docs/testing/03-jellyfish-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ testing.poolpair // for poolpair setup with reasonable defaults

<details>

<summary>Usage within DeFiCh/jellyfish/packages</summary>
<summary>Usage within JellyfishSDK/jellyfish/packages</summary>

### Cyclic dependencies

Expand Down
2 changes: 1 addition & 1 deletion examples/ocean-dex-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a very simple example to fetch live DEX Pool Pair information from `ocea
The ocean API is a publicly available endpoint to provide DeFiChain developers access to a fleet of highly available
data nodes powered by the jellyfish ecosystem.

> https://github.com/DeFiCh/whale/tree/main/packages/whale-api-client/src/api
> https://github.com/JellyfishSDK/whale/tree/main/packages/whale-api-client/src/api
## How to use this example?

Expand Down
2 changes: 1 addition & 1 deletion examples/ocean-masternodes-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a very simple example to fetch Masternode information from `ocean.defich
The ocean API is a publicly available endpoint to provide DeFiChain developers access to a fleet of highly available
data nodes powered by the jellyfish ecosystem.

> https://github.com/DeFiCh/whale/tree/main/packages/whale-api-client/src/api
> https://github.com/JellyfishSDK/whale/tree/main/packages/whale-api-client/src/api
## How to use this example?

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
"private": false,
"name": "defichain",
"version": "0.0.0",
"description": "A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin",
"repository": "DeFiCh/jellyfish",
"bugs": "https://github.com/DeFiCh/jellyfish/issues",
"description": "SDK & Ecosystem for building modern lite DeFi Applications at scale.",
"repository": "JellyfishSDK/jellyfish",
"license": "MIT",
"files": [],
"workspaces": [
Expand Down
12 changes: 2 additions & 10 deletions packages/jellyfish-address/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
"private": false,
"name": "@defichain/jellyfish-address",
"version": "0.0.0",
"description": "A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin",
"keywords": [
"DeFiChain",
"DeFi",
"Blockchain",
"API",
"Bitcoin"
],
"repository": "DeFiCh/jellyfish",
"bugs": "https://github.com/DeFiCh/jellyfish/issues",
"description": "SDK & Ecosystem for building modern lite DeFi Applications at scale.",
"repository": "JellyfishSDK/jellyfish",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
Loading

0 comments on commit 7a8c318

Please sign in to comment.