[Solved] Running node locally


#1

Hi,
hopefully this is the right category.

I want to run the node locally, because I want to see the log fille and perhaps I can change things by my own. To do so, checkout the source, compiled and started it. Now I have the first problem, i don’t know how to deploy a contract into Aeternity. After a look at forgae, it only deploys to localhost:3001 and not to localhost:3013 and I don’t want to change forgae.

Please, can you give me some information how to deploy to local running node and which tools you are using.

Thanks,
Ulf


#2

Hi @UlfA

You can easily adjust your aeternity node to fit your needs. Exactly for cases like this - configuration is exposed to an aeternity.yaml file. You can read about it here. You don’t need to set all the options but rather just the ones you need.

Ports

For example a minimal example for explicitly setting the ports will be:

http:
    external:
        port: 3013
    internal:
        port: 3113

Network ID

network_id is an network identifier unique per network. It is embeded in both the sync protocol and the signatures’ checks. Keep in mind that different Forgae environments use different network_id-s. In order for your contract to succesfully land on your node, both the Forgae and the node must use the same network_id. You can see the different network_id-s Forgae uses by default here. If you don’t want to change the Forgae but rather config the node, you shall put in your node’s aeternity.yaml:

fork_management:
    network_id: ae_devnet

Again - this will make your node not to sync with other nodes that have a different network_id, transactions signed with a different network_id will be invalid and etc.

Miner

If you’re to spin a node of your own with a side-chain of your own, you need a miner to include the transactions. The default settings of an empty node are for it not to be mining so you have to explicitly start it via the config. Since this is a side chain and you don’t really need to sync with either main net or UAT, you can play with the different variables to best fit your needs. An example of a faster miner config would be:

mining:
    # Start mining automatically.
    autostart: true
    # Expected mine rate (milliseconds) between blocks. Make it fast or make it slow :)
    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"
    cuckoo:
        miner:
            # 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

Again - expected_mine_rate and the edge bits size of the cuckoo graph both have impact on the consesus so a node will fail to sync with nodes with a different config.

You can see a list of example yaml files in here and check the json schema (with all the default values) here.

I think this shall be enough for you to start a node and have Forgae deploying contracts, but I might have missed something. If you encounter any issues, don’t hesitate to write bellow.