-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit * update * Add resubscription
- Loading branch information
Showing
6 changed files
with
166 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,5 @@ settings.json | |
c_cpp_properties.json | ||
*.log | ||
|
||
gcp-credentials.json | ||
# disable for testign | ||
# gcp-credentials.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Use an official Golang image as a base image | ||
FROM golang:1.22-alpine AS builder | ||
|
||
# Install necessary dependencies | ||
RUN apk add --no-cache git make bash curl | ||
|
||
# Set the working directory for IPFS Kubo | ||
WORKDIR /go/src/ipfs-kubo | ||
|
||
# Clone the IPFS Kubo repository | ||
RUN git clone https://github.com/ipfs/kubo.git . | ||
|
||
# Checkout the specific version v0.29.0 | ||
RUN git checkout v0.29.0 | ||
|
||
# Build IPFS Kubo | ||
RUN make build | ||
|
||
# Set the working directory for the light-client | ||
WORKDIR /go/src/light-client | ||
|
||
RUN apk add --no-cache gcc musl-dev | ||
|
||
# Clone the light-client repository | ||
COPY . . | ||
|
||
# Initialize submodules | ||
RUN git submodule update --init --recursive | ||
|
||
# Build the light-client | ||
RUN make build-light | ||
|
||
# Create a minimal runtime image | ||
FROM alpine:latest | ||
|
||
# Copy the built IPFS Kubo binary | ||
COPY --from=builder /go/src/ipfs-kubo/cmd/ipfs/ipfs /usr/local/bin/ipfs | ||
|
||
# Copy the built light-client binary | ||
COPY --from=builder /go/src/light-client/bin/light-client /usr/local/bin/light-client | ||
|
||
# Copy the GCP credentials file | ||
COPY --from=builder /go/src/light-client/test/data/gcp-credentials.json /gcp-credentials.json | ||
|
||
# Copy trusted setup files | ||
COPY --from=builder /go/src/light-client/test/data/trusted_setup.txt /root/.pinner/trusted_setup.txt | ||
|
||
# Expose the default IPFS port | ||
EXPOSE 4001 | ||
|
||
# Expose the default IPFS API port | ||
EXPOSE 5001 | ||
|
||
# Expose the default IPFS Gateway port | ||
EXPOSE 8080 | ||
|
||
# Initialize IPFS | ||
RUN ipfs init | ||
|
||
# Copy the entrypoint script | ||
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh | ||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
|
||
# Set the entrypoint for the container | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# Check if CLIENT_ID is set; if not, exit with an error | ||
if [ -z "$CLIENT_ID" ]; then | ||
echo "Error: CLIENT_ID environment variable is not set." | ||
exit 1 | ||
fi | ||
|
||
# Start IPFS daemon in the background | ||
ipfs daemon --enable-gc=true & | ||
|
||
# Wait for IPFS daemon to start | ||
until netstat -an | grep 'LISTEN' | grep ':5001'; do | ||
printf '.' | ||
sleep 1 | ||
done | ||
|
||
# Start light-client with the provided and hardcoded arguments | ||
light-client \ | ||
--loglevel debug \ | ||
--rpc-url wss://moonbase-alpha.blastapi.io/618fd77b-a090-457b-b08a-373398006a5e \ | ||
--contract 0x916B54696A70588a716F899bE1e8f2A5fFd5f135 \ | ||
--topic-id DAS-TO-BQ \ | ||
--gcp-creds-file /gcp-credentials.json \ | ||
--client-id "$CLIENT_ID" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"type": "service_account", | ||
"project_id": "covalent-network-team-sandbox", | ||
"private_key_id": "78c57ca75a6e0b75109830277d1a839da4d7a734", | ||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDftv6m5FOyUIkR\nRFGQTDlJ++D1HbkUcMxP2d+69imEO1+MX+LLF8+hKNbz46EtWBenXHGmVxcozrWJ\nK3n0qwUTL1B4T3aVRy5Ougn+ic8jSSe96zoC0QDNHC/KAoa/Omwew6JNQpHC+hEc\nYI9x40Qioic7WKGEYc5ASmrLLtjcRftduZ1F4F5mP8U1YcDCDHTyXTVWiFJ5XaeG\nQg+a/aiRNFeiZ75PBCWXTDoHzZMrXfCGXhB3v27ycbS4x5pxuwx0zTmtPyImPffq\nTpj/3ITGsGQJ4tMZHz6xnRrQM/wkA/3gzhGZwF52UGzphxV4BjQp5PGOIlR6Cx63\nLsRPuYJXAgMBAAECggEAZfW0GAImNzXHUqxNdDOZRKPcgjqauLs0EwyckExS3aZl\nxMeKyL9AbRX86ckME2t71FYoogQ9VObpC+xZt+4d8QF2bm7g/+YiL9VQascKNe3I\nhCFqHhB9if3XtfzyxsLsthS5qva1EiUAmWtU1TYcPqCiusSJUJl29Aw2ogXm5nTQ\nQY800WOU3UZ20rIugpQh4epriQeMK8cVmY95M+3+w9rt8uT4LL53tueBtOvV0AtW\ns2KslH/LAT76QK+hyeHFvinjjwUJ95ndYrrPwRHOKT4dqeWnCFG8p+pP0DAr1SDH\nyGBkThOL/OQOX8RDZwVQmAfqr7Uu7WOqKyAZ7YJwiQKBgQD9B+WVg9CQurMrfTp5\n+ikkOSb7JscvL4+cTpZj7r3nEs6M9lLYT9B54ZKu1rU3oxXnX0m9uzg3v2Jop23t\n5A7G8Ofwwdt5slJ6qj52ZJxntNdlzWvDNI2RftfZMA9jFrP/Ebsjg0BcgEMBHOWQ\nTsc0kiFbVswuX+RWrjX0sFbJKwKBgQDiVwhixj/ZUaoz+XiceSso+M3kPmJPKvTd\nuhdY2aNZxY3/sUJSpp4XBWnu6t7KQB1C4z0WBQrMVJAg5lWq3E4KDUVbWyE1g3Fm\nHwnHtLwuj+4AN0bt5sYR35mkX6GInFg5WrlyCg56lQ6Ic/Ge+30+GK5Vbtm2jrEM\ndQwAILt9hQKBgQC5mrZMw2EVGO5eg0CGwvq0yHuQlPRc521XgcoNSc3hF0mN2w4Q\nABPzo4SeXX6Wbjmd+6ay1wc41VlRXSdk7fns8j+gugLNNQINWp3w6IJWDDBIS7O1\nf/IsfLfGZ9uRmtCz1ITKWve2IpuD0HeQMEkthdeUEYo6pjpvXuDTORqf+wKBgQCy\nYSkov1meqi/bmmcl2pDbT4rksQ3FmvM0s+6mhY+ptnp843SDsvCw8AFW3CANgY4O\nIw0Hh53E/3g/lYg6ijmuzlq07xMzG46Jjzij/Zq5j5Fg9i+eWtwLRg/Obdfe1Gjr\nesbgS3CxxzuW6tmoFEfWYpkyl5RZvgdm6/AzQZjCCQKBgQD0ZJuKkPaQ7iDOnKOq\n1V877XiuvglGCy024sqhh7Iy8V+HJ2kxjGjYq8FZLbOVVdqf8IP7OKu3rR4RnJEl\n42s981p0UfcI0KSO85h/+c3jZ4/la17FCgeQo2YkIri/KKy7scqT+1dryzhPCj1k\ncM4BjiW2kw6Zzb+PSe2mzYOARg==\n-----END PRIVATE KEY-----\n", | ||
"client_email": "das-ligent-clients-pub-sub@covalent-network-team-sandbox.iam.gserviceaccount.com", | ||
"client_id": "102608612746177537483", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/das-ligent-clients-pub-sub%40covalent-network-team-sandbox.iam.gserviceaccount.com", | ||
"universe_domain": "googleapis.com" | ||
} |