Skip to content

Commit

Permalink
deps: add host.docker.internal for testing local light node (not docker)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcstein committed May 30, 2023
1 parent b5747c8 commit 09490fd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion op-celestia/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func main() {
}
fmt.Printf("celestia block height: %v; tx index: %v\n", height, index)
fmt.Println("-----------------------------------------")
client, err := cnc.NewClient("http://localhost:26659", cnc.WithTimeout(30*time.Second))
client, err := cnc.NewClient("http://host.docker.internal:26659", cnc.WithTimeout(30*time.Second))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion op-e2e/actions/l2_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type L2API interface {

func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, eng L2API, cfg *rollup.Config) *L2Verifier {
metrics := &testutils.TestDerivationMetrics{}
daCfg, err := rollup.NewDAConfig("http://localhost:26659", "e8e5f679bf7116cb")
daCfg, err := rollup.NewDAConfig("http://host.docker.internal:26659", "e8e5f679bf7116cb")
require.NoError(t, err)
pipeline := derive.NewDerivationPipeline(log, cfg, daCfg, l1, eng, metrics)
pipeline.Reset()
Expand Down
2 changes: 1 addition & 1 deletion op-node/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var (
DaRPC = cli.StringFlag{
Name: "da-rpc",
Usage: "Data Availability RPC",
Value: "http://da:26659",
Value: "http://host.docker.internal:26659",
EnvVar: prefixEnvVar("DA_RPC"),
}
NamespaceId = cli.StringFlag{
Expand Down
2 changes: 1 addition & 1 deletion ops-bedrock/docker-compose-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ services:
--metrics.port=7300
--pprof.enabled
--rpc.enable-admin
--da-rpc=http://da:26659
--da-rpc=http://host.docker.internal:26659
--namespace-id=e8e5f679bf7116cb
ports:
- "7545:8545"
Expand Down
35 changes: 16 additions & 19 deletions ops-bedrock/docker-compose-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ volumes:


services:
da:
container_name: celestia-light-node
user: root
platform: "${PLATFORM}"
image: "ghcr.io/celestiaorg/celestia-node:v0.11.0-rc1"
command: celestia light start --core.ip https://rpc-arabica-8.consensus.celestia-arabica.com/ --gateway --gateway.addr da --gateway.port 26659 --p2p.network arabica
environment:
- NODE_TYPE=light
- P2P_NETWORK=arabica
volumes:
- $HOME/.celestia-light-arabica-6/:/home/celestia/.celestia-light-arabica-6/
ports:
- "26657:26657"
- "26659:26659"

l1:
build:
Expand All @@ -37,6 +23,8 @@ services:
- "l1_data:/db"
- "${PWD}/../.devnet/genesis-l1.json:/genesis.json"
- "${PWD}/test-jwt-secret.txt:/config/test-jwt-secret.txt"
extra_hosts:
- "host.docker.internal:host-gateway"

l2:
build:
Expand All @@ -53,6 +41,8 @@ services:
- "/bin/sh"
- "/entrypoint.sh"
- "--authrpc.jwtsecret=/config/test-jwt-secret.txt"
extra_hosts:
- "host.docker.internal:host-gateway"

op-node:
depends_on:
Expand Down Expand Up @@ -85,7 +75,7 @@ services:
--metrics.port=7300
--pprof.enabled
--rpc.enable-admin
--da-rpc=http://da:26659
--da-rpc=http://host.docker.internal:26659
--namespace-id=e8e5f679bf7116cb
ports:
- "7545:8545"
Expand All @@ -98,6 +88,8 @@ services:
- "${PWD}/test-jwt-secret.txt:/config/test-jwt-secret.txt"
- "${PWD}/../.devnet/rollup.json:/rollup.json"
- op_log:/op_log
extra_hosts:
- "host.docker.internal:host-gateway"

op-proposer:
depends_on:
Expand All @@ -124,15 +116,16 @@ services:
OP_PROPOSER_METRICS_ENABLED: "true"
OP_PROPOSER_ALLOW_NON_FINALIZED: "false"
OP_PROPOSER_NAMESPACE_ID: "e8e5f679bf7116cb"
OP_PROPOSER_DA_RPC: http://da:26659
OP_PROPOSER_DA_RPC: http://host.docker.internal:26659
OP_PROPOSER_NETWORK_TIMEOUT: 180s
extra_hosts:
- "host.docker.internal:host-gateway"

op-batcher:
depends_on:
- l1
- l2
- op-node
- da
build:
context: ../
dockerfile: ./op-batcher/Dockerfile
Expand All @@ -141,7 +134,7 @@ services:
- "7301:7300"
- "6545:8545"
healthcheck:
test: ["CMD", "curl", "-f", "http://da:26659/header/1"]
test: ["CMD", "curl", "-f", "http://host.docker.internal:26659/header/1"]
interval: 5s
timeout: 5s
retries: 5
Expand All @@ -167,7 +160,9 @@ services:
OP_BATCHER_METRICS_ENABLED: "true"
OP_BATCHER_RPC_ENABLE_ADMIN: "true"
OP_BATCHER_NAMESPACE_ID: "e8e5f679bf7116cb"
OP_BATCHER_DA_RPC: http://da:26659
OP_BATCHER_DA_RPC: http://host.docker.internal:26659
extra_hosts:
- "host.docker.internal:host-gateway"

stateviz:
build:
Expand All @@ -182,3 +177,5 @@ services:
- "9090:8080"
volumes:
- op_log:/op_log:ro
extra_hosts:
- "host.docker.internal:host-gateway"

0 comments on commit 09490fd

Please sign in to comment.