nodo docker cómo habilitar RPC?
2 respuestas
- votos
-
- 2019-02-16
Porelmomento,lo siguienteparecefuncionar:
alphanet.sh start --rpc-port 127.0.0.1:8732
.Tengaen cuenta
--rpc-port
y NO--rpc-addr
,estaes una opción de casoespecialen alphanet.sh.Estoinsertará unaentrada:
Puertosports: - "127.0.0.1:8732:8732"
en el docker-compose.yamlgenerado,lo que hace queel RPC seexponga a localhosten elpuertoespecificado; yaestabaexpuesto como de costumbre con
--rpc-addr
en eltezos-nodeen símismo,pero solo dentro del contenedor.Estoestá documentado,más omenos:
./scripts/alphanet.sh start [--rpc-port <int>] [OPTIONS] Launch a full Tezos alphanet node in a docker container automatically generating a new network identity. OPTIONS (others than --rpc-port) are directly passed to the Tezos node, see './scripts/alphanet.sh shell tezos-node config --help' for more details. By default, the RPC port is not exported outside the docker container. WARNING: when exported some RPCs could be harmful (e.g. 'inject_block', 'force_validation', ...), it is advised not to export them publicly.
Aunque seesperaba unpuerto (
<int>
),--rpc-port 127.0.0.1:8732
funciona y,en general,debería sermás seguro.At the moment the following appears to work:
alphanet.sh start --rpc-port 127.0.0.1:8732
.Note
--rpc-port
and NOT--rpc-addr
, this is a special case option in alphanet.sh.This will insert a entry:
ports: - "127.0.0.1:8732:8732"
into the generated docker-compose.yaml, causing the RPC to be exposed to localhost at the specified port -- it was already exposed as usual with
--rpc-addr
in the tezos-node itself, but only inside the container.This is documented, sort of:
./scripts/alphanet.sh start [--rpc-port <int>] [OPTIONS] Launch a full Tezos alphanet node in a docker container automatically generating a new network identity. OPTIONS (others than --rpc-port) are directly passed to the Tezos node, see './scripts/alphanet.sh shell tezos-node config --help' for more details. By default, the RPC port is not exported outside the docker container. WARNING: when exported some RPCs could be harmful (e.g. 'inject_block', 'force_validation', ...), it is advised not to export them publicly.
Even though a port was expected (
<int>
),--rpc-port 127.0.0.1:8732
happens to work, and should be generally safer. -
- 2019-03-22
Parainiciar rpcen elpuerto 8732,use
./alphanet.sh start --rpc-port 8732
Como semencionaen el archivo de script alphanet.sh,puede usar la opción --rpc-porten el comando deinicio como semenciona a continuación,especificandoelpuerto.
./alphanet.sh start [--rpc-port <int>] [OPTIONS]"
Inicie unnodo alphanet de Tezos completoen un contenedor acoplable "automáticamente generando unanuevaidentidad de red. "OPCIONES (excepto --rpc-port) sepasan directamente al "nodo de Tezos,consulte '$ 0 shelltezos-node config --help '"paramás detalles."Por defecto,elpuerto RPCnoes exportadofuera del contenedor docker ". ADVERTENCIA: cuando seexportan algunos Los RPCpodrían ser dañinos "(porejemplo,'inject_block','force_validation',...), se "recomiendanoexportarlospúblicamente".
To start rpc at 8732 port use
./alphanet.sh start --rpc-port 8732
As mentioned in alphanet.sh script file, you can use --rpc-port option in the start command as mentioned below, specifying the port.
./alphanet.sh start [--rpc-port <int>] [OPTIONS]"
Launch a full Tezos alphanet node in a docker container" automatically generating a new network identity." OPTIONS (others than --rpc-port) are directly passed to the" Tezos node, see '$0 shell tezos-node config --help'" for more details." By default, the RPC port is not exported outside the docker" container. WARNING: when exported some RPCs could be harmful" (e.g. 'inject_block', 'force_validation', ...), it is" advised not to export them publicly."
-
Como dijeen mi respuesta,generalmente serámás seguro usar `--rpc-port 127.0.0.1: 8732`,cuandoel RPCnonecesita ser accesible desdeningún otro host además del host de la ventana acoplable.As I said in my answer, it is generally going to be safer to use `--rpc-port 127.0.0.1:8732`, when the RPC need not be accessible from any other host besides the docker host.
- 1
- 2019-03-22
- Tom
Yo usonodos de Docker.CLIfuncionabien.pero cuando usoesto.nofunciona.en doc dice ---está deshabilitadopor defecto.perono sé cómo habilitar rpc conelnodo docker
Voy a Docker.encuentreel config.jsonpero 8732 o 18732nofuncionan. Yo uso ./alphanet.sh start dockernode