config.json ¿cómo definir la red?
1 respuesta
- votos
-
- 2019-07-31
Noesposible configurar la red en el archivo
config.json
.La red está codificada de algunamaneraen cada rama (
mainnet
,alphanet
,zeronet
) como cadanetwork viene con sus constantesespecíficas y unbloque degénesis (quebásicamente defineelidentificador de red). El archivoconfig.json
tiene como objetivo configurarel comportamiento de unnodo (puerto rpc,número de conexiones,modo historial,…)independientemente de la red con la queinteractúe.It is not possible to set the network in the
config.json
file.The network is somehow hard-coded on each branch (
mainnet
,alphanet
,zeronet
) as each network comes with its specific constants and a genesis block (which basically defines the network identifier). Theconfig.json
file aims to configure the behavior of a node (rpc port, number of connections, history mode, …) regardless of the network it interacts with.-
¿Podríasindicarme unafuente,cómo darme cuenta,qué quiero hacer?Miproblemaes quetengo unnodomainnet compilado y cada vez que quieroiniciarelnodo alphanet (cden el directorio alphanet),comienza a sincronizar lamainneten lugar de la alphanet.Could you point me to a source, how to realize, what i want to do? My problem is, i've an compiled mainnet node and everytime i want to start the alphanet node (cd into the alphanet dir) it starts to sync the mainnet instead the alphanet.
- 0
- 2019-07-31
- Blindripper
-
Primero,paraejecutaren diferentes redes,debeejecutar diferentesbinarios.(Estenoeselmismo `tezos-node` queproducemakeen la rama degit" alphanet "y"mainnet "del repositorio degitlab). Entonces,paraejecutar unnodo alphanet,debespagar y compilarbinarios desde alphanetrama. En segundo lugar,"bootstrappeers",lospeers a los que se conectaporprimera vez cuandoinicia unnodono son losmismosen mainnet y alphanet,por supuesto,por lo que siespecificamanualmente lospares debootstrapen su config.json,no debe usar lamisma configuración.jsonparaejecutar "alphanet" -tezos-node y "mainnet" -tezos-node ...First, To run on different networks, you have to run different binaries. (This is not the same `tezos-node` that is produced by make in the git branch "alphanet" and "mainnet" of the gitlab repo.) So to run an alphanet node, you have to checkout and compile binaries from the alphanet branch. Second, "bootstrap peers" the peers you first connect to when you launch a node aren't the same on mainnet and alphanet of course, so if you specify by hand bootstrap peers in your config.json, you mustn' use the same config.json to launch "alphanet"-tezos-node and "mainnet"-tezos-node...
- 1
- 2019-07-31
- Pierre Boutillier
-
Yopersonalmente uso unafunción degit llamada `worktree`.Lepermitepagar una ramaen un directorio determinado.Tendrá una carpetapara cada rama que desee.Luego,solonecesitaextraer/make/runen cada directorio.Si deseaejecutar variosnodosen lamismamáquina,no olvideespecificarpuertos diferentes,tantoparap2p comopara rpc,`listen_addr` y` data-dir`.I personally use a git feature called `worktree`. It allows you to checkout a branch in a given directory. You will have one folder for each branch you want. Then, you just need to pull/make/run in each directory. If you want to run several nodes on the same machine, do not forget to specify different ports, for both p2p and rpc `listen_addr`, and `data-dir`.
- 1
- 2019-07-31
- vect0r
-
He realizado unpago y compilado la rama alphanet ymainnet,tampoco he configuradoningúnpar de arranquepara ambos.Ambas ramasestánen carpetas diferentes.Peronoentiendopor qué ./tezos-node run (enel directorio alphanet) comienza a sincronizar la redprincipal.Quizásel listen_addr seaelproblema ... loprobaré y daré su opinión.chicos THX.I've done a checkout and compiled the alphanet and mainnet branch, i also haven't set any bootstrap peers for both. Both branches are in different folders. But i don't get why ./tezos-node run (in the alphanet dir) starts to sync the mainnet. Maybe the listen_addr is the problem... will try it and give feedback. thx guys.
- 0
- 2019-07-31
- Blindripper
-
@ vect0rme ayudó aencontrarelproblema.`gitbranch`me dio` * alphanet`pero `git log` apuntó a la rama`mainnet`. `git reset --hard origin/alphanet` y`make` resolvieronelproblema.@vect0r helped me to find the problem. `git branch`gave me `*alphanet`but `git log`pointed to the `mainnet` branch. `git reset --hard origin/alphanet`and `make`solved the problem.
- 1
- 2019-07-31
- Blindripper
Quieroejecutar variosnodosen unamáquina.¿Cómopuedo definir la red (
mainnet
,alphanet
,zeronet
)enconfig.json
?