|
2 | 2 |
|
3 | 3 | This document describes the different endpoints for the concordium gRPC V2 client.
|
4 | 4 |
|
5 |
| -- [Concordium Nodejs SDK](#concordium-nodejs-sdk) |
| 5 | +**Table of Contents** |
| 6 | + |
6 | 7 | - [ConcordiumNodeClient](#concordiumnodeclient)
|
7 |
| - - [Creating a client](#creating-a-client) |
8 |
| - - [Send Account Transaction](#send-account-transaction) |
9 |
| - - [Create a new account](#create-a-new-account) |
10 |
| - - [getAccountInfo](#getaccountinfo) |
11 |
| - - [getNextAccountSequenceNumber](#getnextaccountsequencenumber) |
12 |
| - - [getBlockItemStatus](#getblockitemstatus) |
13 |
| - - [getConsensusStatus](#getconsensusstatus) |
14 |
| - - [getCryptographicParameters](#getcryptographicparameters) |
15 |
| - - [getBlockChainParameters](#getblockchainparameters) |
16 |
| - - [getPoolInfo](#getpoolinfo) |
17 |
| - - [getPassiveDelegationInfo](#getpassivedelegationinfo) |
18 |
| - - [getTokenomicsInfo](#gettokenomicsinfo) |
19 |
| - - [getInstanceInfo](#getinstanceinfo) |
20 |
| - - [invokeContract](#invokecontract) |
21 |
| - - [getModuleSource](#getmodulesource) |
22 |
| - - [getBlocks](#getblocks) |
23 |
| - - [getFinalizedBlocks](#getfinalizedblocks) |
24 |
| - - [waitForTransactionFinalization](#waitfortransactionfinalization) |
25 |
| - - [getAccountList](#getaccountlist) |
26 |
| - - [getModuleList](#getmodulelist) |
27 |
| - - [getAncestors](#getancestors) |
28 |
| - - [getInstanceState](#getinstancestate) |
29 |
| - - [instanceStateLookup](#instancestatelookup) |
30 |
| - - [getIdentityProviders](#getidentityproviders) |
31 |
| - - [getAnonymityRevokers](#getanonymityrevokers) |
32 |
| - - [getBlocksAtHeight](#getblocksatheight) |
33 |
| - - [getBlockInfo](#getblockinfo) |
34 |
| - - [getBakerList](#getbakerlist) |
35 |
| - - [getPoolDelegators](#getpooldelegators) |
36 |
| - - [getPoolDelegatorsRewardPeriod](#getpooldelegatorsrewardperiod) |
37 |
| - - [getPassiveDelegators](#getpassivedelegators) |
38 |
| - - [getPassiveDelegatorsRewardPeriod](#getpassivedelegatorsrewardperiod) |
39 |
| - - [getBranches](#getbranches) |
40 |
| - - [getElectionInfo](#getelectioninfo) |
41 |
| - - [getAccountNonFinalizedTransactions](#getaccountnonfinalizedtransactions) |
42 |
| - - [getBlockTransactionEvents](#getblocktransactionevents) |
43 |
| - - [getNextUpdateSequenceNumbers](#getnextupdatesequencenumbers) |
44 |
| - - [shutdown](#shutdown) |
45 |
| - - [peerConnect](#peerconnect) |
46 |
| - - [peerDisconnect](#peerdisconnect) |
47 |
| - - [getBannedPeers](#getbannedpeers) |
48 |
| - - [banPeer](#banpeer) |
49 |
| - - [unbanPeer](#unbanpeer) |
50 |
| - - [dumpStart](#dumpstart) |
51 |
| - - [dumpStop](#dumpstop) |
52 |
| - - [getNodeInfo](#getnodeinfo) |
53 |
| - - [getPeersInfo](#getpeersinfo) |
54 |
| - - [getBlockSpecialEvents](#getblockspecialevents) |
55 |
| - - [getBlockPendingUpdates](#getblockpendingupdates) |
56 |
| - - [getBlockFinalizationSummary](#getblockfinalizationsummary) |
| 8 | + - [Creating a client](#creating-a-client) |
| 9 | + - [Send Account Transaction](#send-account-transaction) |
| 10 | + - [Create a new account](#create-a-new-account) |
| 11 | + - [getAccountInfo](#getaccountinfo) |
| 12 | + - [getNextAccountSequenceNumber](#getnextaccountsequencenumber) |
| 13 | + - [getBlockItemStatus](#getblockitemstatus) |
| 14 | + - [getConsensusStatus](#getconsensusstatus) |
| 15 | + - [getCryptographicParameters](#getcryptographicparameters) |
| 16 | + - [getBlockChainParameters](#getblockchainparameters) |
| 17 | + - [getPoolInfo](#getpoolinfo) |
| 18 | + - [getPassiveDelegationInfo](#getpassivedelegationinfo) |
| 19 | + - [getTokenomicsInfo](#gettokenomicsinfo) |
| 20 | + - [getInstanceInfo](#getinstanceinfo) |
| 21 | + - [invokeContract](#invokecontract) |
| 22 | + - [getModuleSource](#getmodulesource) |
| 23 | + - [getBlocks](#getblocks) |
| 24 | + - [getFinalizedBlocks](#getfinalizedblocks) |
| 25 | + - [waitForTransactionFinalization](#waitfortransactionfinalization) |
| 26 | + - [getAccountList](#getaccountlist) |
| 27 | + - [getModuleList](#getmodulelist) |
| 28 | + - [getAncestors](#getancestors) |
| 29 | + - [getInstanceState](#getinstancestate) |
| 30 | + - [instanceStateLookup](#instancestatelookup) |
| 31 | + - [getIdentityProviders](#getidentityproviders) |
| 32 | + - [getAnonymityRevokers](#getanonymityrevokers) |
| 33 | + - [getBlocksAtHeight](#getblocksatheight) |
| 34 | + - [getBlockInfo](#getblockinfo) |
| 35 | + - [getBakerList](#getbakerlist) |
| 36 | + - [getPoolDelegators](#getpooldelegators) |
| 37 | + - [getPoolDelegatorsRewardPeriod](#getpooldelegatorsrewardperiod) |
| 38 | + - [getPassiveDelegators](#getpassivedelegators) |
| 39 | + - [getPassiveDelegatorsRewardPeriod](#getpassivedelegatorsrewardperiod) |
| 40 | + - [getBranches](#getbranches) |
| 41 | + - [getElectionInfo](#getelectioninfo) |
| 42 | + - [getAccountNonFinalizedTransactions](#getaccountnonfinalizedtransactions) |
| 43 | + - [getBlockTransactionEvents](#getblocktransactionevents) |
| 44 | + - [getNextUpdateSequenceNumbers](#getnextupdatesequencenumbers) |
| 45 | + - [shutdown](#shutdown) |
| 46 | + - [peerConnect](#peerconnect) |
| 47 | + - [peerDisconnect](#peerdisconnect) |
| 48 | + - [getBannedPeers](#getbannedpeers) |
| 49 | + - [banPeer](#banpeer) |
| 50 | + - [unbanPeer](#unbanpeer) |
| 51 | + - [dumpStart](#dumpstart) |
| 52 | + - [dumpStop](#dumpstop) |
| 53 | + - [getNodeInfo](#getnodeinfo) |
| 54 | + - [getPeersInfo](#getpeersinfo) |
| 55 | + - [getBlockSpecialEvents](#getblockspecialevents) |
| 56 | + - [getBlockPendingUpdates](#getblockpendingupdates) |
| 57 | + - [getBlockFinalizationSummary](#getblockfinalizationsummary) |
57 | 58 |
|
58 | 59 | # ConcordiumNodeClient
|
59 | 60 |
|
60 | 61 | The ConcordiumNodeClient defines the interface to be used to send and receive data from
|
61 | 62 | a concordium-node.
|
62 | 63 |
|
63 | 64 | ## Creating a client
|
64 |
| -Connection to a node can be done using either an insecure connection or a TLS connection. If the node that you are trying to connect to supports TLS, you can create a TLS connection in the following way: |
65 |
| - |
66 |
| -```js |
67 |
| -import { credentials, Metadata } from "@grpc/grpc-js"; |
68 |
| -import { ConcordiumNodeClient } from "@concordium/node-sdk"; |
69 |
| - |
70 |
| -const metadata = new Metadata(); |
71 |
| -metadata.add("authentication", "rpcadmin"); |
72 |
| - |
73 |
| -const client = new ConcordiumNodeClient( |
74 |
| - "127.0.0.1", // ip address |
75 |
| - 10000, // port |
76 |
| - credentials.createSsl(), |
77 |
| - metadata, |
78 |
| - 15000 // timeout in ms |
79 |
| -); |
80 |
| -``` |
81 |
| - |
82 |
| -The access is controlled by the credentials and the metadata. If the node does not support TLS an insecure connection can be established using `credentials.createInsecure()` instead of `credentials.createSsl()`. |
83 |
| - |
84 |
| -Note that the web-sdk and node-sdk each exposes a helper function `createConcordiumClient` that creates a client using the appropriate transport (gRPC-web for web and regular gRPC for nodeJS). |
| 65 | +The client requires an appropriate transport. However the web-sdk and node-sdk each exposes a helper function `createConcordiumClient` that creates a client using the appropriate transport (gRPC-web for web and regular gRPC for nodeJS). |
| 66 | +Please refer the the [node-sdk](../packages/nodejs/README.md#concordiumnodeclient) or [web-sdk's](../packages/web/README.md#concordiumnodeclient) README's to see how to use those functions. |
85 | 67 |
|
86 | 68 | ## Send Account Transaction
|
87 | 69 | The following example demonstrates how to send any account transaction.
|
88 | 70 |
|
89 |
| -See the Constructing transactions section for the [common package](./#constructing-transactions) for how to create an account transaction. |
90 |
| -See the signing a transaction section for the [common package](./#sign-an-account-transaction) for how to sign an account transaction. |
| 71 | +See the Constructing transactions section for the [common package](../packages/common/README.md#constructing-transactions) for how to create an account transaction. |
| 72 | +See the signing a transaction section for the [common package](../packages/common/README.md#sign-an-account-transaction) for how to sign an account transaction. |
91 | 73 |
|
92 | 74 | ```js
|
93 | 75 |
|
|
0 commit comments