Skip to content

Commit

Permalink
Merge pull request #1945 from 0xRider/chore/more-specific-rpc-urls
Browse files Browse the repository at this point in the history
chore: more specific rpc urls
  • Loading branch information
shakkernerd authored Jan 7, 2025
2 parents 6e18209 + 0641d24 commit 7e0d7ea
Show file tree
Hide file tree
Showing 36 changed files with 42 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
BASE_MINT=So11111111111111111111111111111111111111112
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=

# Telegram Configuration
Expand Down Expand Up @@ -346,7 +346,7 @@ NEAR_WALLET_SECRET_KEY=
NEAR_WALLET_PUBLIC_KEY=
NEAR_ADDRESS=
SLIPPAGE=1
RPC_URL=https://rpc.testnet.near.org
NEAR_RPC_URL=https://rpc.testnet.near.org
NEAR_NETWORK=testnet # or mainnet

# ZKsync Era Configuration
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
## Telegram
Expand Down
2 changes: 1 addition & 1 deletion README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion README_PTBR.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion README_RO.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion README_RS.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
## Telegram
Expand Down
2 changes: 1 addition & 1 deletion README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ BIRDEYE_API_KEY= # API-ключ для BirdEye
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY= # API-ключ Helius
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- BIRDEYE_API_KEY=
- SOL_ADDRESS=So11111111111111111111111111111111111111112
- SLIPPAGE=1
- RPC_URL=https://api.mainnet-beta.solana.com
- SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
- HELIUS_API_KEY=
- SERVER_PORT=3000
- WALLET_SECRET_SALT=secret_salt
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/README_DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
## Telegram
Expand Down
2 changes: 1 addition & 1 deletion docs/README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/README_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/README_TH.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/advanced/eliza-in-tee.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ services:
- BIRDEYE_API_KEY=$BIRDEYE_API_KEY
- SOL_ADDRESS=So11111111111111111111111111111111111111112
- SLIPPAGE=1
- RPC_URL=https://api.mainnet-beta.solana.com
- SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
- HELIUS_API_KEY=$HELIUS_API_KEY
- SERVER_PORT=3000
- WALLET_SECRET_SALT=$WALLET_SECRET_SALT
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/_media/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/_media/README_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/_media/README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/_media/README_KOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
## Telegram
Expand Down
2 changes: 1 addition & 1 deletion packages/core/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ TEST_DATABASE_CLIENT=sqlite
NODE_ENV=test
MAIN_WALLET_ADDRESS=TEST_MAIN_WALLET_ADDRESS_VALUE
OPENAI_API_KEY=TEST_OPENAI_API_KEY_VALUE
RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
WALLET_PUBLIC_KEY=2weMjPLLybRMMva1fM3U31goWWrCpF59CHWNhnCJ9Vyh
2 changes: 1 addition & 1 deletion packages/plugin-near/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ NEAR_WALLET_SECRET_KEY=your-wallet-private-key
NEAR_WALLET_PUBLIC_KEY=your-wallet-public-key
NEAR_ADDRESS=your-account.near
NEAR_NETWORK=testnet # mainnet or testnet
RPC_URL=https://rpc.testnet.near.org
NEAR_RPC_URL=https://rpc.testnet.near.org
SLIPPAGE=0.01 # 1% slippage tolerance
```

Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-near/src/actions/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function swapToken(
const tokenOut = await ftGetTokenMetadata(outputTokenId);
const networkId = runtime.getSetting("NEAR_NETWORK") || "testnet";
const nodeUrl =
runtime.getSetting("RPC_URL") || "https://rpc.testnet.near.org";
runtime.getSetting("NEAR_RPC_URL") || "https://rpc.testnet.near.org";

// Get all pools for estimation
// ratedPools, unRatedPools,
Expand Down Expand Up @@ -257,7 +257,7 @@ export const executeSwap: Action = {
networkId: runtime.getSetting("NEAR_NETWORK") || "testnet",
keyStore,
nodeUrl:
runtime.getSetting("RPC_URL") ||
runtime.getSetting("NEAR_RPC_URL") ||
"https://rpc.testnet.near.org",
});

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-near/src/actions/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function transferNEAR(
): Promise<string> {
const networkId = runtime.getSetting("NEAR_NETWORK") || "testnet";
const nodeUrl =
runtime.getSetting("RPC_URL") || "https://rpc.testnet.near.org";
runtime.getSetting("NEAR_RPC_URL") || "https://rpc.testnet.near.org";
const accountId = runtime.getSetting("NEAR_ADDRESS");
const secretKey = runtime.getSetting("NEAR_WALLET_SECRET_KEY");

Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-near/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const nearEnvSchema = z.object({
NEAR_WALLET_PUBLIC_KEY: z.string().min(1, "Wallet public key is required"),
NEAR_ADDRESS: z.string().min(1, "Near address is required"),
SLIPPAGE: z.string().min(1, "Slippage is required"),
RPC_URL: z.string().min(1, "RPC URL is required"),
NEAR_RPC_URL: z.string().min(1, "RPC URL is required"),
networkId: z.string(),
nodeUrl: z.string(),
walletUrl: z.string(),
Expand Down Expand Up @@ -87,7 +87,7 @@ export async function validateNearConfig(
NEAR_ADDRESS:
runtime.getSetting("NEAR_ADDRESS") || process.env.NEAR_ADDRESS,
SLIPPAGE: runtime.getSetting("SLIPPAGE") || process.env.SLIPPAGE,
RPC_URL: runtime.getSetting("RPC_URL") || process.env.RPC_URL,
NEAR_RPC_URL: runtime.getSetting("NEAR_RPC_URL") || process.env.NEAR_RPC_URL,
...envConfig, // Spread the environment-specific config
};

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-solana-agentkit/src/actions/createToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default {

elizaLogger.log("Init solana agent kit...");
const solanaPrivatekey = runtime.getSetting("SOLANA_PRIVATE_KEY");
const rpc = runtime.getSetting("RPC_URL");
const rpc = runtime.getSetting("SOLANA_RPC_URL");
const openAIKey = runtime.getSetting("OPENAI_API_KEY");
const solanaAgentKit = new SolanaAgentKit(
solanaPrivatekey,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-solana/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const solanaEnvSchema = {
WALLET_PUBLIC_KEY: string,
SOL_ADDRESS: string,
SLIPPAGE: string,
RPC_URL: string,
SOLANA_RPC_URL: string,
HELIUS_API_KEY: string,
BIRDEYE_API_KEY: string,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-solana/src/actions/swapDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const executeSwapForDAO: Action = {

try {
const connection = new Connection(
runtime.getSetting("RPC_URL") as string
runtime.getSetting("SOLANA_RPC_URL") as string
);

const { keypair: authority } = await getWalletKey(runtime, true);
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-solana/src/actions/swapUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { settings } from "@elizaos/core";
const solAddress = settings.SOL_ADDRESS;
const SLIPPAGE = settings.SLIPPAGE;
const connection = new Connection(
settings.RPC_URL || "https://api.mainnet-beta.solana.com"
settings.SOLANA_RPC_URL || "https://api.mainnet-beta.solana.com"
);
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-solana/src/actions/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default {
true
);

const connection = new Connection(settings.RPC_URL!);
const connection = new Connection(settings.SOLANA_RPC_URL!);

const mintPubkey = new PublicKey(content.tokenAddress);
const recipientPubkey = new PublicKey(content.recipient);
Expand Down
6 changes: 4 additions & 2 deletions packages/plugin-solana/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const solanaEnvSchema = z
z.object({
SOL_ADDRESS: z.string().min(1, "SOL address is required"),
SLIPPAGE: z.string().min(1, "Slippage is required"),
RPC_URL: z.string().min(1, "RPC URL is required"),
SOLANA_RPC_URL: z.string().min(1, "RPC URL is required"),
HELIUS_API_KEY: z.string().min(1, "Helius API key is required"),
BIRDEYE_API_KEY: z.string().min(1, "Birdeye API key is required"),
})
Expand All @@ -52,7 +52,9 @@ export async function validateSolanaConfig(
SOL_ADDRESS:
runtime.getSetting("SOL_ADDRESS") || process.env.SOL_ADDRESS,
SLIPPAGE: runtime.getSetting("SLIPPAGE") || process.env.SLIPPAGE,
RPC_URL: runtime.getSetting("RPC_URL") || process.env.RPC_URL,
SOLANA_RPC_URL:
runtime.getSetting("SOLANA_RPC_URL") ||
process.env.SOLANA_RPC_URL,
HELIUS_API_KEY:
runtime.getSetting("HELIUS_API_KEY") ||
process.env.HELIUS_API_KEY,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-solana/src/evaluators/trust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) {
// create the wallet provider and token provider
const walletProvider = new WalletProvider(
new Connection(
runtime.getSetting("RPC_URL") ||
runtime.getSetting("SOLANA_RPC_URL") ||
"https://api.mainnet-beta.solana.com"
),
publicKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class SimulationSellingService {
constructor(runtime: IAgentRuntime, trustScoreDb: TrustScoreDatabase) {
this.trustScoreDb = trustScoreDb;

this.connection = new Connection(runtime.getSetting("RPC_URL"));
this.connection = new Connection(runtime.getSetting("SOLANA_RPC_URL"));
this.baseMint = new PublicKey(
runtime.getSetting("BASE_MINT") ||
"So11111111111111111111111111111111111111112"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-solana/src/providers/trustScoreProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class TrustScoreManager {
) {
this.tokenProvider = tokenProvider;
this.trustScoreDb = trustScoreDb;
this.connection = new Connection(runtime.getSetting("RPC_URL"));
this.connection = new Connection(runtime.getSetting("SOLANA_RPC_URL"));
this.baseMint = new PublicKey(
runtime.getSetting("BASE_MINT") ||
"So11111111111111111111111111111111111111112"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-solana/src/providers/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ const walletProvider: Provider = {
const { publicKey } = await getWalletKey(runtime, false);

const connection = new Connection(
runtime.getSetting("RPC_URL") || PROVIDER_CONFIG.DEFAULT_RPC
runtime.getSetting("SOLANA_RPC_URL") || PROVIDER_CONFIG.DEFAULT_RPC
);

const provider = new WalletProvider(connection, publicKey);
Expand Down

0 comments on commit 7e0d7ea

Please sign in to comment.