-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcreateDutchXDAO.js
52 lines (47 loc) · 1.93 KB
/
createDutchXDAO.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// const utils = require('./utils.js')
const fs = require('fs');
const path = require('path');
const { migrateDAO } = require('@daostack/migration')
async function createDutchXDAO(options) {
options.params = require('./dutchx-params.json')
const result = await migrateDAO(options)
return result
}
/**
* if called directly, run this function
*/
async function main() {
const DAOstackMigration = require('@daostack/migration');
const options = {
quiet: false,
disableconfs: false,
force: true,
provider: 'http://localhost:8545',
// this is the private key used by ganache when running with `--deterministic`
privateKey: '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d',
prevmigration: path.normalize(path.join(__dirname, 'node_modules/@daostack/migration/migration.json')),
// prevmigration: path.normalize(path.join(__dirname, './migration.json')),
output: path.normalize(path.join(__dirname, './migration.json')),
params: JSON.parse(fs.readFileSync(path.join(__dirname, 'migration-params.json')))
};
console.log(`starting migration with options`)
console.log(options)
let migration = createDutchXDAO(options);
// migration = migration.test[arcVersion];
// const testDAOInfo = {
// name: migration.name,
// Avatar: migration.Avatar,
// DAOToken: migration.DAOToken,
// Reputation: migration.Reputation,
// Controller: migration.Controller,
// Schemes: migration.Schemes,
// arcVersion
// };
// // write data to the daos directory where the subgraph deployment can find it
// await fs.writeFileSync(path.normalize(path.join(__dirname, 'node_modules/@daostack/subgraph/daos/private/test.json')), JSON.stringify(testDAOInfo, null, 4));
// console.log(`Done creating DtuchX DAO`);
}
if (require.main === module) {
main().then(console.log(`done`)).catch(err => {console.error(err);process.exit(1)})
}
module.exports = { createDutchXDAO }