Discussion of ActorForth and related projects under the ActorForth organization.
scherrey on filepos
Updated refdocs. (compare)
scherrey on filepos
Added compiling to categories a… Merge branch 'filepos' of githu… (compare)
scherrey on filepos
Add initial Makefile. Uncomment… Improve parallel builds. Improve parallel builds. and 7 more (compare)
MayaPosch on master
Separate unit tests into separa… (compare)
Btw, there is a new bitcash update, including a change from @nicolaiskye :)
I am currently following the installation walkthrough for the bch-toolkit. When I run the command ./setup all
it leaves the following error:
Cloning into '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api'...
The authenticity of host 'github.com (140.82.112.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,140.82.112.3' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Looks like the publickey that gets downloaded isn't working? Or should I have selected fingerprint? IDK. Any help would be great. I am running it on Mac OS big version 11.2
It did validate that all the dependencies were installed.
Setting up Bitcoin Unlimited node.
Checking that necessary software is available:
Looking for Docker...
Docker found.
Looking for docker-compose...
Docker-compose found.
Looking for openssl...
Openssl found.
Looking for git...
Git found.
OpenSSL certificates already exist.
Starting local node servers...
nginx-regtest is up-to-date
opensight is up-to-date
bitcoin-restapi is up-to-date
bitcoind-regtest is up-to-date
Stopping nginx-regtest ... done
Stopping bitcoind-regtest ... done
Stopping bitcoin-restapi ... done
Stopping opensight ... done
Python3 found.
Looking for virtualenv...
Virtualenv found.
Electron Cash SLP already exists.
Setting up python virtual environment...
Environment already exists.
Cloning into '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
[ long list of IDs here didn't want to paste them all]
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:ActorForth/bch-api.git' into submodule path '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api' failed
Failed to clone 'bch-api'. Retry scheduled
Cloning into '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api'...
Warning: Permanently added the RSA host key for IP address '140.82.112.4' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:ActorForth/bch-api.git' into submodule path '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api' failed
Failed to clone 'bch-api' a second time, aborting
./clean all
and git checkout refactor
route. I appreciate the response!
Here is the full stack trace of the error.
Setting up Bitcoin Unlimited node. Checking that necessary software is available: Looking for Docker... Docker found. Looking for docker-compose... Docker-compose found. Looking for openssl... Openssl found. Looking for git... Git found. OpenSSL certificates already exist. Starting local node servers... nginx-regtest is up-to-date opensight is up-to-date bitcoin-restapi is up-to-date bitcoind-regtest is up-to-date Stopping nginx-regtest ... done Stopping bitcoind-regtest ... done Stopping bitcoin-restapi ... done Stopping opensight ... done Python3 found. Looking for virtualenv... Virtualenv found. Electron Cash SLP already exists. Setting up python virtual environment... Environment already exists. Cloning into '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. [ long list of IDs here didn't want to paste them all] Please make sure you have the correct access rights and the repository exists. fatal: clone of 'git@github.com:ActorForth/bch-api.git' into submodule path '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api' failed Failed to clone 'bch-api'. Retry scheduled Cloning into '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api'... Warning: Permanently added the RSA host key for IP address '140.82.112.4' to the list of known hosts. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. fatal: clone of 'git@github.com:ActorForth/bch-api.git' into submodule path '/Users/traysonkelii/Projects/block-chain/bch-toolkit/bch-api' failed Failed to clone 'bch-api' a second time, aborting
I was running into the same error
refactor
branch, it is now working
Regarding getting off regtest - there's several config files that will need to be changed. Nick or one of the other staff will reply by tomorrow and help out with that.
OK thanks
To use anything other then regtest, I need to edit
configs/bitcoin.conf
and comment outregtest=1
and replace with mainnet or testnet=1?. Is this correct @nicolaiskye
the bitcoin-unlimited.conf
needs to be changed (as you described .. however only either 'regtest=1' or 'testnet=1' are needed .. without them it will default to mainnet, so no need for 'mainnet=1'). The bitcoin.conf
(without 'unlimited') should be ignored for now--it's intended for use with the BCHN node, which we don't have automated yet. In addition to bitcoin-unlimited.conf
these files ( bch-api-config.sh
, restapi-config.sh
) also have a NETWORK=regtest
setting that should be adjusted to reflect the network you're aiming for.
Steps taken thus far:
refactor
branch./setup default
./services run
Questions:
Questions:
- Is the rest API catered specifically for the bch-api?
- How do I set up a wallet? (Electron cash GUI hasn't opened up for me)
- The application I was writing hits the endpoints from https://rest.bitcoin.com/ can I still use this tool for these cases?
- Is there a hello world example of how to use the tool after successfully installing everything?
Two REST APIs are provided with the toolkit. There's one that's based on "rest.bitcoin.com" which is used by SDKs like Bitcash (Python), and one based on "bch-api" which is used by SDKs like bch-js (JavaScript). Other SDKs that use either of these endpoints may also work, but you would need to ensure they support addresses with the "bchreg:" prefix. I've found that in many projects, the maintainers only provide "bitcoincash:" and "bchtest:" by default.
The node itself has a basic wallet built-in. You can access it with the ./bitcoin-cli
command, and running./bitcoin-cli help
will get you the full list of commands. I most commonly use ./bitcoin-cli sendtoaddress bchreg:[myaddress] 100
in order to send funds to my addresses (generated from Bitcash or bch-js) so that I have satoshis to play around with. Additionally ./bitcoin-cli generate 10
(or whatever number of blocks you want to generate) is very useful, and is one of the biggest benefits of having a local node (i.e., controlling exactly when blocks get mined). Electron Cash doesn't currently support the "bchreg:" prefix, and so currently isn't usable with our toolkit.
Yes, if you're able to redirect your application to localhost:12500 instead of rest.bitcoin.com, then it should work just as you'd expect the mainnet API to work.
That's a great idea. I'll try and put together some examples and documentation to make getting started with the toolkit easier. In the meantime, if you can let me know what SDK you're using, I can probably help with a few examples and make sure it's set up and working with the toolkit as expected.
Here is my current flow towards trying to successfully hit localhost:12500
and verify that the address I created and the amount that I sent to it was correct.
Create bchreg address. I created it via the following code (could have also been made with the bitcoin-cli
)
const bitcore = require('bitcore-lib-cash');
bitcore.Networks.defaultNetwork = bitcore.Networks.regtest;
var privateKey = new bitcore.PrivateKey();
var publicKey = new bitcore.PublicKey(privateKey)
console.log('WIF:', privateKey.toWIF());
console.log('cashaddr:', publicKey.toAddress().toString());
ran the following command to send some money to the address:
/bitcoin-cli sendtoaddress bchreg:qre76hccdcmrj8jafcy6gzcgyum9650g95cj7cf62k 100
this returns what I assume is the txid 4cabb8f034538d52e938e2c22f3828fd06b366d3b5c50e05bb52332a96e0fa8b
.
leveraging bitbox SDK and slpjs I attempt to hit the localhost instance at port 12500. Here is what I have scripted up:
const BITBOXSDK = require('bitbox-sdk')
const slpjs = require('slpjs');
let addr = 'bchreg:qre76hccdcmrj8jafcy6gzcgyum9650g95cj7cf62k';
const BITBOX = new BITBOXSDK.BITBOX({ restURL: 'http://localhost:12500/' });
const bitboxNetwork = new slpjs.BitboxNetwork(BITBOX);
let balances;
(async function() {
balances = await bitboxNetwork.getAllSlpBalancesAndUtxos(addr);
console.log("balances: ", balances.nonSlpUtxos[0].amount);
})();
I am getting the following error here and I am trying to trace it:
(node:88847) UnhandledPromiseRejectionWarning: #<Object>
(Use `node --trace-warnings ...` to show where the warning was created)
(node:88847) 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: 2)
(node:88847) [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.
(base) traysonkelii@Traysons-MacBook-Pro bch_regtest % node --trace-warnings balance.js
(node:88861) UnhandledPromiseRejectionWarning: #<Object>
at emitUnhandledRejectionWarning (internal/process/promises.js:170:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:88861) 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: 2)
(node:88861) [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.
at emitDeprecationWarning (internal/process/promises.js:180:11)
at processPromiseRejections (internal/process/promises.js:249:13)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
Can I get a santity check? Am I doing this right?
./bitcoin-cli getrawblocktransactions 4cabb8f034538d52e938e2c22f3828fd06b366d3b5c50e05bb52332a96e0fa8b
./bitcoin-cli decoderawtransaction
hextransaction
ANNOUNCEMENT :
We have a new beta release v0.1-beta1
This version is a major change. Restructuring how we clone, pull and build image.
We no longer build images locally. It’s now only pulls prebuilt images from Docker Hub.
We also have a Docker Hub organization https://hub.docker.com/u/actorforth to organize all the dependent images.
The changes address issues relating to git submodules not working, and bch-api not working.
Release found here:
https://github.com/ActorForth/bch-toolkit/releases/tag/v0.1-beta1
Did you guys see this?? NFTs just blew up, everyone’s talking about crypto art now.
https://opensea.io/collection/nft-art