Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

make config pieces JSON compliant / (FR) allow to change spec parameters #60

Closed
drandreaskrueger opened this issue Sep 11, 2018 · 6 comments
Assignees

Comments

@drandreaskrueger
Copy link

I cannot get past this:

jq '.genesis.gasLimit = "0x2625A00"' config/spec/genesis/aura

and I suppose that is because the file looks like this:

    "genesis": {
        "seal": {
            "authorityRound": {
                "step": "0x0",
                "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
            }
        },
        "difficulty": "0x20000",
        "gasLimit": "0x1312D00"
    },

and not like this

{   "genesis": {
        "seal": {
            "authorityRound": {
                "step": "0x0",
                "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
            }
        },
        "difficulty": "0x20000",
        "gasLimit": "0x1312D00"
    }}

Could you perhaps in a future version make the separate config pieces JSON compliant? Then parameters are easier to change:

jq '.genesis.gasLimit = "0x2625A00"' ~/tmp.txt 
{
  "genesis": {
    "seal": {
      "authorityRound": {
        "step": "0x0",
        "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
    "difficulty": "0x20000",
    "gasLimit": "0x2625A00"
  }
}


And/or:

(How) can I change the genesis parameter on the commandline

DEPLOYARGS="--nodes 4 --config aura --name myaura"
NODEARGS="--geth --jsonrpc-server-threads 10 --tx-queue-size 20000 --cache-size 4096 --gas-floor-target 40000000 --tx-queue-mem-limit 0"
./parity-deploy.sh $DEPLOYARGS $NODEARGS 

perhaps like this?

SPEC='.genesis.gasLimit = "0x2625A00"'
./parity-deploy.sh $DEPLOYARGS --spec $SPEC $NODEARGS 
@drandreaskrueger
Copy link
Author

Thx!

Great tool.

@drandreaskrueger
Copy link
Author

My workaround for now:

sed -i 's/0x1312D00/0x2625A00/g' config/spec/genesis/aura

though not elegant nor universal

@ddorgan
Copy link
Collaborator

ddorgan commented Sep 11, 2018

They're intended to be either 1) templated or 2) using a command line option that already exists in the parity cli since they can be added to the end of the command.

@ddorgan ddorgan self-assigned this Sep 11, 2018
@drandreaskrueger
Copy link
Author

drandreaskrueger commented Sep 19, 2018

Have a look at this: https://gitlab.com/electronDLT/chainhammer/blob/master/parity.md#run-13

To change the blocktime on the fly, I am using jq to directly manipulate the spec.json AFTER having called ./parity-deploy.sh ...

(AFTER because BEFORE ... the template which contains stepDuration (config/spec/engine/aura) ... is not JSON compliant - so jq does not work).

sudo apt install jq
jq ".engine.authorityRound.params.stepDuration = 5" deployment/chain/spec.json > tmp; mv tmp deployment/chain/spec.json

As there is no commandline switch (or is there?) that case could only fall under "1) templated" - right?

@ddorgan
Copy link
Collaborator

ddorgan commented Oct 21, 2018

You can also use the custom_chain.toml which is a chain spec and node config within one file. There's example in the customchain directory.

For any additional arguments just add it to the end of the ./parity-deploy.sh command and it will be used on all containers.

@ddorgan ddorgan closed this as completed Oct 21, 2018
@drandreaskrueger
Copy link
Author

--config custom_chain.toml

ah, nice one. I had overlooked that until now. Might try. But my tweaking of deployment/chain/spec.json after running parity-deploy.sh ... does the trick actually. I only just want to change small pieces, like "gasLimit": "20000000"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants