@ocap/indexdb-elasticsearch
Version:
OCAP indexdb adapter that uses elasticsearch as backend
91 lines (77 loc) • 2.45 kB
JavaScript
module.exports = () => ({
mappings: {
dynamic: false,
properties: {
address: { type: 'keyword' },
tokenAddress: { type: 'keyword' },
vaultAddress: { type: 'keyword' },
contractAddress: { type: 'keyword' },
paused: { type: 'boolean' },
closed: { type: 'boolean' },
seedValidators: {
type: 'nested',
properties: {
pk: { type: 'text', index: false },
address: { type: 'keyword' },
endpoint: { type: 'text', index: false },
},
},
validators: {
type: 'nested',
properties: {
pk: { type: 'text', index: false },
address: { type: 'keyword' },
endpoint: { type: 'text', index: false },
},
},
minStakeAmount: { type: 'text' },
maxStakeAmount: { type: 'text' },
minSignerCount: { type: 'long' },
maxSignerCount: { type: 'long' },
minBlockSize: { type: 'long' },
maxBlockSize: { type: 'long' },
minBlockInterval: { type: 'long' },
leaveWaitingPeriod: { type: 'long' },
publishWaitingPeriod: { type: 'long' },
publishSlashRate: { type: 'long' },
genesisTime: { type: 'date' },
renaissanceTime: { type: 'date' },
tokenInfo: {
type: 'nested',
properties: {
address: { type: 'keyword' },
symbol: { type: 'keyword' },
decimal: { type: 'long' },
unit: { type: 'keyword' },
},
},
foreignToken: {
type: 'nested',
properties: {
type: { type: 'keyword' },
contractAddress: { type: 'keyword' },
chainType: { type: 'keyword' },
chainName: { type: 'keyword' },
chainId: { type: 'keyword' },
},
},
depositFeeRate: { type: 'long' },
withdrawFeeRate: { type: 'long' },
proposerFeeShare: { type: 'long' },
publisherFeeShare: { type: 'long' },
minDepositAmount: { type: 'text' },
minWithdrawAmount: { type: 'text' },
totalDepositAmount: { type: 'text' },
totalWithdrawAmount: { type: 'text' },
migrateHistory: { type: 'keyword' },
vaultHistory: { type: 'keyword' },
data: { type: 'object', enabled: false },
},
},
settings: {
index: {
number_of_shards: +(process.env.ES_SHARD_COUNT || 1),
number_of_replicas: +(process.env.ES_REPLICA_COUNT || 0),
},
},
});