Sui Full Node Multi-threaded (Pool) Connection

Hey all, is it possible to connect to a local Sui node via a connection pool (similar to MySQL’s createPool vs createConnection)?

My particular use-case: I want to process hundreds of multi-threaded calls to my node. Instead of 100+ connections I’d just have 1 connection.

Today I am connecting to my node in Node.js using the following:

const sui = require('@mysten/sui.js');
const connection = new sui.Connection({
    fullnode: "<node-path>",
});
const node = new sui.JsonRpcProvider(connection);

Thanks

This is an old version of the @mysten/sui.js package. You should use the new one with the client.
If you are doing reads try the multiGetObject and multiGetTransactionBlock requests, if you are doing transactions you should leverage TransactionBlock to make as many calls as possible in a single transaction. Right now the only way to connect to a fullnode is the one provided by nodeJs.

1 Like

Which is the new version? The official docs points to the GitHub, which points to @mysten/sui.js:

I will give multiGetObject & multiGetTransactionBlock a go, thanks!