GRPC client for the Provenance Blockchain

Overview

GRPC client for the Provenance Blockchain

Tip: Refer to the Cosmos Proto Docs and Provenance Blockchain Proto Docs for client interface definitions.

Maven

<dependency>
  <groupId>io.provenance.client</groupId>
  <artifactId>pb-grpc-client-kotlin</artifactId>
  <version>${version}</version>
</dependency>

Gradle

implementation 'io.provenance.client:pb-grpc-client-kotlin:${version}'

Setup

Setup the client by supplying the chain id (e.g. pio-testnet-1) and URI of the node to which you are connecting. The normal GRPC port is 9090.

Example: for a locally running testnet instance:

val pbClient = PbClient("chain-local", URI("http://localhost:9090"))

Optionally configure GRPC by also passing ChannelOpts or a NettyChannelBuilder.

Example: Set client idle timeout to 1 minute

val pbClient = PbClient(
    chainId = "chain-local",
    channelUri = URI("http://localhost:9090"),
    opts = ChannelOpts(idleTimeout = (1L to TimeUnit.MINUTES))
)

Query Usage

PBClient contains individual clients for each Cosmos and Provenance Blockchain SDK query service. Each module contains a query.proto, which defines the query interface.

Example: Querying the marker module for the access permissions on a marker:

Marker module query interface

pbClient.markerClient.access(QueryAccessRequest.newBuilder().setId("marker address or denom here").build())

Transaction Usage

Example: creating a Marker

val mnemonic = "your 20 word phrase here" // todo use your own mnemonic
val walletSigner = WalletSigner(NetworkType.TESTNET, mnemonic)
val signers = listOf(BaseReqSigner(walletSigner))

val msgAddMarkerRequest: MsgAddMarkerRequest = // Your request here

val txn = TxOuterClass.TxBody.newBuilder()
    .addMessages(Any.pack(message = msgAddMarkerRequest, typeUrlPrefix = ""))
    .build()

pbClient.estimateAndBroadcastTx(
    txBody = txn,
    signers = signers,
    mode = ServiceOuterClass.BroadcastMode.BROADCAST_MODE_BLOCK,
    gasAdjustment = 1.5
)

Note: In general, BROADCAST_MODE_BLOCK is not recommended as your transaction may become successful past the time that client blocks while waiting for the response. Instead use BROADCAST_MODE_SYNC, and listen for transaction success in the Event Stream or query the client with the transaction hash to find the outcome of submission.

