Aeproject Improvements from Core team

Hey all,

On our last meetup in Bulgaria, we have discussed one improvement of aeproject that needs the help of the core team.

Currently, time executing tests and make interactions with smart contracts and the blockchain on local machines with local test nodes takes too much time. We would like to make this process faster and smoother for our users.

We would like to achieve two main things:

  • Immediate mining - we need to reduce the time for executing transactions dramatically.
  • At least 10 built-in funded accounts, that will be available when starting the node.

The bottlenecks are for the users and for our team as well.

If there are volunteers, we can discuss this further and we can include them into our grant application or help to create a separate grant application for this work.



this should already be possible using the current software, look at configuration regarding the genesis/hardfork accounts

This was tried together with Dincho and Dimitar, and we couldn’t make it work. The accounts were not present, but we will try again once we submit the proposal

@martingrigorov.chain regarding Philipp’s point: you only need to setup whatever accounts you need in the local initial accounts_test.json. It works for our tests for sure :smiley:

1 Like

As I said, we have tried this, (I think I still have the code ) but it didn’t work. We tried this on the meetup in Sofia. Please excuse me if you were not part of it, it was long time ago.

Still if we change this in our local file, wouldn’t that mean that once we update the new version of the node we should make this change again?

What is your mining setup in your aeternity.json?

Do you use docker images of the node or do you build it yourself?

We use the docker images

I will try something and possibly get a solution for accounts you’d need tomorrow.

Regarding the fast mining: currently you can set up your node to mine a new keyblock every few microseconds. Isn’t this fast enough? My concern with instant mining would be that the chain is to grow really fast and you would not have any control over it. Do you want some functionalities for starting or stopping mining?

For now we don’t believe it would be needed, once we stop the local node everything would start from scratch.

We can try to setup the node to mine keyblock on a few seconds and try to tell what would be the difference.

This is a snippet from my personal aeternity.yaml:

    # Start mining automatically.
    autostart: true
    # Expected mine rate (milliseconds) between blocks. Make it fast :)
    expected_mine_rate: 100
    # Public key of beneficiary account that will receive fees from mining on a node. This doesn't really matter for the test, as long as it is a valid address
    beneficiary: "ak_2df9FTmhbcQ1huwEBTV1s8WkJ9xhTb3eM6yn9pqopGj7bZmoXF"
            # Use the fast executable binary of the miner.
            executable: mean15-generic
            # Extra arguments to pass to the miner executable binary.
            extra_args: "-t 1"
            # Use the smaller graph for faster mining
            edge_bits: 15

Note that it defines using the mean executable, smaller graph and that it expects a new keyblock to be mined every 100ms. That makes 10 keyblocks per second, which is really fast and should do it for most cases :smiley:


In a test scenario it would probably be good to be able to control the mining, typically you’d like to be able to run scenarios where you do a couple of TXs at the same height/in the same microblock and then you need X key blocks until you do the next couple of TXs… Also the mining as is would consume CPU-cycles so there is room for improvement.

I can also confirm that loading accounts into data/aecore/.genesis/accounts_test.json works just fine.


@martingrigorov.chain an example how you can setup a docker image with a custom accounts_test.json and a custom aeternity.yaml:

$ cat docker-compose.yml 
version: '3'
    image: aeternity/aeternity:${NODE_REF:-master}
      - "3013:3013"
      - "3014:3014"
      - "3015:3015"
      - "3113:3113"
      - "./test/accounts_test.json:/home/aeternity/node/data/aecore/.genesis/accounts_test.json"
      - "${NODE_CONFIGURATION:-./test/aeternity_node_fast_test_config.yml}:/home/aeternity/node/aeternity.yaml"

This is working as it is being used by AE channel service (kudos to @aleksandar.chain and @Arthur).

Note that this requires having locally:

  • ./test/accounts_test.json where you put your accounts
  • ./test/aeternity_node_fast_test_config.yml where you put your fast mining config

If you use different local files, you can rename them in your docker-compose.yaml respectively.