Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V8 development network local store from file #3415

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
}
}
},
"maximumAssertionSizeInKb": 10000,
"maximumAssertionSizeInKb": 500000,
"commandExecutorVerboseLoggingEnabled": false,
"appDataPath": "data",
"logLevel": "info",
Expand Down Expand Up @@ -330,7 +330,7 @@
}
}
},
"maximumAssertionSizeInKb": 10000,
"maximumAssertionSizeInKb": 500000,
"commandExecutorVerboseLoggingEnabled": false,
"appDataPath": "data",
"logLevel": "trace",
Expand Down Expand Up @@ -498,7 +498,7 @@
}
}
},
"maximumAssertionSizeInKb": 10000,
"maximumAssertionSizeInKb": 500000,
"commandExecutorVerboseLoggingEnabled": false,
"appDataPath": "data",
"logLevel": "trace",
Expand Down Expand Up @@ -665,7 +665,7 @@
}
}
},
"maximumAssertionSizeInKb": 10000,
"maximumAssertionSizeInKb": 500000,
"commandExecutorVerboseLoggingEnabled": false,
"appDataPath": "data",
"logLevel": "trace",
Expand Down Expand Up @@ -855,7 +855,7 @@
}
}
},
"maximumAssertionSizeInKb": 10000,
"maximumAssertionSizeInKb": 500000,
"commandExecutorVerboseLoggingEnabled": false,
"appDataPath": "data",
"logLevel": "trace",
Expand Down
15 changes: 9 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "origintrail_node",
"version": "8.1.1+beta.1",
"version": "8.1.3+beta.0",
"description": "OTNode V8",
"main": "index.js",
"type": "module",
Expand Down Expand Up @@ -73,7 +73,7 @@
"@polkadot/util": "^10.1.7",
"@polkadot/util-crypto": "^10.1.7",
"app-root-path": "^3.1.0",
"assertion-tools": "^2.0.2",
"assertion-tools": "^2.2.0",
"async": "^3.2.4",
"async-mutex": "^0.3.2",
"awilix": "^7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const TRANSACTION_QUEUE_CONCURRENCY = 1;

export const TRIPLE_STORE_CONNECT_RETRY_FREQUENCY = 10;

export const MAX_FILE_SIZE = 10000000;
export const MAX_FILE_SIZE = 524288000;

export const GET_STATES = { LATEST: 'LATEST', FINALIZED: 'LATEST_FINALIZED' };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class LocalStoreController extends BaseController {
this.commandExecutor = ctx.commandExecutor;
this.operationIdService = ctx.operationIdService;
this.dataService = ctx.dataService;
this.fileService = ctx.fileService;
}

async handleRequest(req, res) {
Expand All @@ -23,8 +24,13 @@ class LocalStoreController extends BaseController {
null,
OPERATION_ID_STATUS.LOCAL_STORE.LOCAL_STORE_INIT_END,
);

const assertions = req.body;
let assertions;
const { filePath } = req.body;
if (filePath) {
assertions = JSON.parse(await this.fileService.readFile(filePath));
} else {
assertions = req.body;
}

const cachedAssertions = {
public: {},
Expand Down
109 changes: 71 additions & 38 deletions src/controllers/http-api/v0/request-schema/local-store-schema-v0.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,82 @@
import { LOCAL_STORE_TYPES } from '../../../../constants/constants.js';

export default (argumentsObject) => ({
type: 'array',
type: ['object', 'array'],
items: {
type: 'object',
required: ['assertionId', 'assertion'],
properties: {
assertionId: {
type: 'string',
minLength: 66,
maxLength: 66,
},
assertion: {
type: 'array',
items: {
type: 'string',
oneOf: [
{
type: 'object',
required: ['assertionId', 'assertion'],
properties: {
assertionId: {
type: 'string',
minLength: 66,
maxLength: 66,
},
assertion: {
type: 'array',
items: {
type: 'string',
},
minItems: 1,
},
blockchain: {
enum: argumentsObject.blockchainImplementationNames,
},
contract: {
type: 'string',
minLength: 42,
maxLength: 42,
},
tokenId: {
type: 'number',
minimum: 0,
},
storeType: {
enum: [
LOCAL_STORE_TYPES.TRIPLE,
LOCAL_STORE_TYPES.TRIPLE_PARANET,
LOCAL_STORE_TYPES.PENDING,
],
},
paranetUAL: {
type: 'string',
},
},
minItems: 1,
maxItems: 2,
},
blockchain: {
enum: argumentsObject.blockchainImplementationNames,
},
contract: {
type: 'string',
minLength: 42,
maxLength: 42,
},
tokenId: {
type: 'number',
minimum: 0,
},
storeType: {
type: {
enum: [
LOCAL_STORE_TYPES.TRIPLE,
LOCAL_STORE_TYPES.TRIPLE_PARANET,
LOCAL_STORE_TYPES.PENDING,
],
{
type: 'object',
required: ['filePath'],
properties: {
filePath: {
type: 'string',
},
paranetUAL: {
type: 'string',
},
blockchain: {
enum: argumentsObject.blockchainImplementationNames,
},
contract: {
type: 'string',
minLength: 42,
maxLength: 42,
},
tokenId: {
type: 'number',
minimum: 0,
},
storeType: {
enum: [
LOCAL_STORE_TYPES.TRIPLE,
LOCAL_STORE_TYPES.TRIPLE_PARANET,
LOCAL_STORE_TYPES.PENDING,
],
},
},
},
paranetUAL: {
type: 'string',
},
},
],
},
minItems: 1,
maxItems: 2,
});
Loading