Skip to content

Commit bfc36da

Browse files
authored
Docker build removal and other cleanup items (#58)
- Remove docker build and info. - Address node complaints about mismatched @polkadot/util versions. - Suppress warnings on cli scripts to simplify output. - Update README to reflect DSNP 1.3.0 parity.
1 parent 8bf3101 commit bfc36da

File tree

7 files changed

+210
-1405
lines changed

7 files changed

+210
-1405
lines changed

.dockerignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/docker-release.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 51 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Official DSNP over Frequency Schemas
22

3-
**Matching DSNP Version: v1.2.0**
3+
**Matching DSNP Version: v1.3.0**
44

55
## Use Schemas as Library
66

@@ -9,15 +9,15 @@
99
npm install @dsnp/frequency-schemas
1010
```
1111

12-
### Use Schema
12+
### Use Parquet or Avro Schema
1313

1414
```typescript
1515
import { dsnp } from "@dsnp/frequency-schemas";
1616

1717
console.log(dsnp.getSchema("broadcast"));
1818
```
1919

20-
### Get Schema Id from Chain
20+
### Get Schema Id for Connected Chain
2121

2222
```typescript
2323
import { dsnp } from "@dsnp/frequency-schemas";
@@ -27,8 +27,10 @@ const api = ApiPromise.create(/* ... */);
2727
console.log(await dsnp.getSchemaId(api, "broadcast"));
2828
```
2929

30-
Frequency mainnet and testnet have well-known Ids defined in `dsnp/index.ts`.
31-
Other configurations default to assuming `npm run deploy` has been run on a fresh chain (which is usually the case for a localhost instance), but can be overridden:
30+
The API connection is used only to identify the chain by its genesis hash.
31+
32+
Frequency chains have well-known Ids defined in `dsnp/index.ts`.
33+
However, it is possible to configure a custom mapping if needed:
3234

3335
```
3436
dsnp.setSchemaMapping(api.genesisHash.toString(), {
@@ -71,11 +73,11 @@ await writer.close();
7173

7274
## Usage
7375

74-
### To deploy/register all schemas
76+
### To register a single schema
7577

76-
```sh
77-
npm run deploy
78-
```
78+
e.g. To register the "profile-resources" schema
79+
80+
npm run deploy profile-resources
7981

8082
by default it will deploy to the `localhost` node on port 9944 using the Alice sudo test account.
8183

@@ -92,12 +94,6 @@ e.g.
9294
DEPLOY_SCHEMA_ACCOUNT_URI="//Bob" DEPLOY_SCHEMA_ENDPOINT_URL="ws://127.0.0.1:9944" npm run deploy profile-resources
9395
```
9496

95-
### To register a single schema
96-
97-
e.g. To register the "profile-resources" schema
98-
99-
npm run deploy profile-resources
100-
10197
**Note:** Requires a sudo key if deploying to a testnet.
10298
Mainnet will use the proposal system (`proposeToCreateSchema`).
10399

@@ -181,31 +177,3 @@ This script will look up and verify schemas in the schema registry that match th
181177
```sh
182178
DEPLOY_SCHEMA_ENDPOINT_URL="ws://127.0.0.1:9944" npm run find
183179
```
184-
185-
## Use with Docker
186-
187-
This repo deploys `dsnp/instant-seal-node-with-deployed-schemas` to Docker Hub.
188-
It is based on a [Frequency Standalone Docker](https://hub.docker.com/r/frequencychain/standalone-node) with the schemas automatically deployed on top of it with the image defaults including using "instant sealing" mode.
189-
190-
Note: `--platform=linux/amd64` is because as `frequencychain` images are only published for the `linux/amd64` platform.
191-
192-
### Run Locally
193-
For any local testing do the following:
194-
1. `docker pull --platform=linux/amd64 dsnp/instant-seal-node-with-deployed-schemas:latest`
195-
2. `docker run --platform=linux/amd64 --rm -p 9944:9944 dsnp/instant-seal-node-with-deployed-schemas:latest`
196-
197-
### Build Locally
198-
1. `docker build --platform=linux/amd64 -t dsnp/instant-seal-node-with-deployed-schemas:latest -t dsnp/instant-seal-node-with-deployed-schemas:<versionNumberHere> .`
199-
200-
### Pushing Docker Image
201-
202-
To match with the Frequency version, a new tag should be pushed to update the docker version of this image each time frequency releases a new version.
203-
The following steps explain how to properly do a release for this.
204-
1. Go to the [Frequency repo](https://github.com/frequency-chain/frequency/releases) to see what the latest release version is.
205-
2. In this repo, check that main is properly [passing its tests and building here](https://github.com/LibertyDSNP/schemas/actions)
206-
3. Go to main: `git checkout main && git pull --rebase`
207-
4. Make sure to pull all latest tags as well: `git pull --tags`
208-
5. Tag the build to match the frequency version but appended with "docker/": `git tag docker/{insert version number}`. For example, if the version number is v1.0.0, then the tag should be `docker/v1.0.0`
209-
Push the tag up: `git push --tags`
210-
6. Monitor the [build](https://github.com/LibertyDSNP/schemas/actions)
211-
7. When that finishes successfully, check [Docker Hub](https://hub.docker.com/r/dsnp/instant-seal-node-with-deployed-schemas/tags) to verify that the image was pushed up

cli/deploy.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const deploy = async () => {
99
let schemaNames: string[];
1010

1111
if (args.length == 0) {
12-
schemaNames = [...dsnp.schemas.keys()];
12+
console.log("Deploying all schemas is no longer supported. Deploy schemas individually.");
13+
process.exit(1);
1314
} else if (args.length > 0 && args.includes("help")) {
1415
console.log(
1516
[
@@ -19,7 +20,7 @@ export const deploy = async () => {
1920
"- DEPLOY_SCHEMA_ACCOUNT_URI",
2021
"- DEPLOY_SCHEMA_ENDPOINT_URL",
2122
"",
22-
'Example: DEPLOY_SCHEMA_ACCOUNT_URI="//Bob" DEPLOY_SCHEMA_ENDPOINT_URL="ws://127.0.0.1:9944" npm run deploy',
23+
'Example: DEPLOY_SCHEMA_ACCOUNT_URI="//Bob" DEPLOY_SCHEMA_ENDPOINT_URL="ws://127.0.0.1:9944" npm run deploy schema-name',
2324
"",
2425
].join("\n"),
2526
);
@@ -36,7 +37,7 @@ export const deploy = async () => {
3637
schemaNames = [schemaName];
3738
}
3839
} else {
39-
console.error("ERROR: You can only specify a single schema to create or all schemas if not specified.");
40+
console.error("ERROR: You can only specify a single schema to create.");
4041
process.exit(1);
4142
}
4243

0 commit comments

Comments
 (0)