indra
Everything you need to set up a Hub.
How to use this repository
The master
branch contains deployment scripts in the ./kernel
directory, while the ./contracts
directory contains the ChannelManager contract designed to work with the hub for local development.
Starting the hub
Prerequisites
tl;dr
- Start the Hub. The Hub will use localhost:3000.
- Install dependencies:
npm i
- Install Truffle:
npm i -g truffle
- Install and run Ganache CLI:
npm i -g ganache-cli
andganache-cli -m "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat" -i 4447 -b 3
- Migrate contracts:
truffle migrate --reset --network development
- Match CONTRACT_ADDRESS, ETH_NETWORK_ID, and HUB_ACCOUNT in
kernel/deploy.prod.sh
to your targeted blockchain. - Deploy the Docker stack with
npm run hub-start
- Install dependencies:
Detailed Steps
- For Ganache: Start Ganache on your host machine.
ganache-cli -m "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat" -i 4447 -b 3
- Migrate the contracts to your local blockchain.
truffle migrate --reset --network development
-
For Rinkeby/testnet: Start a node on your computer and migrate the contracts. Make sure to change the above mentioned variables to match your targeted blockchain.
-
Verify
kernel/deploy.prod.sh
to make sure the variables CONTRACT_ADDRESS, ETH_NETWORK_ID, and HUB_ACCOUNT match your targeted blockchain. If you are using Ganache with the above command, it will be set up for this by default. -
Deploy the Docker stack.
npm run hub-start
- Once the wake-up process completes, view the logs.
npm run logs-hub
npm run logs-chainsaw
- If you can't see logs, try the following to further debug.
docker service ps --no-trunc connext_hub
docker service ps --no-trunc connext_chainsaw
- Check that the hub is up by polling localhost:3000
curl http://localhost:3000
- Connect to the database to execute manual queries
npm run db