- Ensure you have docker installed on your Machine.
-
Clone the Sphinx Stack Repo here
git clone https://github.com/stakwork/sphinx-stack.git
-
Open a terminal inside the root directory of sphinx stack cloned on your machine and run the following command:
docker-compose -f ./alts/cln-proxy.yml --project-directory . up -d
The above command will pull images from Docker Hub and start up docker compose
Note: Please allow the following container to exit before you proceed
relaysetup-1
lndsetup-1
Please when next you want to run sphinx stack ensure you pull the current tribes image. Run the command below to pull tribes server latest image.
docker pull sphinxlightning/sphinx-tribes:latest
If you are using the Apple Silicon(M1), use the command below to pull tribes latest image
docker pull --platform linux/x86_64 sphinxlightning/sphinx-tribes:latest
-
Stop the Docker Compose if it's currently running.
-
Open your terminal in the root directory of Sphinx Stack.
-
Run the following command:
./clearall.sh
-
Proceed to run step 2 in the
Setup Sphinx Stack
section and don't forget to wait forrelaysetup
andlndsetup
to exit before you procced. -
Finally, rerun the steps outlined in the
Setup Frontend with Cypress
section
-
Go to the sphinx-stack folder, locate the
NODES.json
file located insphinx-stack/relay/NODES.json
and copy the content of the file. PS: the content should be an array of objects -
In your frontend folder locate the
cypres/fixtures
folder, create a new file callednodes.json
and paste the content you copied from the above step.
-
If this is your first time running this project, please open a terminal inside the root directory of this repository and run the command below:
yarn install
-
Use the command below to start the app.
yarn run start:cypress
-
Use the command below to run current cypress test.
yarn run cypress:run
-
If you will like to see Cypress run in a UI, run the command below:
npx cypress open
With the above commands executed properly you should be able to start writing your test in the cypress/e2e
folder.
-
To login as a user you can use the command below and pass in the name of the user you want to login as:
cy.login("alice")
-
To logout you can use the command below, also passing the user who want's to log out
cy.logout("alice")
-
To create a bounty, you can use the command below and pass in the bounty details as parameter:
cy.create_bounty({ title: 'My new Bounty', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', amount: '123', assign: 'carol', deliverables: 'We are good to go man', tribe: '', estimate_session_length: 'Less than 3 hour', estimate_completion_date: '09/09/2024' });
-
To create a workspace, you can use the command below and pass in the org details as Parameter:
cy.create_workspace({ loggedInAs: 'carol', name: 'New Workspace', description: 'We are testing out our workspace', website: 'https://community.sphinx.chat', github: 'https://github.com/stakwork/sphinx-tribes-frontend' });
-
To make payment you can use the command below and pass in details about the invoice:
cy.pay_invoice({payersName: "carol", invoice: invoice})
You can also checkout the cypress/support/commands.ts
file to get other custom made commands.
Please use the command below to stop sphinx stack:
docker-compose down
Running docker-compose down
instead of sending a SIGINT or SIGTERM is very important! Otherwise bitcoind
will not finish writing to its database, and on the next run LND
will crash with a block index mismatch.
You can also run with Docker Desktop and just use the "play" and "stop" buttons (and view the logs from each container).