-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7666fe
commit ecec61b
Showing
9 changed files
with
588 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"id": "e81565ef-0d7a-4335-8588-96e2cebe5541", | ||
"name": "chia-localhost", | ||
"values": [ | ||
{ | ||
"key": "api_url_v1", | ||
"value": "http://localhost:3001/v1", | ||
"enabled": true | ||
} | ||
], | ||
"_postman_variable_scope": "environment", | ||
"_postman_exported_at": "2022-01-19T19:56:07.283Z", | ||
"_postman_exported_using": "Postman/9.9.3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
const modelTypes = require('../src/models/meta/meta.modeltypes.cjs'); | ||
|
||
module.exports = { | ||
async up(queryInterface) { | ||
await queryInterface.createTable('meta', modelTypes); | ||
}, | ||
|
||
async down(queryInterface) { | ||
await queryInterface.dropTable('meta'); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import request from 'request'; | ||
|
||
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0; | ||
|
||
const certFile = path.resolve( | ||
`${process.env.CHIA_ROOT}/config/ssl/data_layer/private_data_layer.crt`, | ||
); | ||
const keyFile = path.resolve( | ||
`${process.env.CHIA_ROOT}/config/ssl/data_layer/private_data_layer.key`, | ||
); | ||
|
||
const rpcUrl = process.env.DATALAYER_URL; | ||
|
||
const baseOptions = { | ||
method: 'POST', | ||
cert: fs.readFileSync(certFile), | ||
key: fs.readFileSync(keyFile), | ||
}; | ||
|
||
export const pushChangeListToDatalayer = (changeList) => { | ||
return new Promise((resolve, reject) => { | ||
const options = { | ||
url: `${rpcUrl}/update_data_store`, | ||
body: JSON.stringify({ | ||
changelist: changeList, | ||
id: 'c19cfd5a1f0a221976debcd1206daca0a07bf5e949949c2f30488562870a2fff', | ||
}), | ||
}; | ||
|
||
console.log(changeList); | ||
|
||
request( | ||
Object.assign({}, baseOptions, options), | ||
function (error, response) { | ||
if (error) { | ||
console.log('!!!!!!'); | ||
reject(error); | ||
return; | ||
} | ||
console.log(response.body); | ||
resolve(response); | ||
}, | ||
); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './organizations.model.js'; | ||
export * from './organizations.mock.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import stub from './organizations.stub.json'; | ||
|
||
export const CoBenefitsMock = { | ||
findAll: () => stub, | ||
findOne: (id) => { | ||
return stub.find((record) => record.id == id); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
import Sequelize from 'sequelize'; | ||
const { Model } = Sequelize; | ||
import { sequelize } from '../database'; | ||
|
||
import ModelTypes from './meta.modeltypes.cjs'; | ||
|
||
class Meta extends Model {} | ||
|
||
Meta.init(ModelTypes, { | ||
sequelize, | ||
modelName: 'meta', | ||
}); | ||
|
||
export { Meta }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const Sequelize = require('sequelize'); | ||
|
||
module.exports = { | ||
id: { | ||
type: Sequelize.INTEGER, | ||
primaryKey: true, | ||
autoIncrement: true, | ||
}, | ||
meta_key: { | ||
type: Sequelize.STRING, | ||
unique: true, | ||
}, | ||
meta_value: Sequelize.STRING, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |