51 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2023-02-14 10:57:50 +04:00
# Aqua Ethereum Gateway
Gateway represents access to different Ethereum API providers (infura, alchemy). It can be used with Web3 client and load balancing requests between different providers.
## Installation
```shell
npm install -g @fluencelabs/aqua-eth-gateway
```
## Example
```shell
aqua-eth-gateway path/to/config.json
```
where config is:
```json
{
"providers": [
"https://goerli.infura.io/v3/your-api-key",
"https://eth-goerli.g.alchemy.com/v2/your-api-key"
],
"mode": "random",
"relay": "fluence/peer/address",
"serviceId": "eth-rpc serviceId",
"port": 3000,
"counterServiceId": null,
2023-02-21 16:31:21 +04:00
"counterPeerId": null,
"quorumServiceId": null,
"quorumPeerId": null,
2023-02-23 14:31:57 +04:00
"quorumNumber": null,
"quorumTimeout": null,
"requestTimeout": null
2023-02-14 10:57:50 +04:00
}
```
`counterServiceId` and `counterPeerId` is credentials to counter service for `round-robin` mode. Will be used local counter if undefined.
2023-02-21 16:31:21 +04:00
`quorumServiceId` and `quorumPeerId` is credentials to counter service for `round-robin` mode. Will be used local counter if undefined.
`quorumNumber` is `2` by default.
2023-02-23 14:31:57 +04:00
`quorumTimeout` is how long we will wait for all responses
`requestTimeout` is how long we will wait for aqua request
2023-02-14 10:57:50 +04:00
## Mode
`random` - choose providers randomly
`round-robin` - choose providers in circle order
2023-02-21 16:31:21 +04:00
`quorum` - call all providers and choose the result that is the same from `>= quorumNumber` providers. Or return an error.