solution: docs for ERC-20 tokens
This commit is contained in:
@@ -43,9 +43,8 @@ image::dshackle-intro.png[alt="",width=80%,align="center"]
|
|||||||
== Roadmap
|
== Roadmap
|
||||||
|
|
||||||
- [ ] External logging
|
- [ ] External logging
|
||||||
- [ ] Access to ERC-20 tokens on asset level
|
|
||||||
- [ ] Subscription to bitcoind notification over gRPC (instead of ZeroMQ)
|
|
||||||
- [ ] Prometheus monitoring
|
- [ ] Prometheus monitoring
|
||||||
|
- [ ] Subscription to bitcoind notification over gRPC (instead of ZeroMQ)
|
||||||
- [ ] BIP-32 Pubkey
|
- [ ] BIP-32 Pubkey
|
||||||
- [ ] Lightweight sidecar node connector
|
- [ ] Lightweight sidecar node connector
|
||||||
- [ ] Configurable upstream roles
|
- [ ] Configurable upstream roles
|
||||||
@@ -226,7 +225,10 @@ grpcurl -import-path ./proto/ -proto blockchain.proto -d '{\"asset\": {\"chain\"
|
|||||||
...
|
...
|
||||||
----
|
----
|
||||||
|
|
||||||
See other enhanced methods in the link:docs/06-methods.adoc[Documentation for Enhanced Methods]
|
The balance subscription works with main coin (_ether_, _bticoin_), or with tokens like ERC-20 if configured additionally.
|
||||||
|
See link:docs/reference-configuration.adoc[Configuration Reference].
|
||||||
|
|
||||||
|
See other enhanced methods in the link:docs/06-methods.adoc[Documentation for Enhanced Methods].
|
||||||
|
|
||||||
== Documentation
|
== Documentation
|
||||||
|
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ Where:
|
|||||||
|
|
||||||
- `chain` target chain (see reference for ids)
|
- `chain` target chain (see reference for ids)
|
||||||
- `items` as a list of independent requests, which may be executed in different nodes in parallels or in different order, with:
|
- `items` as a list of independent requests, which may be executed in different nodes in parallels or in different order, with:
|
||||||
* `method` - a JSON RPC standard name, ex: `eth_getBlockByHash`
|
* `method` - a JSON RPC standard name, ex: `eth_getBlockByHash`
|
||||||
* `payload` - list of parameters for the methods, encoded as JSON string, ex. `["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", true]`
|
* `payload` - list of parameters for the methods, encoded as JSON string, ex. `["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", true]`
|
||||||
- `Selector` and `AvailabilityEnum` are described in reference, in short they allow to specify which nodes must be selected
|
- `Selector` and `AvailabilityEnum` are described in reference, in short they allow to specify which nodes must be selected
|
||||||
to execute the reques (i.e. "execute only on an archive node")
|
to execute the reques (i.e. "execute only on an archive node")
|
||||||
|
|
||||||
.NativeCallReplyItem
|
.NativeCallReplyItem
|
||||||
[source,proto]
|
[source,proto]
|
||||||
@@ -71,7 +71,7 @@ message NativeCallReplyItem {
|
|||||||
|
|
||||||
Where:
|
Where:
|
||||||
|
|
||||||
- `payload` is JSON response for a particular call, encoded into a string (when `succeed` is true)
|
- `payload` is JSON response for a particular call (`result` field), encoded into a string (`succeed` is true)
|
||||||
- or `error` if request failed (`succeed` is false)
|
- or `error` if request failed (`succeed` is false)
|
||||||
|
|
||||||
NOTE: Reply Items comes right after their execution on an upstream, therefore streaming response.
|
NOTE: Reply Items comes right after their execution on an upstream, therefore streaming response.
|
||||||
@@ -106,7 +106,8 @@ Where:
|
|||||||
|
|
||||||
=== SubscribeBalance or GetBalance
|
=== SubscribeBalance or GetBalance
|
||||||
|
|
||||||
Subscribes to changes (`SubscribeBalance`) or get current (`GetBalance`) balance for a single address or a set of addresses.
|
Subscribes to changes (`SubscribeBalance`) or get current (`GetBalance`) balance for a single address, or a set of addresses.
|
||||||
|
By default, it supports only main protocol coin (i.e. `bitcoin`, `ether`), but can be configured to support ERC-20 on Ethereum (see link:reference-configuration.adoc[Reference Configuration])
|
||||||
|
|
||||||
.Request
|
.Request
|
||||||
[source,proto]
|
[source,proto]
|
||||||
|
|||||||
@@ -46,6 +46,18 @@ proxy:
|
|||||||
- id: kovan
|
- id: kovan
|
||||||
blockchain: kovan
|
blockchain: kovan
|
||||||
|
|
||||||
|
tokens:
|
||||||
|
- id: dai
|
||||||
|
blockchain: ethereum
|
||||||
|
name: DAI
|
||||||
|
type: ERC-20
|
||||||
|
address: 0x6B175474E89094C44Da98b954EedeAC495271d0F
|
||||||
|
- id: tether
|
||||||
|
blockchain: ethereum
|
||||||
|
name: Tether
|
||||||
|
type: ERC-20
|
||||||
|
address: 0xdac17f958d2ee523a2206206994597c13d831ec7
|
||||||
|
|
||||||
cluster:
|
cluster:
|
||||||
defaults:
|
defaults:
|
||||||
- chains:
|
- chains:
|
||||||
@@ -130,6 +142,11 @@ cluster:
|
|||||||
|
|
|
|
||||||
| Setup HTTP proxy that emulates all standard JSON RPC requests. See <<proxy>> section
|
| Setup HTTP proxy that emulates all standard JSON RPC requests. See <<proxy>> section
|
||||||
|
|
||||||
|
| `tokens`
|
||||||
|
|
|
||||||
|
| Configure tokens for tracking balance. See <<tokens>> section
|
||||||
|
|
||||||
|
|
||||||
| `cache`
|
| `cache`
|
||||||
|
|
|
|
||||||
| Caching configuration. See <<cache>> section.
|
| Caching configuration. See <<cache>> section.
|
||||||
@@ -242,6 +259,49 @@ a| Routing paths for Proxy. The proxy will handle requests as `https://${HOST}:$
|
|||||||
|
|
||||||
|===
|
|===
|
||||||
|
|
||||||
|
[#tokens]
|
||||||
|
== Tokens config
|
||||||
|
|
||||||
|
[source,yaml]
|
||||||
|
----
|
||||||
|
tokens:
|
||||||
|
- id: dai
|
||||||
|
blockchain: ethereum
|
||||||
|
name: DAI
|
||||||
|
type: ERC-20
|
||||||
|
address: 0x6B175474E89094C44Da98b954EedeAC495271d0F
|
||||||
|
- id: tether
|
||||||
|
blockchain: ethereum
|
||||||
|
name: Tether
|
||||||
|
type: ERC-20
|
||||||
|
address: 0xdac17f958d2ee523a2206206994597c13d831ec7
|
||||||
|
----
|
||||||
|
|
||||||
|
Tokens config enables tracking of a balance amount in the configured tokens.
|
||||||
|
After making the configuration above you can request balance (`GetBalance`), or subscribe to balance changes (`SubscribeBalance`), using link:06-methods.adoc[enhanced protocol]
|
||||||
|
|
||||||
|
.Token config
|
||||||
|
[cols="2a,7"]
|
||||||
|
|===
|
||||||
|
| Option | Description
|
||||||
|
|
||||||
|
| `id`
|
||||||
|
| Internal id for reference (used in logging, etc)
|
||||||
|
|
||||||
|
| `blockchain`
|
||||||
|
| An ethereum-based blockchain where the contract is deployed
|
||||||
|
|
||||||
|
| `name`
|
||||||
|
| Name of the token, used for balance response as asset code (as converted to UPPERCASE)
|
||||||
|
|
||||||
|
| `type`
|
||||||
|
| Type of token. Only `ERC-20` is supported at this moment
|
||||||
|
|
||||||
|
| `address`
|
||||||
|
| Address of the deployed contract
|
||||||
|
|
||||||
|
|===
|
||||||
|
|
||||||
[#cache]
|
[#cache]
|
||||||
== Cache config
|
== Cache config
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user