Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7925

solana\web3.js Connect Timeout Error , How to set up a proxy?

$
0
0

I am in China and cannot access the solana devnet chain directly. How do I configure 'Connection' to use a local proxy

const connection = new Connection(clusterApiUrl('devnet'), { commitment: 'confirmed'});const feePayer = Keypair.fromSecretKey(    bs58.decode("ekD6Sg9Df******A45ef")  );(async () => {    console.log(clusterApiUrl('devnet'));    console.log('Public Key:', feePayer.publicKey.toString());    const airdropSignature = await connection.requestAirdrop(        feePayer.publicKey,        LAMPORTS_PER_SOL, // 1 SOL = 1,000,000,000 Lamports    );    const balance = await connection.getBalance(feePayer.publicKey);    console.log("balance (Lamports): ", balance);})();

enter image description here


Viewing all articles
Browse latest Browse all 7925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>