diff --git a/config.conf b/config.conf new file mode 100644 index 000000000..d93e3c919 --- /dev/null +++ b/config.conf @@ -0,0 +1,96 @@ +include required("/Users/pbandurski/repos/cryptonomic/Conseil/conseil-api/src/main/resources/developer.conf") + +logging: { + muted: false + loggers: [ + { + name: "org.http4s", + level: "INFO" + }, + { + name: "slick", + level: "INFO" + } + { + name: "com.zaxxer.hikari" + level: "INFO" + } + ] +} + +# Settings for blockchains Conseil can connect to. Nested by blockchain name and network. +platforms: [ + { + name: "tezos" + network: "mainnet" + enabled: true + + node: { + protocol: "http" + hostname: "localhost" + port: 8732 + path-prefix: "" + } + }, + { + name: "ethereum" + network: "mainnet" + enabled: true + node: "http://localhost:8545" + + retry { + max-wait: 2s + max-retry: 5 + } + + batching { + indexer-threads-count: 8 + http-fetch-threads-count: 8 + blocks-batch-size: 10 + transactions-batch-size: 100 + contracts-batch-size: 100 + tokens-batch-size: 100 + } + }, + { + name: "bitcoin" + network: "mainnet" + enabled: true + + node: { + protocol: "http" + hostname: "localhost" + port: 8332 + username: "ubuntu" + password: "6w27fca8NvreVxQnwgRJwt8BzKwdYxfK" + } + + batching { + indexer-threads-count: 8 + http-fetch-threads-count: 8 + hash-batch-size: 2000 + blocks-batch-size: 500 + transactions-batch-size: 500 + } + } +] + +conseil { + hostname: "localhost" + port: 1337 + + security.api-keys.keys: ["conseil"] + + db { + dataSourceClass = "org.postgresql.ds.PGSimpleDataSource" + properties { + user = "conseil" + password = "password" + url = "jdbc:postgresql://localhost:55432/conseil" + } + numThreads = 20 + maxConnections = 20 + } +} + +lorre.db = ${conseil.db} \ No newline at end of file diff --git a/conseil-api/src/main/scala/tech/cryptonomic/conseil/api/metadata/MetadataService.scala b/conseil-api/src/main/scala/tech/cryptonomic/conseil/api/metadata/MetadataService.scala index 258db806d..05b426e4f 100644 --- a/conseil-api/src/main/scala/tech/cryptonomic/conseil/api/metadata/MetadataService.scala +++ b/conseil-api/src/main/scala/tech/cryptonomic/conseil/api/metadata/MetadataService.scala @@ -30,7 +30,7 @@ class MetadataService( private val entities = { def futureEntities(path: NetworkPath): List[Entity] = - Await.result(platformDiscoveryOperations.getEntities(path), 5 second) + Await.result(platformDiscoveryOperations.getEntities(path), 10 second) networks.values.flatten .map(_.path) diff --git a/conseil-api/src/main/scala/tech/cryptonomic/conseil/api/routes/platform/discovery/GenericPlatformDiscoveryOperations.scala b/conseil-api/src/main/scala/tech/cryptonomic/conseil/api/routes/platform/discovery/GenericPlatformDiscoveryOperations.scala index 65866b5e2..403fbf6c5 100644 --- a/conseil-api/src/main/scala/tech/cryptonomic/conseil/api/routes/platform/discovery/GenericPlatformDiscoveryOperations.scala +++ b/conseil-api/src/main/scala/tech/cryptonomic/conseil/api/routes/platform/discovery/GenericPlatformDiscoveryOperations.scala @@ -191,7 +191,7 @@ class GenericPlatformDiscoveryOperations( updatedEntities <- IO.fromFuture( IO(dbRunner.runQuery(preCacheEntities(networkPath.up.platform, networkPath.network))) ) - _ <- caching.putAllEntities(updatedEntities) + _ <- caching.putEntities(key, updatedEntities(key).value) } yield ()).unsafeRunAsyncAndForget() IO.pure(ent) } diff --git a/conseil-regression-tests.conf b/conseil-regression-tests.conf new file mode 100644 index 000000000..aac68b3eb --- /dev/null +++ b/conseil-regression-tests.conf @@ -0,0 +1 @@ +conseil.security.api-keys.keys = ["hooman"] \ No newline at end of file