Comments
  • v1.3.0-rc1 Release Proposal

    v1.3.0-rc1 Release Proposal

    Description

    This branch will not be merged, but will be used to create a prerelease named v1.3.0-rc1 that contains the new groups module. After groups are released in Provenance 1.13.0, this branch can be repurposed, after removing the TODOS, to have the groups protos ready to use.

    If I receive approvals, I will create said prerelease branch for use in early-access development. I appreciate your time and attention.

    opened by hyperschwartz 1
  • Add feeGranter property to BaseReq

    Add feeGranter property to BaseReq

    Adds the missing optionalfeeGranter property in BaseReq like that in the service-wallet GrpcClient implementation in pb-client https://github.com/FigureTechnologies/service-wallet/blob/f413cb16e111095a98a6b26f5f43e1e69fc22deb/pb-client/src/main/kotlin/com/figure/wallet/pbclient/client/GrpcClient.kt#L42

    @vwagner I don't know if this purposefully left out, or was added later to service-wallet but not yet reflected in this repo.

    It was originally added to wallet-service by @tbrooks-figure and relates to work @mplokita-figure is currently doing.

    opened by mwoods-figure 1
  • Add date and timestamp extension methods for protobuf builders

    Add date and timestamp extension methods for protobuf builders

    This adds some protobuf builder methods which I've encountered and could be a useful addition into the library. I wanted to access them, but they're defined in https://github.com/FigureTechnologies/stream-data, but I didn't want to add that as a project dependency (here or elsewhere), since there's a lot of other stuff that's not needed.

    @vwagner Let me know if this is a good place for it, or if you think https://github.com/provenance-io/provenance-protobuf-java is a better location.

    opened by mwoods-figure 1
  • add group client with provenance 1.13.0

    add group client with provenance 1.13.0

    This is the successor to https://github.com/provenance-io/pb-grpc-client-kotlin/pull/41. Please consider merging and releasing so that we can use the new group module.

    opened by benarena 0
  • Testnet connection issue

    Testnet connection issue

    Summary of Bug

    Version

    Steps to Reproduce


    For Admin Use

    • [ ] Not duplicate issue
    • [ ] Appropriate labels applied
    • [ ] Appropriate contributors tagged
    • [ ] Contributor assigned/self-assigned
    opened by LhtBhavishaVidja 0
  • Restructure into abstract pb client to allow non-netty channels.

    Restructure into abstract pb client to allow non-netty channels.

    • Add block height parameter for abstract stubs.
    • Break abstract client from pbClient type along netty line to allow other channel types in the future.
    opened by mtps 0
  • Wrapping current gas estimators with fetchable gas pricing

    Wrapping current gas estimators with fetchable gas pricing

    • Break out logic for gas estimations into lambda parameters.
    • Associate legacy naming for parameters to newer lambdas.
    • Add floating gas price fetching
    • Remove fromSimulation(), logic moved into cosmosSimulation estimator.

    Example Usage:

    val priceGetter = UrlGasPrices("https://oracle.my.domain/gas-price").cached()
    val estimator =
      if (provenance.network.version < 1.8) GasEstimationMethod.COSMOS_SIMULATION
      else GasEstimationMethod.MSG_FEE_CALCULATION
    val pbClient = PbClient(
        chainId = "pio-testnet-1",
        channelUri = URI("grpcs://grpc.test.provenance.io"),
        gasEstimationMethod = floatingGasPrices(estimator, priceGetter)
    )
    
    pbClient.estimateTx(...)
    
    opened by mtps 0
  • support multiple gas estimation methods

    support multiple gas estimation methods

    A flag was added as a required parameter when creating and instance of PbClient. The flag helps PbClient to determine the method of creating a GasEstimate.

    opened by afremuth-figure 0
  • undo type change to maintain compatability with pbc 1.7.x based versions

    undo type change to maintain compatability with pbc 1.7.x based versions

    This change rolls back changes made to the api that restrict options when handling code that needs to run on both 1.7.x and 1.8.y of pbc - i.e. version pinning.

    opened by afremuth-figure 0
  • Upgrade hdwallet + update README with hdwallet example

    Upgrade hdwallet + update README with hdwallet example

    • Update hdwallet dependency to 0.1.15

    • Set target compatibility to Java 11

    • Update READ with complete example of how to use pb-grpc-client-lib with an existing wallet created withhdwallet

    opened by mwoods-figure 0
  • Testnet connection issue

    Testnet connection issue

    Summary of Bug

    Not able to connect with provenance Testnet

    Version

    V1.1.1

    Steps to Reproduce

    I 'm trying to connect with Provenance Grpc kotlin client as below but it's not working . val pbClient = PbClient( chainId = "pio-testnet-1", channelUri = URI("http://35.194.76.143:9090"), gasEstimationMethod = GasEstimationMethod.MSG_FEE_CALCULATION // GasEstimationMethod.COSMOS_SIMULATION used only if pbc version is 1.7 or lower )

    opened by LhtBhavishaVidja 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/build.yaml (github-actions)
    • .github/workflows/manual-publish.yaml (github-actions)
    • .github/workflows/publish.yml (github-actions)
    • gradle.properties (gradle)
    • settings.gradle.kts (gradle)
    • build.gradle.kts (gradle)
    • cli/build.gradle.kts (gradle)
    • client/build.gradle.kts (gradle)
    • client-common/build.gradle.kts (gradle)
    • client-coroutines/build.gradle.kts (gradle)
    • gradle/libs.versions.toml (gradle)
    • gradle/wrapper/gradle-wrapper.properties (gradle-wrapper)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 7 Pull Requests:

    Update dependency io.provenance:proto-kotlin to v1.12.2
    • Schedule: ["every weekend"]
    • Branch name: renovate/provenance-protos
    • Merge into: main
    • Upgrade io.provenance:proto-kotlin to 1.12.2
    Update grpc to v1.51.0
    Update kotlin monorepo to v1.7.21
    Update plugin org.jlleitschuh.gradle.ktlint to v10.3.0
    • Schedule: ["every weekend"]
    • Branch name: renovate/org.jlleitschuh.gradle.ktlint-10.x
    • Merge into: main
    • Upgrade org.jlleitschuh.gradle.ktlint to 10.3.0
    Update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: main
    • Upgrade actions/checkout to v3
    Update actions/setup-java action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-setup-java-3.x
    • Merge into: main
    • Upgrade actions/setup-java to v3
    Update plugin org.jlleitschuh.gradle.ktlint to v11
    • Schedule: ["every weekend"]
    • Branch name: renovate/org.jlleitschuh.gradle.ktlint-11.x
    • Merge into: main
    • Upgrade org.jlleitschuh.gradle.ktlint to 11.0.0

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Releases(v1.3.0)
  • v1.3.0(Dec 8, 2022)

    What's Changed

    • Update the url for cosmos' protobuf docs page by @webbushka in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/42
    • add group client with provenance 1.13.0 by @benarena in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/43

    New Contributors

    • @webbushka made their first contribution in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/42
    • @benarena made their first contribution in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/43

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.2.0...v1.3.0

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0-rc1(Nov 16, 2022)

  • v1.2.0(Sep 12, 2022)

    What's Changed

    • Update README with more documentation links and small fixups by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/32
    • Externalize channel creation to allow grpc queries without PBClient by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/34
    • Restructure into abstract pb client to allow non-netty channels. by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/35
    • Subprojects + coroutine async module + update gradle version by @wbaker-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/39
    • Adding sources and javadoc to publish by @wbaker-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/40

    New Contributors

    • @wbaker-figure made their first contribution in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/39

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.1.0...v1.2.0

    Source code(tar.gz)
    Source code(zip)
  • v1.1.2-rc2(Jun 28, 2022)

    What's Changed

    • Update README with more documentation links and small fixups by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/32
    • Externalize channel creation to allow grpc queries without PBClient by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/34
    • Restructure into abstract pb client to allow non-netty channels. by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/35

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.1.0...v1.1.2-rc2

    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Mar 29, 2022)

    What's Changed

    • Wrapping current gas estimators with fetchable gas pricing by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/25
    • Add fallback pricing for gas estimations by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/26
    • Fix calculation for floating fees to include msgFees by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/27
    • Remove hardcoded NetworkType enum values by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/28
    • Use big decimals to ensure amount stays out of scientific notation by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/29
    • Proper combining of fee amounts in the baseReq by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/30
    • Bump provenance proto version to 1.8.0 final by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/31

    New Contributors

    • @mtps made their first contribution in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/25

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.0.5...v1.1.1

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Mar 23, 2022)

    What's Changed

    • Wrapping current gas estimators with fetchable gas pricing by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/25
    • Add fallback pricing for gas estimations by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/26
    • Fix calculation for floating fees to include msgFees by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/27
    • Remove hardcoded NetworkType enum values by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/28
    • Use big decimals to ensure amount stays out of scientific notation by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/29
    • Proper combining of fee amounts in the baseReq by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/30
    • Bump provenance proto version to 1.8.0 final by @mtps in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/31

    New Contributors

    • @mtps made their first contribution in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/25

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.0.5...v1.1.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(Feb 16, 2022)

    What's Changed

    • support multiple gas estimation methods by @afremuth-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/24

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.0.4...v1.0.5

    Source code(tar.gz)
    Source code(zip)
  • v1.0.4(Feb 16, 2022)

    What's Changed

    • undo type change to maintain compatability with pbc 1.7.x based versions by @afremuth-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/23

    New Contributors

    • @afremuth-figure made their first contribution in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/23

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.0.3...v1.0.4

    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Feb 15, 2022)

    What's Changed

    • Support BIP-32 keys by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/22
    • getting msg fee to work client side. by @arnabmitra in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/8

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.0.2...v1.0.3

    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Feb 10, 2022)

    What's Changed

    • Small build reorg by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/10
    • Expose the Tendermint client through PbClient by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/9
    • Workflow: Manually dispatch to publish off of a branch (part 1) by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/13
    • Workflow: Manually dispatch to publish off of a branch (part 2) by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/14
    • Add feeGranter property to BaseReq by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/15
    • Update dependencies and remove unused ones by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/16
    • Add KtLint as the code linter + fix up linting errors by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/17
    • Upgrade hdwallet + update README with hdwallet example by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/19
    • Open PbClient for extension by @mplokita-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/20
    • allow more precise handling of wallet signer prefix/path by @leeduan in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/21
    • Replace hard coded main+testnet hrp values with ones defined in hdwallet for Provenance by @mwoods-figure in https://github.com/provenance-io/pb-grpc-client-kotlin/pull/18

    Full Changelog: https://github.com/provenance-io/pb-grpc-client-kotlin/compare/v1.0.1...v1.0.2

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Dec 20, 2021)

