testnet-ops/nitro-node-setup
2024-09-03 14:47:04 +05:30
..
templates Add playbooks to setup and run nitro node 2024-09-03 14:47:04 +05:30
nitro-vars-example.yml Add playbooks to setup and run nitro node 2024-09-03 14:47:04 +05:30
README.md Add playbooks to setup and run nitro node 2024-09-03 14:47:04 +05:30
run-nitro-node.yml Add playbooks to setup and run nitro node 2024-09-03 14:47:04 +05:30
setup-vars.yml Add playbooks to setup and run nitro node 2024-09-03 14:47:04 +05:30

nitro-node-setup

Setup Ansible

To get started, follow the installation guide to setup ansible on your machine

Run a nitro node

The following commands have to be executed in nitro-node-setup directory

  • Copy the nitro-vars-example.yml vars file

    cp nitro-vars-example.yml nitro-vars.yml
    
  • Edit nitro-vars.yml and fill in the following values

    # URL endpoint of the L1 chain
    l1_nitro_chain_url: ""
    
    # URL endpoint of the L2 chain
    l2_nitro_chain_url: ""
    
    # Private key for your nitro address
    nitro_sc_pk: ""
    
    # Private key of the account on chain that is used for funding channels in Nitro node
    nitro_chain_pk: ""
    
    # Contract address of NitroAdjudicator
    na_address: ""
    
    # Contract address of VirtualPaymentApp
    vpa_address: ""
    
    # Contract address of ConsensusApp
    ca_address: ""
    
    # Address of the bridge node
    bridge_contract_address: ""
    
    # Multi address of the bridge node
    nitro_bridge_multiaddr ""
    
    # Multi address of your nitro node
    nitro_node_multiaddr: ""
    
  • To run a nitro node, execute the run-nitro-node.yml Ansible playbook by running the following command.

    NOTE: By default, deployments are created in the nitro-node-setup/out directory. If you need to change this location, you can update the nitro_directory variable in the setup-vars.yml file.

    LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-node.yml --extra-vars='{ "target_host": "localhost"}' --user $USER
    
    • If you want to skip building the containers, set "skip_container_build" : true in the --extra-vars parameter:

      LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-node.yml --extra-vars='{ "target_host": "localhost", "skip_container_build": true }' --user $USER
      
  • Follow steps from Demo to create mirror channels on L2, create virtual channel and make payments