freddiecoleman / chia-client Goto Github PK
View Code? Open in Web Editor NEWTypeScript client for Chia RPC interfaces.
Home Page: https://www.chiaexplorer.com/
License: MIT License
TypeScript client for Chia RPC interfaces.
Home Page: https://www.chiaexplorer.com/
License: MIT License
Hi!
getBlockchainState() does work ...
but as soon as I try
fullNode.getUnspentCoins({
puzzleHash: '<any puzzle hash>',
startHeight: 10000,
endHeight: 50000
}).then((value) => {
console.log("getUnspentCoins result:", value);
}).catch((e) => {
console.error("getUnspentCoins error:", e)
})
it returns:
getUnspentCoins result: { error: ''dict' object has no attribute 'startswith'',
success: false }
while checking the same puzzle hash with CURL works
curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -H "Content-Type: application/json" -X POST https://localhost:8555/get_coin_records_by_puzzle_hash -d '{"puzzle_hash": "< some puzzle hash >", "start_height": 350000, "include_spend_coins":false}' | python3 -m json.tool
any idea what I'm doing wrong?
coinID == sha256(parent_ID + puzzlehash + amount)
I found it from https://chialisp.com/docs/doc2
I tried it with Nodejs and still not correct.
console.log(CryptoJS.SHA256('f7e09a94c5da73019577b288aeedaf4750540ecca091bb5c4bcf45dacb3a0485' + 'ee12091f293040e42999c64d471ec9a65692f1dde0c42a4936d80e25a8d0535c' + 299700000000).toString()) // return e8ad8111fd2761792b9b39a531117ca8edcbc4ba65b2c3d9472c63dd76876731 not matched 6dddefd62523efccacf35e0cac24cc5348dde8f40ae48be1c563a9404e8251fe
So what the type of these params are?
Can someone provide any examples? Thank you.
For using ts-node
Instead of
console.log(await blockChainState.blockchain_state.space);
call with .then to prevent Promise { <pending> }
console.log(blockchain)
blockchain.then(function(fullNode) {
console.log(fullNode)
})
This currently only provides an interface for a full node. There are more RPCs to support.
use sendTransaction,
return transaction_id: 0x8a617e99692bbdc18db9fc27781f539b753d5d396e3d868008f81e3e95d089e7,
but explorer is:
https://www.chiaexplorer.com/blockchain/coin/0x45f56e6c91933b81ab464f552c39b3b306c040368f03b654debcbd2799538ca2
why? How to solve it.
This could use better documentation to help new people see how to use it.
I have tried all npm command but not able to run it client.
Hello,
I need to get the wallet balance without using cert .
(node:26220) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:26220) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I try to set up a CHIA local testnet blockchain. (testnet7)
Could you give me some idea to set up this lib interact with testnet.
Many thanks.
My issue below:
Error: ENOENT: no such file or directory, open '/home/caodb/.chia/mainnet/config/config.yaml'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Object.exports.getChiaConfig (/home/caodb/CaoDinh/projects/CHIA/chia-client-test/node_modules/chia-client/dist/src/ChiaNodeUtils.js:17:30)
at Object. (/home/caodb/CaoDinh/projects/CHIA/chia-client-test/node_modules/chia-client/dist/src/FullNode.js:6:36)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
It would be nice to compile into a separate folder such as dist
and update package.json
to point to the new index.
The getNextAddress method has no return value
"New_address" is missing from the request parameter
How to make a convertion between puzzle_hash and address?
Can it be provided as a tool in chia-client please?
thank you.
Hey there, I was wondering if you ran the Chia Explorer or knew who did, since I have a very simple feature suggestion for the explorer (has to do with an improvement to the miscellaneous transaction label) and haven't found any contact information on the website. Thanks!
currently chia is desktop wallet, cant't remote mining and manage it.
Are there any good tools to use?
The JS code:
const wallet = new Wallet({
protocol: 'https',
hostname: '47.241.90.20',
port: 9256,
caCertPath: './xch_ssh/private_ca.crt',
certPath: './xch_ssh/private_daemon.crt',
keyPath: './xch_ssh/private_daemon.key',
});
wallet.getNextAddress('1').then(console.log);
got errors:
(node:55573) UnhandledPromiseRejectionWarning: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: IP: 47.241.90.20 is not in the cert's list:
at Object.checkServerIdentity (tls.js:297:12)
at TLSSocket.onConnectSecure (_tls_wrap.js:1507:27)
at TLSSocket.emit (events.js:315:20)
at TLSSocket._finishInit (_tls_wrap.js:932:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12)
at TLSWrap.callbackTrampoline (internal/async_hooks.js:131:14)
So which ssl files should the params caCertPath, certPath, keyPath point to ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.