Owner
Provenance Blockchain, Inc.
Provenance is an open distributed stakeholder blockchain ecosystem built by Figure.com that includes omnibus banks, marketplaces, investor passporting, and more
Provenance Blockchain, Inc.
Kotlin & Java class for gRPC client

jvm-minter-grpc-class Kotlin & Java class for gRPC client Use @TODO Разное Добавление git subtree add --prefix node-grpc-gateway https://github.com/Mi

Aleksey Kukhnovets 2 May 26, 2022
Playground server-client Android app using gRPC and protocol buffers

gRPC Playground The goal of this app is to connect to a server, exchange information using the gRPC protocol and lastly retrieve some mocked credentia

Thanos Psaridis 8 Sep 14, 2022
Kotlin implementation of basic blockchain technology.

kotlin-blockchain Kotlin implementation of basic blockchain technology. Features: Data and storage Mining and block validation Hashing and previous bl

null 2 May 15, 2022
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

Oguzhan 18 Apr 21, 2022
Aplicação Micronaut GRPC utilizando Kotlin e arquitetura Hexagonal

micronaut-grpc-demo Aplicação Micronaut GRPC utilizando Kotlin e arquitetura Hexagonal #Baixando e configurando um container Postgres: Postgres: docke

Paulo César de Souza 0 Nov 15, 2021
grpc stream fullstack example(spring+kotlin / next.js + typescript)

