# Public API nodes

Permission.io hosts a public mainnet API node that exposes both JSONRPC and websocket protocols.

Both API types can be accessed via these urls:

https://blockchain-api-mainnet.permission.io/rpc
wss://blockchain-api-mainnet.permission.io/ws
1
2

# Connecting with web3.js

TIP

The Permission blockchain uses a Proof of Authority based consensus algorithm and leverages the go-ethereum codebase. Most Ethereum tools should work with a little bit of configuration.

yarn add web3
1
const Web3 = require('web3');
import { Block } from 'web3/eth/types'

const httpProvider = new Web3.providers.HttpProvider('https://blockchain-api-mainnet.permission.io/rpc', 2500);
const client = new Web3(httpProvider);

client.eth.getBlock('latest')
.then((block: Block) => {
	console.log(block);
});
1
2
3
4
5
6
7
8
9
10