Skip to content

Commit

Permalink
Populate Base data
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsm412 committed Sep 5, 2024
1 parent 7f3870e commit bf34465
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rair-node/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function main() {
},
});

await seedDB(context);
await seedDB();

app.use(morgan('dev'));
app.use(bodyParser.raw());
Expand Down
28 changes: 27 additions & 1 deletion rair-node/bin/seeds/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const log = require('../utils/logger')(module);
const categories = require('./categories');
const syncRestrictions = require('./syncRestrictions');
const { Category, ServerSetting, Contract } = require('../models');
const { Category, ServerSetting, Contract, Blockchain } = require('../models');

module.exports = async () => {
try {
Expand Down Expand Up @@ -42,4 +42,30 @@ module.exports = async () => {
});
log.info('Server settings set by default!');
}

// Populate CORE blockchain
try {
const coreExists = await Blockchain.findOne({ hash: '0x2105' });
if (!coreExists) {
await Blockchain.create(
{
hash: '0x2105',
name: 'Base',
display: true,
sync: true,
alchemySupport: true,
blockExplorerGateway: 'https://basescan.org',
diamondFactoryAddress: '0x1F89Cc515dDc53dA2fac5B0Ca3b322066A71E6BA',
diamondMarketplaceAddress: '0x58795f50b50d492C4252B9BBF78485EF4043FF3E',
mainTokenAddress: '0x2b0fFbF00388f9078d5512256c43B983BB805eF8',
numericalId: 8453,
rpcEndpoint: 'https://base.meowrpc.com',
symbol: 'ETH',
testnet: false,
},
);
}
} catch (err) {
log.info('Error populating Core chain');
}
};

0 comments on commit bf34465

Please sign in to comment.