grpc-stream-fullstack chat application build with grpc named qhat Prerequisites server sync .proto files on src/main/proto/grpc/qhat/ $ ./gradlew sync

Dave Kwon 5 Nov 14, 2022
KTor-Client---Android - The essence of KTor Client for network calls

KTor Client - Android This project encompasses the essence of KTor Client for ne

Mansoor Nisar 2 Jan 18, 2022
TODO API Client Kata for Kotlin Developers. The main goal is to practice integration testing using MockWebServer

KataTODOApiClient for Kotlin We are here to practice integration testsing using HTTP stubbing. We are going to use MockWebServer to simulate a HTTP se

Karumi 61 Nov 20, 2022
A simple android Twitter client written in Kotlin

Blum Blum is an unofficial, simple, fast Twitter client written in Kotlin. This project is a complete rewrite of the Java version. Screenshot Build To

Andrea Pivetta 77 Nov 29, 2022
Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock

This kata is a Kotlin multiplatform version of the kata KataTODOApiClientKotlin of Karumi. We are here to practice integration testing using HTTP stub

Jorge Sánchez Fernández 29 Oct 3, 2022
Mobile client for official Nextcloud News App written as Kotlin Multiplatform Project

Newsout Android and iOS mobile client for Nextcloud news App. The Android client is already available to download in the Play Store. F-Droid and Apple

Simon Schubert 118 Oct 3, 2022
High performance and fully asynchronous pulsar client with Kotlin and Vert.x

pulsarkt High performance pulsar client with Kotlin and Vert.x Features Basic Producer/Consumer API Partitioned topics Batching Chunking Compression T

null 1 Nov 5, 2021
Firestore Kotlin Client with strict (and relaxed) type-system.

Firestore Kotlin Client with strict (and relaxed) type-system.

Vihang Patil 2 Mar 4, 2022
🧶 Full-fledged Kotlin client for MikaBot/cluster-operator as a separate package

?? Eri Full-fledged Kotlin client for MikaBot/cluster-operator as a separate package Usage Connecting to operator fun main(args: Array<String>) {

Nino 3 Nov 17, 2021
Client App to show the information of the searched Pokemon

PokemonSearch Client App to show the information of the searched Pokemon. It uses Pokemon SDK to show all the information. How to use it. Set up Take

kunalsale 0 Nov 21, 2021
A server which delivers client configuration settings to an end-user over http.

RuneTopic HTTP Server A server which delivers client configuration settings to an end-user over http. Setup Guide You can host a http server with Dock

Runetopic 2 Dec 1, 2021
OO Boot Camp reference implementation for Jordanian client in Kotlin in January 2022

oo_boot_camp_2022-01-24_kotlin Copyright (c) 2022 by Fred George May be used fre

Fred George 0 Mar 6, 2022
Webclient-kotlin-sample - An example of using the http web client to promote synchronous and asynchronous https calls

Web Client Consumer Kotlin Sample The project is an example of using the http we

null 1 May 1, 2022
Common - Packet Definition between Client and Server

CheaTank common A simple game aimed at developing a cheat client and suppressing

CheaTank 0 Jan 27, 2022