You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/rpc-proxy/README.md
+104-77
Original file line number
Diff line number
Diff line change
@@ -8,108 +8,150 @@ The RPC Proxy is designed to bridge the gap between Thor's RESTful API and Ether
8
8
interaction with the VeChainThor blockchain through RPC calls. It is particularly useful for integrating with tools such
9
9
as the Remix IDE.
10
10
11
-
## Installation
11
+
The RPC Proxy can be optionally configured to:
12
12
13
-
To install the RPC proxy, use the following command:
13
+
* sign transactions for `eth_signTransaction` RPC method
14
+
* use a vechain account for fee delegation
15
+
16
+
## Useage
17
+
18
+
The RPC proxy can be used in two different ways:
19
+
20
+
* Executing directly via node package execute (npx)
21
+
* Executing via Docker container
22
+
23
+
Both ways of using can be configured via a configuration file or using command line options
24
+
25
+
## Starting the Proxy
26
+
27
+
To install the RPC proxy for NPX useage, use the following command:
14
28
15
29
```bash
16
30
yarn add @vechain/sdk-rpc-proxy
17
31
```
18
32
19
-
## Usage
20
-
21
-
The RPC proxy is simple to use. To start it, run:
33
+
To start the proxy, run:
22
34
23
35
```bash
24
36
npx rpc-proxy
25
37
```
26
38
27
-
By default, the proxy is configured to be used with a solo node running on your local machine. There are two options if you want to change the default behavior, or use a custom configuration:
28
-
- Create a config.json file and pass it to the command when launching the RPC Proxy.
29
-
- Use CLI options.
30
-
31
-
## Configuration file
32
-
33
-
Run:
39
+
To start the proxy with Docker:
34
40
35
41
```bash
36
-
npx rpc-proxy -c <json config file>
42
+
docker run -d -p 8545:8545 -t vechain/sdk-rpc-proxy:<tag>
37
43
```
38
44
39
-
Or:
45
+
*By default*, the proxy is configured to be used with a solo node running on your local machine.
46
+
There are two options if you want to change the default behavior, or use a custom configuration:
47
+
- Create a `config.json` file and pass it to the command when launching the RPC Proxy
-`npx rpc-proxy -u http://testnet.vechain.org` OR `rpc-proxy --url http://testnet.vechain.org`
74
95
75
-
-`-a, --accounts <accounts>`: The accounts (private keys) that the proxy server will use to sign transactions. It is a
76
-
space-separated list of private keys.
77
-
- -e.g.- `npx rpc-proxy -a "7f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158 8f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158"`
78
-
OR `npx rpc-proxy --accounts "7f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158 8f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158"`
96
+
- enabling verbose logging:
97
+
-`npx rpc-proxy -v` OR `rpc-proxy --verbose`
79
98
80
-
-`-m, --mnemonic <mnemonic>`: The mnemonic that the proxy server will use to sign transactions.
81
-
-`-mc, --mnemonicCount <mnemonicCount>`: The number of accounts to derive from the mnemonic.
82
-
-`-mi, --mnemonicInitialIndex <mnemonicInitialIndex>`: The index from which to start deriving accounts from the
83
-
mnemonic.
84
-
- -e.g.- `npx rpc-proxy -m "denial kitchen pet squirrel other broom bar gas better priority spoil cross" -mc 10 -mi 1`
85
-
OR `npx rpc-proxy --mnemonic "denial kitchen pet squirrel other broom bar gas better priority spoil cross" --mnemonicCount 10 --mnemonicInitialIndex 1`
86
-
-**NOTE**: --mnemonic, --mnemonicCount, and --mnemonicInitialIndex MUST be used together.
99
+
- specificying the accounts (private keys) to sign transactions. It is a space-separated list of private keys.
100
+
-`npx rpc-proxy -a "7f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158 8f9290cc44c5fd2b95fe21d6ad6fe5fa9c177e1cd6f3b4c96a97b13e09eaa158"`
# To replace the default config file, update the config.json file and start a terminal from the folder in which the file is located.
188
-
# DISCLAIMER: Make sure you replace the default config file before using it for production software. By default, the docker will point to testnet and use a known mnemonic.
189
-
docker run -d -p 8545:8545 -v ./config.json:/app/packages/rpc-proxy/config.json -t vechain/sdk-rpc-proxy
190
-
```
191
-
192
-
If you do not pass a config.json file, the default solo network standard configuration will be used. Make sure to
193
-
provide your desired configuration file.
194
-
195
-
## JSON RPC Methods Support Status
222
+
## Appendix - JSON RPC Methods Support Status
196
223
197
224
Below is the support status for JSON RPC methods in VeChain via `sdk-rpc-proxy`.
198
225
@@ -262,7 +289,7 @@ Below is the support status for JSON RPC methods in VeChain via `sdk-rpc-proxy`.
262
289
-**Partially Supported**: The method is implemented but may have limitations or deviations from the Ethereum standard.
263
290
-**Not Supported**: The method is not implemented or cannot be supported due to protocol constraints.
264
291
265
-
## RPC to VeChain Mappings
292
+
###RPC to VeChain Mappings
266
293
267
294
The following mappings are performed by the RPC proxy
268
295
@@ -283,7 +310,7 @@ The method `eth_chainId` returns:
283
310
* for solo or other custom networks it returns the _chainTag_ (the last byte of the genesis block id)
284
311
285
312
286
-
## Transaction Coversions
313
+
###Transaction Conversions
287
314
288
315
The method `eth_sendTransaction` requires the input to be a VeChain transaction object, not a Ethereum transaction object
289
316
This method signs the transaction using the configured PK, before passing it on to VeChain Thor
0 commit comments