algorand / algorand/go-algorand
`goal` improvements: remote
- Langage dominant
- Go
- Étoiles
- 1.4k
- Forks
- 537
- Merge moyen
- 1 j 6 h
- PR mergées (30 j)
- 17
Description
## Problem
Currently, most `goal` commands require a local data directory which contains configuration information for goal and also the data for a locally running node. However, many `goal` commands do not interact directly with the stored network data, and instead query a locally running `algod` server.
> HINT: you can start seeing which commands are purely run through `algod` with: `egrep -rn "ensureAlgodClient" .`
So from a user's perspective, such commands ought to be runnable against an `algod` running remotely. One can _trick_ `goal` into doing this by overwriting information in the data directory, but this is an error prone hack.
## Solution
Introduce a new `goal remote` command that can handle any pure `algod` functionality, but instead of using data directory, uses data that's been set in the following session variables:
* `ALGOD_URL`
* `ALGOD_TOKEN`
* some commands may require additional variables such as `ALGOD_ADMIN_TOKEN`, etc.
## Implementation choices
1. **Pre**peating a point made below (3). Is `remote` actually redundant if we maintain proper sessions?
2. This provides more urgency to #5376 since managing multiple variables would benefit from belonging to a session
3. Alternatively, instead of a new `goal remote` command, we could keep the current interface but ignore data directory provided `algod` configs when `ALGOD_URL`, `ALGOD_TOKEN`, etc... env vars are set.
4. We would need to decide what the behavior of the proposed `goal algod` (#5373, #5374) would be in the case that `ALGOD_URL`, `ALGOD_TOKEN`, etc... env vars are set: should we query the remote `algod` or should we require `goal remote algod ...`
5. There is a ***heavier*** version of this issue which would actually execute a `goal` client running remotely via **gRPC** (or similar). This would enable running all `goal` commands transparently, much as `./sandbox goal ...` facilitates ([example](https://github.com/algorand/sandbox#copyto-example)).
## Dependencies
Probably depends on #5376
## Urgency
Low, "nice to have"
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.