algorand / algorand/go-algorand

`goal` improvements: configuring nodes connecting to public networks

Aberta
#5,378 1 comentário 0 reações 0 responsáveis Ver no GitHub
new-feature-request Team Lamprey
Linguagem predominante
Go
Estrelas
1.4k
Forks
537
Merge médio
1d 6h
PRs com merge (30d)
17

Descrição

## Problem

Currently the `goal create` command is useful for bootstrapping a network. Configuring a local node to connect to a public network is traditionally achieved using `algocfg`. Controlling the local node, regardless of whether private or public is done via `goal node` commands. A typical `conduit` friendly network requires a public network with a **follower** node. Setting this up is a bit unwieldy. Additionally, the current `goal create` command doesn't let the creator specify which token or port to use.

An example script to achieve such a setup looks like:
```sh
#! /usr/bin/env bash
set -euo pipefail

DATA_NODE=follower
NODE_PROFILE=conduit
NETWORK=testnet

# The following is probably overspecified
# Local host can't be overridden so just the port 8080 matters
ENDPOINT="127.0.0.1:8080"

NETWORKS =$(echo "$HOME/networks")
ALGORAND_DATA=$NETWORKS/niftynetwork/$DATA_NODE

GO_ALGORAND := "/Users/abcxyz/go-algorand"

ALGORAND_TOKEN_PATH=$ALGORAND_DATA/algod.token
ALGORAND_ADTOKEN_PATH=$ALGORAND_DATA/algod.admin.token

PRESET_ALGOD_TOKEN="16b2....16024"
PRESET_ALGOD_ADMIN="200....695"

mkdir -p $ALGORAND_DATA
algocfg profile set $NODE_PROFILE -d $ALGORAND_DATA
algocfg set -p EndpointAddress -v $ENDPOINT
echo ${PRESET_ALGOD_TOKEN} > ${ALGORAND_TOKEN_PATH}
echo ${PRESET_ALGOD_ADMIN} > ${ALGORAND_ADTOKEN_PATH}
cp ${GO_ALGORAND}/installer/genesis/${NETWORK}/genesis.json $ALGORAND_DATA
```

## Solution

Either introduce a new sub-command `goal network config` or add additional parameters to `goal network create` to enable rolling in the functionality of `algocfg`. In particular, the new command should provide a way to configure:
* **network**: name of private network, or one of the names of a public network
* **template**: path to the template when **network** is _NOT_ one of the public networks
* **profile**: an algocfg profile (see `algocfg profile list`)
* **algodPort**: the port which the local algod for the profile should serve on (if not provided, it should be autogenerated)
* **algodToken**: the token that algod should use (if not provided, it should be autogenerated)
* **adminToken**: the **admin** token that algod should use (if not provided, it should be autogenerated)

## Dependencies

This seems like another story that would benefit from sessions #5376

## Urgency

Low, "nice to have"

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.