@ceramicnetwork/pinning-crust-backend 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # Pinning Aggregation: Crust
2
+ ![ceramicnetwork](https://circleci.com/gh/ceramicnetwork/js-ceramic.svg?style=shield)
3
+ [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
4
+ [![](https://img.shields.io/badge/Chat%20on-Discord-orange.svg?style=flat)](https://discord.gg/6VRZpGP)
5
+ [![Twitter](https://img.shields.io/twitter/follow/ceramicnetwork?label=Follow&style=social)](https://twitter.com/ceramicnetwork)
6
+
7
+ > This package contains backend for pinning Crust commits
8
+
9
+ See [PINNING.md](https://github.com/ceramicnetwork/js-ceramic/blob/develop/docs/PINNING.md) for details.
package/lib/index.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import type { CID } from 'multiformats/cid';
2
+ import type { CidList, PinningBackend, PinningInfo } from '@ceramicnetwork/common';
3
+ import { ApiPromise } from '@polkadot/api';
4
+ import { KeyringPair } from '@polkadot/keyring/types';
5
+ import { SubmittableExtrinsic } from '@polkadot/api/promise/types';
6
+ export declare class EmptySeedError extends Error {
7
+ constructor(address: string);
8
+ }
9
+ export declare class TxError extends Error {
10
+ constructor(type: number, msg: string);
11
+ }
12
+ export declare class CrustPinningBackend implements PinningBackend {
13
+ readonly connectionString: string;
14
+ static designator: string;
15
+ readonly id: string;
16
+ readonly endpoint: string;
17
+ readonly seed: string;
18
+ api: ApiPromise;
19
+ constructor(connectionString: string);
20
+ open(): void;
21
+ close(): Promise<void>;
22
+ pin(cid: CID): Promise<void>;
23
+ unpin(_cid: CID): Promise<void>;
24
+ ls(): Promise<CidList>;
25
+ info(): Promise<PinningInfo>;
26
+ hex2a(hex: string): string;
27
+ delay(ms: number): Promise<void>;
28
+ sendTx(tx: SubmittableExtrinsic, krp: KeyringPair): Promise<void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,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1B,MAAM,CAAC,EAAE,EAAE,oBAAoB,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAoCxE"}
package/lib/index.js ADDED
@@ -0,0 +1,151 @@
1
+ import { Keyring } from '@polkadot/keyring';
2
+ import { ApiPromise, WsProvider } from '@polkadot/api';
3
+ import { typesBundleForPolkadot } from '@crustio/type-definitions';
4
+ import fetch from 'cross-fetch';
5
+ import * as sha256 from '@stablelib/sha256';
6
+ import { toString } from 'uint8arrays/to-string';
7
+ const textEncoder = new TextEncoder();
8
+ export class EmptySeedError extends Error {
9
+ constructor(address) {
10
+ super(`[Crust]: No seed provided at ${address}`);
11
+ }
12
+ }
13
+ export class TxError extends Error {
14
+ constructor(type, msg) {
15
+ super(`[Crust]: Send transaction(${type}) failed with ${msg}`);
16
+ }
17
+ }
18
+ export class CrustPinningBackend {
19
+ constructor(connectionString) {
20
+ this.connectionString = connectionString;
21
+ const url = new URL(connectionString);
22
+ const hostname = url.hostname;
23
+ const seed = url.searchParams.get('seed');
24
+ if (!seed) {
25
+ throw new EmptySeedError(this.endpoint);
26
+ }
27
+ this.seed = seed;
28
+ const protocol = url.protocol
29
+ .replace('crust:', 'ws')
30
+ .replace('crust+ws:', 'ws')
31
+ .replace('crust+wss:', 'wss');
32
+ if (url.port) {
33
+ this.endpoint = `${protocol}://${hostname}:${url.port}`;
34
+ }
35
+ else {
36
+ this.endpoint = `${protocol}://${hostname}`;
37
+ }
38
+ const bytes = textEncoder.encode(this.connectionString);
39
+ const digest = toString(sha256.hash(bytes), 'base64urlpad');
40
+ this.id = `${CrustPinningBackend.designator}@${digest}`;
41
+ }
42
+ open() {
43
+ this.api = new ApiPromise({
44
+ provider: new WsProvider(this.endpoint),
45
+ typesBundle: typesBundleForPolkadot,
46
+ });
47
+ }
48
+ async close() {
49
+ if (this.api) {
50
+ await this.api.disconnect();
51
+ this.api = undefined;
52
+ }
53
+ }
54
+ async pin(cid) {
55
+ if (!this.api) {
56
+ return;
57
+ }
58
+ await this.api.isReadyOrError;
59
+ const kr = new Keyring({ type: 'sr25519', ss58Format: 66 });
60
+ const krp = kr.addFromUri(this.seed);
61
+ const size = 30 * 1024 * 1024 * 1024;
62
+ const tx = this.api.tx.market.placeStorageOrder(cid.toString(), size, 0, '');
63
+ await this.sendTx(tx, krp);
64
+ const prepard = 1000000000;
65
+ const tx2 = this.api.tx.market.addPrepaid(cid.toString(), prepard);
66
+ await this.sendTx(tx2, krp);
67
+ }
68
+ async unpin(_cid) {
69
+ }
70
+ async ls() {
71
+ if (!this.api) {
72
+ return {};
73
+ }
74
+ await this.api.isReadyOrError;
75
+ const kr = new Keyring({ type: 'sr25519', ss58Format: 66 });
76
+ const krp = kr.addFromUri(this.seed);
77
+ const data = '{"query": "query MyQuery {\\n substrate_extrinsic(where: {method: {_eq: \\"placeStorageOrder\\"}, blockNumber: {}, signer: {_eq: \\"' + krp.address + '\\"}}, order_by: {blockNumber: desc}) {\\n args(path: \\".[0].value\\")\\n }\\n}\\n"}';
78
+ const result = {};
79
+ const tryTimes = 3;
80
+ for (let i = 0; i < tryTimes; i++) {
81
+ try {
82
+ const res = await fetch('https://crust.indexer.gc.subsquid.io/v4/graphql/', {
83
+ method: "post",
84
+ headers: {
85
+ 'Content-Type': 'text/plain'
86
+ },
87
+ body: data
88
+ });
89
+ if (res && res.status == 200) {
90
+ const resobj = JSON.parse(JSON.stringify(await res.json()));
91
+ resobj.data.substrate_extrinsic.forEach(element => {
92
+ result[this.hex2a(element.args)] = [this.id];
93
+ });
94
+ break;
95
+ }
96
+ }
97
+ catch (error) {
98
+ if (i == tryTimes - 1) {
99
+ throw error;
100
+ }
101
+ }
102
+ await this.delay(6000);
103
+ }
104
+ return result;
105
+ }
106
+ async info() {
107
+ return {
108
+ [this.id]: {},
109
+ };
110
+ }
111
+ hex2a(hex) {
112
+ let str = '';
113
+ for (let i = 2; i < hex.length; i += 2)
114
+ str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
115
+ return str;
116
+ }
117
+ delay(ms) {
118
+ return new Promise(resolve => setTimeout(resolve, ms));
119
+ }
120
+ async sendTx(tx, krp) {
121
+ return new Promise((resolve, reject) => {
122
+ tx.signAndSend(krp, ({ events = [], status }) => {
123
+ console.log(` ↪ 💸 [tx]: Transaction status: ${status.type}, nonce: ${tx.nonce}`);
124
+ if (status.isInvalid || status.isDropped || status.isUsurped) {
125
+ reject(new Error(`${status.type} transaction.`));
126
+ }
127
+ else {
128
+ }
129
+ if (status.isInBlock) {
130
+ events.forEach(({ event: { data, method, section } }) => {
131
+ if (section === 'system' && method === 'ExtrinsicFailed') {
132
+ const [dispatchError] = data;
133
+ console.log(` ↪ 💸 ❌ [tx]: Send transaction(${tx.type}) failed with ${dispatchError.type}.`);
134
+ reject(new TxError(tx.type, dispatchError.type));
135
+ }
136
+ else if (method === 'ExtrinsicSuccess') {
137
+ console.log(` ↪ 💸 ✅ [tx]: Send transaction(${tx.type}) success.`);
138
+ resolve();
139
+ }
140
+ });
141
+ }
142
+ else {
143
+ }
144
+ }).catch(e => {
145
+ reject(e);
146
+ });
147
+ });
148
+ }
149
+ }
150
+ CrustPinningBackend.designator = 'crust';
151
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,KAAK,MAAM,aAAa,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAOhD,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA;AAGrC,MAAM,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AAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,EAAE;oBAC5D,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,eAAe,CAAC,CAAC,CAAA;iBACjD;qBAAM;iBAEN;gBAED,IAAI,MAAM,CAAC,SAAS,EAAE;oBACpB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE;wBACtD,IAAI,OAAO,KAAK,QAAQ,IAAI,MAAM,KAAK,iBAAiB,EAAE;4BACxD,MAAM,CAAC,aAAa,CAAC,GAAG,IAA0C,CAAC;4BACnE,OAAO,CAAC,GAAG,CACT,mCAAmC,EAAE,CAAC,IAAI,iBAAiB,aAAa,CAAC,IAAI,GAAG,CACjF,CAAC;4BACF,MAAM,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;yBAClD;6BAAM,IAAI,MAAM,KAAK,kBAAkB,EAAE;4BACxC,OAAO,CAAC,GAAG,CACT,mCAAmC,EAAE,CAAC,IAAI,YAAY,CACvD,CAAC;4BACF,OAAO,EAAE,CAAA;yBACV;oBACH,CAAC,CAAC,CAAC;iBACJ;qBAAM;iBAEN;YACH,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC,CAAC,CAAC;YACZ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;;AA3KM,8BAAU,GAAG,OAAO,CAAA"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@ceramicnetwork/pinning-crust-backend",
3
+ "version": "2.0.0-alpha.2",
4
+ "description": "Crust Pinning backend",
5
+ "keywords": [
6
+ "ceramic",
7
+ "ipfs",
8
+ "crust",
9
+ "web3.0"
10
+ ],
11
+ "main": "./lib/index.js",
12
+ "types": "./lib/index.d.ts",
13
+ "type": "module",
14
+ "files": [
15
+ "lib"
16
+ ],
17
+ "sideEffects": false,
18
+ "exports": {
19
+ ".": "./lib/index.js"
20
+ },
21
+ "scripts": {
22
+ "test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js --silent --coverage --forceExit",
23
+ "build": "../../node_modules/.bin/tsc --project tsconfig.json",
24
+ "prepublishOnly": "npm run build",
25
+ "prebuild": "npm run clean",
26
+ "lint": "../../node_modules/.bin/eslint ./src --ext .js,.jsx,.ts,.tsx",
27
+ "clean": "rm -rf ./lib"
28
+ },
29
+ "author": "LowEntropyBody <jszyyx@163.com>",
30
+ "license": "(Apache-2.0 OR MIT)",
31
+ "directories": {
32
+ "lib": "./lib"
33
+ },
34
+ "dependencies": {
35
+ "@crustio/type-definitions": "^1.2.0",
36
+ "@polkadot/api": "^4.6.2",
37
+ "@polkadot/keyring": "^6.2.1",
38
+ "@polkadot/types": "^4.6.2",
39
+ "@stablelib/sha256": "^1.0.1",
40
+ "cross-fetch": "^3.1.4",
41
+ "uint8arrays": "^3.0.0"
42
+ },
43
+ "devDependencies": {
44
+ "@ceramicnetwork/common": "^2.0.0-alpha.3",
45
+ "multiformats": "^9.5.8"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "gitHead": "d4ad7b5937a90588649f92de0190fe43bbf3a7d8"
51
+ }