nitro-stack/stack-orchestrator/stacks/bridge
Adwait Gharpure e3a8b25850 Update nitro-node stack setup (#5)
* Rename service for nitro node

* Update nitro node setup

* Rename nitro-contracts image to nitro-client

* Fix nitro node config setup

* Add env variable for deterministic deployment

* Keep nitro-contracts service running

* Start nitro-bridge service after asset file is ready

* Update environment variables for all services

* Use quotes for bridge address

* Update nitro-node and bridge stack readme

* Fix nitro-node readme

---------

Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-authored-by: IshaVenikar <ishavenikar7@gmail.com>
2024-07-23 12:23:48 +05:30
..
README.md Update nitro-node stack setup (#5) 2024-07-23 12:23:48 +05:30
stack.yml Update nitro-node stack setup (#5) 2024-07-23 12:23:48 +05:30

bridge

Setup

  • Clone the stack repo:

    laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack
    
  • Clone required repositories:

    laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge setup-repositories
    
  • Build container images:

    laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge build-containers
    

Create a deployment

  • Create a spec file

    laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge deploy init --output bridge-spec.yml
    
  • TODO: Edit network in the spec file to map container ports to host ports as required:

    network:
    ports:
      go-nitro:
       - 3005:3005
       - 3006:3006
       - 4006:4006
    
  • Create deployment

    laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge deploy create --spec-file bridge-spec.yml --deployment-dir bridge-deployment
    

Configuration

  • Inside the bridge-deployment deployment directory, open config.env file and set following env variables:

    GETH_CHAIN_ID=1212
    
    OPTIMISM_CHAIN_ID=42069
    
    # URL endpoint of the L1 chain (Example: ws://host.docker.internal:8545)
    NITRO_L1_CHAIN_URL=
    
    # URL endpoint of the L2 chain (Example: ws://host.docker.internal:8546)
    NITRO_L2_CHAIN_URL=
    
    # Private key of the account on chain that is used for funding channels
    NITRO_CHAIN_PK: ${NITRO_CHAIN_PK}
    
    NITRO_SC_PK: ${NITRO_SC_PK}
    
    # Port to be used by P2P message service for L1
    NITRO_L1_MSG_PORT=3005
    
    # Port to be used by P2P message service for L2
    NITRO_L2_MSG_PORT=3006
    
    # Port to be used by RPC server
    NITRO_RPC_PORT=4006
    
    NITRO_PUBLIC_P2P_HOST=127.0.0.1
    
    NITRO_PUBLIC_RPC_HOST=nitro-bridge
    

Start the deployment

laconic-so deployment --dir bridge-deployment start