Skip to content

Commit ee5de69

Browse files
Merge pull request #146 from Concordium/deprecate-and-cleanup
Deprecate and cleanup
2 parents e8b0c0d + 5bc5c3e commit ee5de69

File tree

20 files changed

+205
-126
lines changed

20 files changed

+205
-126
lines changed

docs/gRPC.md

Lines changed: 56 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,92 +2,74 @@
22

33
This document describes the different endpoints for the concordium gRPC V2 client.
44

5-
- [Concordium Nodejs SDK](#concordium-nodejs-sdk)
5+
**Table of Contents**
6+
67
- [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)
5758

5859
# ConcordiumNodeClient
5960

6061
The ConcordiumNodeClient defines the interface to be used to send and receive data from
6162
a concordium-node.
6263

6364
## 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.
8567

8668
## Send Account Transaction
8769
The following example demonstrates how to send any account transaction.
8870

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.
9173

9274
```js
9375

docs/grpc-v1.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22

33
> :warning: **This explains behaviour of the deprecated v1 concordium client**: check out [the documentation the v2 client](./gRPC)
44
5-
- [ConcordiumNodeClient](#concordiumnodeclient)
6-
- [Creating a client](#creating-a-client)
7-
- [Send Account Transaction](#send-account-transaction)
8-
- [Create a new account](#create-a-new-account)
9-
- [Construct IdentityInput for creating credentials](#construct-identityinput-for-creating-credentials)
10-
- [Construct from user-cli output:](#construct-from-user-cli-output)
11-
- [Construct from mobile wallet export:](#construct-from-mobile-wallet-export)
12-
- [getAccountInfo](#getaccountinfo)
13-
- [getNextAccountNonce](#getnextaccountnonce)
14-
- [getTransactionStatus](#gettransactionstatus)
15-
- [getBlockSummary](#getblocksummary)
16-
- [getBlockInfo](#getblockinfo)
17-
- [getBlocksAtHeight](#getblocksatheight)
18-
- [getConsensusStatus](#getconsensusstatus)
19-
- [getCryptographicParameters](#getcryptographicparameters)
20-
- [getIdentityProviders](#getidentityproviders)
21-
- [getAnonymityRevokers](#getanonymityrevokers)
22-
- [getPeerList](#getpeerlist)
23-
- [getBakerList](#getbakerlist)
24-
- [getPoolStatus](#getpoolstatus)
25-
- [getRewardStatus](#getrewardstatus)
26-
- [Check block for transfers with memo](#check-block-for-transfers-with-memo)
27-
- [getInstances](#getinstances)
28-
- [getInstanceInfo](#getinstanceinfo)
29-
- [invokeContract](#invokecontract)
30-
- [getModuleSource](#getModuleSource)
5+
**Table of Contents**
6+
- [Creating a client](#creating-a-client)
7+
- [Send Account Transaction](#send-account-transaction)
8+
- [Create a new account](#create-a-new-account)
9+
- [Construct IdentityInput for creating credentials](#construct-identityinput-for-creating-credentials)
10+
- [Construct from user-cli output](#construct-from-user-cli-output)
11+
- [Construct from mobile wallet export](#construct-from-mobile-wallet-export)
12+
- [getAccountInfo](#getaccountinfo)
13+
- [getNextAccountNonce](#getnextaccountnonce)
14+
- [getTransactionStatus](#gettransactionstatus)
15+
- [getBlockSummary](#getblocksummary)
16+
- [getBlockInfo](#getblockinfo)
17+
- [getBlocksAtHeight](#getblocksatheight)
18+
- [getConsensusStatus](#getconsensusstatus)
19+
- [getCryptographicParameters](#getcryptographicparameters)
20+
- [getIdentityProviders](#getidentityproviders)
21+
- [getAnonymityRevokers](#getanonymityrevokers)
22+
- [getPeerList](#getpeerlist)
23+
- [getBakerList](#getbakerlist)
24+
- [getPoolStatus](#getpoolstatus)
25+
- [getRewardStatus](#getrewardstatus)
26+
- [Check block for transfers with memo](#check-block-for-transfers-with-memo)
27+
- [getInstances](#getinstances)
28+
- [getInstanceInfo](#getinstanceinfo)
29+
- [invokeContract](#invokecontract)
30+
- [getModuleSource](#getmodulesource)
3131

3232
The ConcordiumNodeClient defines the interface to be used to send and receive data from
3333
a concordium-node.

packages/common/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
report an error when called with invalid data, such as a receive function with
2626
missing schema, or a schema that cannot be parsed.
2727

28+
### Deprecated
29+
30+
- The JSON-RPC client has been deprecated in favor of the new gRPC v2 client.
31+
- Various types and helper functions used by the JSON-RPC client (and the v1 gRPC client) have also been deprecated.
32+
2833
## 6.2.0 2023-01-04
2934

3035
### Added

packages/common/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This package is the shared library for the nodejs and web SDK's.
99
- [Create a simple transfer with a memo](#create-a-simple-transfer-with-a-memo)
1010
- [Create a Register data transaction](#create-a-register-data-transaction)
1111
- [Create a configure delegation transaction](#create-a-configure-delegation-transaction)
12+
- [Create a configure baker transaction](#create-a-configure-baker-transaction)
1213
- [Create a credential for an existing account](#create-a-credential-for-an-existing-account)
1314
- [Create an update credentials transaction](#create-an-update-credentials-transaction)
1415
- [Deploy module](#deploy-module)
@@ -35,6 +36,7 @@ This package is the shared library for the nodejs and web SDK's.
3536
- [Non membership statement](#non-membership-statement)
3637
- [Verify Statement (verifyIdstatement)](#verify-statement-verifyidstatement)
3738
- [Prove Statement (getIdProof)](#prove-statement-getidproof)
39+
- [ConcordiumNodeClient](#concordiumnodeclient)
3840
- [JSON-RPC client](#json-rpc-client)
3941

4042
# Constructing transactions

packages/common/src/JsonRpcClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ function transformJsonResponse<Result>(
4444
return JSON.parse(jsonString, reviver);
4545
}
4646

47+
/**
48+
* @deprecated This has been deprecated in favor of the {@link ConcordiumNodeClient} that uses version 2 of the concordium gRPC API
49+
*/
4750
export class JsonRpcClient {
4851
provider: Provider;
4952

packages/common/src/providers/httpProvider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import fetch from 'cross-fetch';
33
import JSONBig from 'json-bigint';
44
import { v4 as uuidv4 } from 'uuid';
55

6+
/**
7+
* @deprecated This is only used by the JSON-RPC client, which has been deprecated
8+
*/
69
export class HttpProvider implements Provider {
710
request: JsonRpcRequest;
811
cookie?: string;

packages/common/src/providers/provider.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ interface JsonRpcResponseBase {
66
id: string | null;
77
}
88

9+
/**
10+
* @deprecated This is only used by the JSON-RPC client, which has been deprecated
11+
*/
912
export interface JsonRpcResponseError extends JsonRpcResponseBase {
1013
error: {
1114
code: number;
@@ -15,15 +18,24 @@ export interface JsonRpcResponseError extends JsonRpcResponseBase {
1518
result?: never;
1619
}
1720

21+
/**
22+
* @deprecated This is only used by the JSON-RPC client, which has been deprecated
23+
*/
1824
export interface JsonRpcResponseSuccess<Result> extends JsonRpcResponseBase {
1925
error?: never;
2026
result: Result;
2127
}
2228

29+
/**
30+
* @deprecated This is only used by the JSON-RPC client, which has been deprecated
31+
*/
2332
export type JsonRpcResponse<Result> =
2433
| JsonRpcResponseError
2534
| JsonRpcResponseSuccess<Result>;
2635

36+
/**
37+
* @deprecated This is only used by the JSON-RPC client, which has been deprecated
38+
*/
2739
export type JsonRpcRequest = (
2840
...args:
2941
| ['getNextAccountNonce', { address: string }]
@@ -53,6 +65,9 @@ export type JsonRpcRequest = (
5365
]
5466
) => Promise<string>;
5567

68+
/**
69+
* @deprecated This is only used by the JSON-RPC client, which has been deprecated
70+
*/
5671
export default interface Provider {
5772
request: JsonRpcRequest;
5873
}

0 commit comments

Comments
 (0)