blockchains_api
v2.0.3
Published
API to save/read/validate data to/from/on any Blockchain!
Downloads
32
Readme
This API provides unified functions to store/read data on BTC/ETH blockchain. This API needs for proper work connection on PostrgreSQL databaze where a additional metadata about transactions and addresses are stored!
This is useable TEST version! That means the API works for now only on BTC/ETH testnet!
Still in development.
Example of usage:
const bc_api = require("blockchains_api")
let blockchain_api = new bc_api()
let db_credentials = {
host: 'localhost',
port: 5432,
database: 'db_name',
user: 'postgres',
password: '123'
};
await blockchain_api.connect_db(db_credentials);
eth_api = await blockchain_api.build_blockchain_connection
('eth','wss://authorization_connection_string_on_ropsten_node');
or
('btc', 'authorization_connection_string_on_btc_testnet_node');
// For sending transactions you have to create or import account/address. // After sending a transaction the reading functions can be used!