
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
simple-postchain
Advanced tools
Initializing a client can be done in different ways. During development when the BRID is likely to change all the time, then it is convenient to not have to specify BRID.
The client will then fetch the BRID from the chain with id 0. If you need a different chain, then you can specify that too.
import { BlockchainClient } from "simple-postchain";
// Initialize a client by Blockchain RID (BRID)
const client = BlockchainClient.initializeByBrid('http://127.0.0.1:7740', '898C57DA662CE388FDA9C2DACB1FEA2D983B3097E83FFD68F51E959B6A4BCD0B');
// Initialize a client by chainId
const client2 = BlockchainClient.initializeByChainId('http://127.0.0.1:7740', 1);
// Initialize without BRID or chainId
const client3 = BlockchainClient.initialize('http://127.0.0.1:7740');
Querying is done via BlockchainClient. You can add 0..* parameters to the query.
const data = await client.query<string>()
.name('say_hello')
.addParameter('name', 'Viktor')
.send();
Transactions are sent via the BlockchainClient as well.
Multiple operations can be added to the transaction, simply chain additional addOperations.
// A KeyPair is required to sign the transaction.
// If you don't have one, it can be created with the client.
const user = client.createKeyPair();
await client
.transaction()
.addOperation('create_account', user1.publicKey)
.sign(user)
.send();
Each transaction must be unique, if you for some reason need to send an equal transaction again, you can add a nop operation.
await client
.transaction()
.addOperation('create_account', user1.publicKey)
.addNop()
.sign(user)
.send();
FAQs
Helper library for communicating with a postchain node
We found that simple-postchain demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.