backend: refactor files into directories
This commit is contained in:
parent
44821a2556
commit
17e8a559cf
|
@ -4,9 +4,9 @@ const crypto = require('crypto');
|
|||
const objectHash = require('object-hash');
|
||||
const Promise = require('bluebird');
|
||||
|
||||
const verifySignature = require('./verify-signature');
|
||||
const { authorAddresses, authorPrivKeys, forum } = require('./db');
|
||||
const { dao } = require('./contracts');
|
||||
const verifySignature = require('../util/verify-signature');
|
||||
const { authorAddresses, authorPrivKeys, forum } = require('../util/db');
|
||||
const { dao } = require('../util/contracts');
|
||||
|
||||
// Each post allocates 30% of its reputation to citations
|
||||
const PPM_TO_CITATIONS = 300000;
|
|
@ -1,7 +1,7 @@
|
|||
const objectHash = require('object-hash');
|
||||
|
||||
const verifySignature = require('./verify-signature');
|
||||
const { forum } = require('./db');
|
||||
const verifySignature = require('../util/verify-signature');
|
||||
const { forum } = require('../util/db');
|
||||
|
||||
const read = async (hash) => {
|
||||
// Fetch content
|
|
@ -1,7 +1,7 @@
|
|||
const objectHash = require('object-hash');
|
||||
|
||||
const verifySignature = require('./verify-signature');
|
||||
const { forum } = require('./db');
|
||||
const verifySignature = require('../util/verify-signature');
|
||||
const { forum } = require('../util/db');
|
||||
|
||||
module.exports = async (req, res) => {
|
||||
const {
|
|
@ -0,0 +1,9 @@
|
|||
const proposalsListener = require('./proposals');
|
||||
|
||||
const start = () => {
|
||||
proposalsListener.start();
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
start,
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
const { proposals } = require('./contracts');
|
||||
const read = require('./read');
|
||||
const { sendNewProposalEvent } = require('./matrix');
|
||||
const { proposals } = require('../util/contracts');
|
||||
const read = require('../api/read');
|
||||
const { sendNewProposalEvent } = require('../matrix-bot');
|
||||
|
||||
// Subscribe to proposal events
|
||||
const start = () => {
|
|
@ -1,5 +1,5 @@
|
|||
require('dotenv').config();
|
||||
|
||||
require('./api').start();
|
||||
require('./matrix').start();
|
||||
require('./proposals').start();
|
||||
require('./matrix-bot').start();
|
||||
require('./contract-listeners').start();
|
||||
|
|
|
@ -12,7 +12,7 @@ const {
|
|||
proposalEventIds,
|
||||
matrixUserToAuthorAddress,
|
||||
authorAddressToMatrixUser,
|
||||
} = require('./db');
|
||||
} = require('../util/db');
|
||||
|
||||
const {
|
||||
MATRIX_HOMESERVER_URL,
|
|
@ -1,4 +1,4 @@
|
|||
const contractAddresses = require('../contract-addresses.json');
|
||||
const contractAddresses = require('../../contract-addresses.json');
|
||||
|
||||
const networks = {
|
||||
localhost: '0x539',
|
|
@ -1,8 +1,8 @@
|
|||
const ethers = require('ethers');
|
||||
|
||||
const { getContractAddressByNetworkName } = require('./contract-config');
|
||||
const DAOArtifact = require('../contractArtifacts/DAO.json');
|
||||
const ProposalsArtifact = require('../contractArtifacts/Proposals.json');
|
||||
const DAOArtifact = require('../../contractArtifacts/DAO.json');
|
||||
const ProposalsArtifact = require('../../contractArtifacts/Proposals.json');
|
||||
|
||||
const network = process.env.ETH_NETWORK;
|
||||
|
Loading…
Reference in New Issue