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

Release 1.6.13 #933

Merged
merged 5 commits into from
Oct 3, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
check-version:
name: Check version increment
name: Create tag and changelog
runs-on: ubuntu-latest
steps:
- name: Clean workspace
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This project was formerly known as the Climate Warehouse and you may see this term used interchangeably with CADT.

*Note that breaking changes are introduced in version 1.3.0 and those with older installs are encourage to uninstall and reinstall the CADT software. Please see the [release notes](https://github.com/Chia-Network/climate-warehouse/releases/tag/1.2.29) for more details.*
*Pagination is now strongly recommended on the units, projects, and issuances [API endpoints](docs/cadt_rpc_api.md) and will be mandatory in the future. Please adjust your API calls accordingly.*

## User Guide

Expand Down Expand Up @@ -114,7 +114,9 @@ In the `CHIA_ROOT` directory (usually `~/.chia/mainnet` on Linux), CADT will add
* **IS_GOVERNANCE_BODY**: "True" or "false" toggle to enable/disable mode for this instance being a governing body.
* **DEFAULT_FEE**: [Fee](https://docs.chia.net/mempool/) for each transaction on the Chia blockchain in mojos. The default is 300000000 mojos (0.0003 XCH) and can be set higher or lower depending on how [busy](https://dashboard.chia.net/d/46EAA05E/mempool-transactions-and-fees?orgId=1) the Chia network is. If a fee is set very low, it may cause a delay in transaction processing.
* **DEFAULT_COIN_AMOUNT**: Units are mojo. Each DataLayer transaction needs a coin amount and the default is 300000000 mojo.
* **CERTIFICATE_FOLDER_PATH**: If using a custom path for the Chia Blockchain certificates folder, enter the path here to allow CADT to find the certificates and authenticate to the Chia RPC. CADT assumes the folder structure within the directory specified matches the default Chia SSL directory of `$CHIA_ROOT/config/ssl/`.
* **DATALAYER_FILE_SERVER_URL**: Publicly available Chia DataLayer HTTP URL and port, including schema (http:// or https://). If serving DataLayer files from S3, this would be the public URL of the S3 bucket. Port can be omitted if using standard ports for http or https requests.
* **AUTO_SUBSCRIBE_FILESTORE**: Subscribing to the filestore for any organization is optional. To automatically subscribe and sync the filestore to every organization you subscribe to, set this to `true`.
* **TASKS**: Section for configuring sync intervals
* **AUDIT_SYNC_TASK_INTERVAL**: Default 30
* **DATAMODEL_SYNC_TASK_INTERVAL**: Default 60
Expand Down
544 changes: 388 additions & 156 deletions docs/cadt_rpc_api.md

Large diffs are not rendered by default.

427 changes: 215 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cadt",
"version": "1.6.12",
"version": "1.6.13",
"_comment": "DONT CHANGE MAJOR UNLESS DATAMODEL CHANGES: The major version corresponds to the datamodel version your using, so 2.0.0 means it'll use datamodel v2",
"private": true,
"bin": "build/server.js",
Expand Down Expand Up @@ -58,19 +58,19 @@
"winston-daily-rotate-file": "^4.6.1"
},
"devDependencies": {
"@babel/cli": "^7.22.15",
"@babel/core": "^7.22.19",
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.0",
"@babel/plugin-syntax-import-attributes": "^7.22.5",
"@babel/preset-env": "^7.22.15",
"@babel/preset-env": "^7.22.20",
"@babel/register": "^7.22.15",
"@commitlint/cli": "^17.7.1",
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"babel-plugin-module-resolver": "^5.0.0",
"chai": "^4.3.8",
"chai": "^4.3.10",
"chai-http": "^4.4.0",
"eslint": "^8.49.0",
"eslint": "^8.50.0",
"eslint-plugin-es": "^4.1.0",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-mocha": "^10.2.0",
"husky": "^8.0.3",

"mocha": "^10.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/datalayer/persistance.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const getBaseOptions = () => {
method: 'POST',
cert: fs.readFileSync(certFile),
key: fs.readFileSync(keyFile),
timeout: 300000,
timeout: 1_800_000,
};
return baseOptions;
};
Expand Down
11 changes: 6 additions & 5 deletions src/datalayer/syncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const startDataLayerUpdatePolling = async () => {
store.storeId,
store.rootHash,
);

console.log('UPDATE STORE', store.storeId, store.rootHash);
await Organization.update(
{ registryHash: store.rootHash },
{ where: { registryId: store.storeId } },
);
}),
);
}
Expand All @@ -46,11 +52,6 @@ const syncDataLayerStoreToClimateWarehouse = async (storeId, rootHash) => {
return;
}

await Organization.update(
{ registryHash: rootHash },
{ where: { registryId: storeId } },
);

const organizationToTruncate = await Organization.findOne({
attributes: ['orgUid'],
where: { registryId: storeId },
Expand Down
20 changes: 14 additions & 6 deletions src/tasks/sync-datalayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,29 @@ const spinner = new Spinner('Waiting for Updates %s');
spinner.setSpinnerString('|/-\\');
spinner.setSpinnerDelay(500);

let taskIsRunning = false;

const task = new Task('sync-datalayer', async () => {
try {
await assertDataLayerAvailable();
await assertWalletIsSynced();

spinner.stop();
spinner.start();
datalayer.startDataLayerUpdatePolling();
if (!taskIsRunning) {
taskIsRunning = true;
logger.info('Syncing datalayer data');
await assertDataLayerAvailable();
await assertWalletIsSynced();

spinner.stop();
spinner.start();
datalayer.startDataLayerUpdatePolling();
}
} catch (error) {
logger.error(
`Retrying in ${
CONFIG?.TASKS?.DATAMODEL_SYNC_TASK_INTERVAL || 60
} seconds`,
error,
);
} finally {
taskIsRunning = false;
}
});

Expand Down
Loading