Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/docker: add solana localnet #11574

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/docker/compose
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ex
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1

base_files="-f docker-compose.yaml -f docker-compose.postgres.yaml"
base_files="-f docker-compose.yaml -f docker-compose.postgres.yaml -f docker-compose.solana.yaml"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a custom logic based on $GETH_MODE, would it make sense to have the same for solana?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like $GETH_MODE toggle between go-ethereum vs. parity clients. AFAIK we don't have client variety on Solana, so we don't need an equivalent toggle.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant what happens if we want to run the node without Solana at all. Is the configuration supposed to be flexible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make it flexible. This setup predates multi-chain and non-evm support, and hasn't been updated with those in mind until now, so this is an open question.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the time, I just wanted a simpler way to test LOOP Plugins like Solana, without running CI integration tests.

# Allow for choosing between geth or parity
if [ $GETH_MODE ]; then
base_files="$base_files -f docker-compose.gethnet.yaml"
Expand Down
7 changes: 7 additions & 0 deletions tools/docker/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ MinContractPayment = '0.000001 link'
Name = 'primary-0-34055'
WSURL = 'ws://devnet:8546'
HTTPURL = 'http://devnet:8545'

[[Solana]]
ChainID = 'localnet'

[[Solana.Nodes]]
Name = 'sol-node'
URL = 'http://solana:8899'
20 changes: 20 additions & 0 deletions tools/docker/docker-compose.solana.yaml
Copy link
Collaborator

@pavel-raykov pavel-raykov May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running solana docker I get the following error "rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2". I am using my Macbook for testing - is there an agreement that the docker files should be cross-platform? (I think we need to add something along the lines of https://stackoverflow.com/questions/71040681/qemu-x86-64-could-not-open-lib64-ld-linux-x86-64-so-2-no-such-file-or-direc to fix the issue)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if we can make it cross-platform then we should.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.5'

services:
node:
depends_on:
- solana
node-2:
depends_on:
- solana
solana:
build: ../solana
container_name: solana
image: smartcontract/solana
ports:
- 8899
- 8900
volumes:
- solana-db-data:/solana/database
volumes:
solana-db-data:
4 changes: 4 additions & 0 deletions tools/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
restart: always
environment:
- CL_DATABASE_URL
# - CL_SOLANA_CMD=chainlink-solana
# - CL_MEDIAN_CMD=chainlink-median
Comment on lines +17 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabling loop plugins?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are disabled by default. This is leftover after I tried to enable them - but IIRC this is rigged up to build a different Dockerfile that doesn't have them yet. I will remove this or add them to that file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • TODO

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, "I will remove this or add them to that file." - has this been already done?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this has become stale, but I thought it might be a good reference for how things fit together in this sub dir.

Copy link
Collaborator

@pavel-raykov pavel-raykov May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, is it clear what happens if you uncomment these lines? Is expected behavior to build a different docker image and enable these plugins? If yes, could you please test it and describe this behavior in the comment above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are meant to enable LOOP Plugins. I expected it to "just work", because they are built in to the official docker image now (just disabled by default). However, something broken and I'm not sure what, because my explanation in the first comment seems wrong - the regular docker images are used 🤔

We should fix it, but it is orthogonal to running Solana, so it could be left out of this PR.

env_file:
- chainlink-variables.env
ports:
Expand All @@ -34,6 +36,8 @@ services:
restart: always
environment:
- CL_DATABASE_URL
# - CL_SOLANA_CMD=chainlink-solana
# - CL_MEDIAN_CMD=chainlink-median
env_file:
- chainlink-variables.env
ports:
Expand Down
8 changes: 8 additions & 0 deletions tools/solana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:20.04
WORKDIR /solana

ADD https://github.com/solana-labs/solana/releases/download/v1.16.23/solana-release-x86_64-unknown-linux-gnu.tar.bz2 .
RUN tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2
ENV PATH=/solana/solana-release/bin:$PATH

ENTRYPOINT [ "solana-test-validator" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, would you also want prefunding the CL node?

you should be able to do that with the solana airdop command

Loading