Skip to content

Commit

Permalink
Merge pull request #31 from luniehq/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
faboweb authored Oct 22, 2019
2 parents 4325e1b + ad468b9 commit 55f1db3
Show file tree
Hide file tree
Showing 14 changed files with 455 additions and 524 deletions.
Binary file added .DS_Store
Binary file not shown.
14 changes: 10 additions & 4 deletions data/networks.js → data/network-configs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
const config = require('../config')

let networks = {
'gaia-testnet': {
'cosmos-hub-testnet': {
id: 'cosmos-hub-testnet',
api_url: 'https://gaia-13006.lunie.io',
rpc_url: 'wss://gaia-13006.lunie.io:26657/websocket'
},
cosmoshub: {
'cosmos-hub-mainnet': {
id: 'cosmos-hub-mainnet',
api_url: 'https://lcd.nylira.net',
rpc_url: 'wss://rpc.nylira.net/websocket'
},
testnet: {
}
}

if (config.enableTestnet) {
networks['local-cosmos-hub-testnet'] = {
id: 'local-cosmos-hub-testnet',
api_url: 'http://localhost:9070',
rpc_url: 'ws://localhost:26657/websocket'
}
Expand Down
20 changes: 11 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
const { ApolloServer } = require('apollo-server')
const typeDefs = require('./lib/schema')
const resolvers = require('./lib/resolvers')
const CosmosAPI = require('./lib/cosmos-source')
const GaiaAPI = require('./lib/gaia-source')
const CosmosV0API = require('./lib/cosmosV0-source')
const CosmosV2API = require('./lib/cosmosV2-source')
const LunieDBAPI = require('./lib/luniedb-source')
const { networks } = require('./data/networks')
const { networks } = require('./data/network-configs')
const config = require('./config')

const cosmosApi = new CosmosAPI(networks['cosmoshub'])
const gaiaApi = new GaiaAPI(networks['gaia-testnet'])
const cosmosHubMainnetAPI = new CosmosV0API(networks['cosmos-hub-mainnet'])
const cosmosHubTestnetAPI = new CosmosV2API(networks['cosmos-hub-testnet'])
const lunieDBAPI = new LunieDBAPI()

const dataSources = {
CosmosAPI: cosmosApi,
GaiaAPI: gaiaApi,
CosmosHubMainnetAPI: cosmosHubMainnetAPI,
CosmosHubTestnetAPI: cosmosHubTestnetAPI,
LunieDBAPI: lunieDBAPI
}
if (config.enableTestnet) {
const testnetAPI = new CosmosAPI(networks['testnet'])
dataSources.TestnetAPI = testnetAPI
const localCosmosTestnetAPI = new CosmosV0API(
networks['local-cosmos-hub-testnet']
)
dataSources.TestnetAPI = localCosmosTestnetAPI
}

let options = {
Expand Down
Loading

0 comments on commit 55f1db3

Please sign in to comment.