All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wavesenterprise.sdk.wrc.wrc13.WRC13RegistryContractStarter.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.wavesenterprise.sdk.wrc.wrc13

import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.KotlinFeature
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.wavesenterprise.sdk.contract.grpc.GrpcJacksonContractDispatcherBuilder
import com.wavesenterprise.sdk.wrc.wrc13.impl.WRC13RegistryContractImpl

fun main() {
    val contractDispatcher = GrpcJacksonContractDispatcherBuilder.builder()
        .contractHandlerType(WRC13RegistryContractImpl::class.java)
        .objectMapper(objectMapper)
        .build()
    contractDispatcher.dispatch()
}

private val objectMapper = jacksonObjectMapper()
    .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
    .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
    .registerModule(JavaTimeModule())
    .registerModule(
        KotlinModule.Builder()
            .configure(KotlinFeature.NullIsSameAsDefault, true)
            .build()
    )




© 2015 - 2024 Weber Informatics LLC | Privacy Policy