generated from opentensor/bittensor-subnet-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
111 additions
and
1 deletion.
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
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,31 @@ | ||
# Use the official Golang image with version 1.22 | ||
FROM golang:1.22 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Install necessary tools | ||
RUN apt-get update && apt-get install -y git nodejs npm && \ | ||
npm install -g yarn | ||
|
||
# Clone the repository | ||
RUN git clone https://github.com/masa-finance/masa-oracle.git . | ||
|
||
# Build the node | ||
RUN go build -v -o masa-node ./cmd/masa-node | ||
|
||
# Install contract dependencies | ||
WORKDIR /app/contracts | ||
RUN yarn install | ||
|
||
WORKDIR /app | ||
|
||
# Copy the entrypoint script | ||
COPY docker/protocol/entrypoint.sh /app/entrypoint.sh | ||
RUN chmod +x /app/entrypoint.sh | ||
|
||
# Expose the port | ||
EXPOSE 8081 | ||
|
||
# Set the entry point | ||
ENTRYPOINT ["/app/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# Create .env file | ||
cat << EOF > /app/.env | ||
BOOTNODES=/ip4/35.223.224.220/udp/4001/quic-v1/p2p/16Uiu2HAmPxXXjR1XJEwckh6q1UStheMmGaGe8fyXdeRs3SejadSa,/ip4/34.121.111.128/udp/4001/quic-v1/p2p/16Uiu2HAmKULCxKgiQn1EcfKnq1Qam6psYLDTM99XsZFhr57wLadF | ||
API_KEY=${API_KEY:-} | ||
RPC_URL=${RPC_URL:-https://ethereum-sepolia.publicnode.com} | ||
ENV=${ENV:-test} | ||
FILE_PATH=${FILE_PATH:-.} | ||
VALIDATOR=${VALIDATOR:-false} | ||
PORT=${PORT:-8080} | ||
# AI LLM | ||
CLAUDE_API_KEY=${CLAUDE_API_KEY:-} | ||
CLAUDE_API_URL=${CLAUDE_API_URL:-https://api.anthropic.com/v1/messages} | ||
CLAUDE_API_VERSION=${CLAUDE_API_VERSION:-2023-06-01} | ||
ELAB_URL=${ELAB_URL:-https://api.elevenlabs.io/v1/text-to-speech/ErXwobaYiN019PkySvjV/stream} | ||
ELAB_KEY=${ELAB_KEY:-} | ||
OPENAI_API_KEY=${OPENAI_API_KEY:-} | ||
PROMPT=${PROMPT:-"You are a helpful assistant."} | ||
# X | ||
TWITTER_USER=${TWITTER_USER:-} | ||
TWITTER_PASS=${TWITTER_PASS:-} | ||
TWITTER_2FA_CODE=${TWITTER_2FA_CODE:-} | ||
# Worker node config | ||
TWITTER_SCRAPER=${TWITTER_SCRAPER:-true} | ||
DISCORD_SCRAPER=${DISCORD_SCRAPER:-true} | ||
WEB_SCRAPER=${WEB_SCRAPER:-true} | ||
EOF | ||
|
||
# Start the node | ||
if [ "$STAKE_AMOUNT" != "" ]; then | ||
echo "Staking $STAKE_AMOUNT MASA tokens..." | ||
./masa-node --stake $STAKE_AMOUNT | ||
echo "Staking completed. Restarting node..." | ||
fi | ||
|
||
./masa-node | ||
|
||
# Keep the container running | ||
tail -f /dev/null |