Skip to main content

Connect to local devnet

Run a chain on your laptop before touching public testnet. Full node setup: Run a local devnet.

Start the node

./safrodevnet/scripts/bootstrap.sh

Endpoints: Local devnet endpoints.

Constants

export const RPC = 'http://127.0.0.1:26657';
export const REST = 'http://127.0.0.1:1317';
export const CHAIN_ID = 'safro-devnet-1';
export const DENOM = 'usaf';

Query and send

import { StargateClient } from '@cosmjs/stargate';
import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing';
import { SigningStargateClient } from '@cosmjs/stargate';

const client = await StargateClient.connect(RPC);
console.log(await client.getChainId()); // safro-devnet-1

// Dev key from bootstrap (test keyring) — local only
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(process.env.DEV_MNEMONIC!, {
prefix: 'addr_safro',
});
const signing = await SigningStargateClient.connectWithSigner(RPC, wallet, {
gasPrice: { denom: 'usaf', amount: '0.05' },
});

SafHandle on devnet

  1. Deploy safhandle-contract to your local node
  2. Pass the contract address to the client:
const safHandle = new SafHandle({
rpcUrl: RPC,
contractAddress: 'addr_safro1...', // your local instantiate address
});

Then follow Resolve and Register.

vs public testnet

Local devnetsafro-testnet-1
FaucetGenesis-funded dev keyfaucet.safrochain.com
IBCNot availableNoble, Osmosis
ExplorerQuery via REST onlyexplorer.safrochain.com

Next