Skip to content

Conversation

@ben221199
Copy link

This pull request will add the LBC asset.

@ben221199 ben221199 mentioned this pull request Oct 2, 2025
@dev-warrior777
Copy link
Contributor

Looks like a good start. Did you also look at client code in client/asset/...

@ben221199
Copy link
Author

Nope.

@dev-warrior777
Copy link
Contributor

client/asset/lbc/regnet_test.go runs against a tmux/bash test harness in dex/testing/... which must be running. The lbcd's are started -regtest/-simnet.

The regnet_test can be run:

go test   -v -count=1 -tag=harness -run <your test name>

Are you using doge as a pattern? .. maybe look at dex/testing/doge/harness.sh
There looks to be 2 previously prepared doge wallets which are used

@ben221199
Copy link
Author

I honestly don't know. I thought just adding a file with some LBC specific parameters would be enough. I didn't plan to write multiple functions in a codebase I'm not familiar with.

@JoeGruffins
Copy link
Member

All the coins except base have a simnet we can spin up in dcrdex/dex/testing. It would be good to have one for this too as it makes testing a billion times easier. Does lbry requires nodes other than the main daemon? Like eth that requires separate stake nodes?

@ben221199
Copy link
Author

I guess not. It is just a Bitcoin fork with some different chainparams.

@JoeGruffins
Copy link
Member

Should just require an extra script like ltc or doge and a README then

@neofutur
Copy link

neofutur commented Oct 10, 2025

All the coins except base have a simnet we can spin up in dcrdex/dex/testing. It would be good to have one for this too as it makes testing a billion times easier. Does lbry requires nodes other than the main daemon? Like eth that requires separate stake nodes?

could you please explain what those "harness" and "simnet" are ? we ll try to comply.any docs around to read ?

@ben221199
Copy link
Author

As far as I know, Simnet is a local running blockchain network to SIMulate transactions, where as Mainnet and Testnet are publicly accessible networks.

@dev-warrior777
Copy link
Contributor

dev-warrior777 commented Oct 12, 2025

any docs around to read ?

Some of the coin harnesses do have a README.md with dev notes. Example: BTC, DCR, FIRO, LTC, readme's. Firo dex/testing/firo/README.md may be the simplest readme for your case.

  • Test harnesses are for developers/testers and are not seen by users.

  • They use bash and tmux so are only built for linux or mac.

Coin Harnesses:

  • Most utxo coin test scripts make 2 or more simnet daemons and various simnet wallets when they start up. The daemons are usually connected into a local network and golang tests like e.g. client/asset/firo/regnet_test.go and client/asset/doge/regnet_test.go are run against the harness.

    Example:
    Start firo harness.sh (it is only simnet so it will sync a short (fake) chain from genesis which is then mined)

cd ~/dex/dcrdex/client/asset/firo
go test -v -count=1 -tags=harness -run TestWallet
  • One daemon is mined (using generatetoaddress or similar) into a simnet wallet which then funds the rest of the wallets.

  • Doge may be a good one to follow. But you also need to start up a couple of lbcwallet simnet wallet servers (because your wallet is not integrated in the daemon like bitcoin) so maybe see how DCR does that.

  • There are also some scriptlets made by the harness on startup. The scripts are all run from $HOME/dextest so in your case $HOME/dextest/lbc. They are in a dir harness-ctl and make it easy to call CLI tools like bitcoin-cli, dcrctl etc.

    Example: use the alpha scriptlet like this: ./alpha getbalance from the tmux harness-ctl window

Note: these scripts call the CLI RPC tools like firod and firo-cli so before running a coin harness make sure these are in PATH.

Example: export PATH=$PATH:~/firo-0.14.14.3/bin

Server Harness:

  • The dex/testing/dcrdex is different as it is a simnet dex server for simnet test wallets to test server stuff like markets (which are enabled by the genmarkets.sh script called from dex/testing/dcrdex/harness.sh)

  • DCRDEX mainnet swap server and simnet harness use postgres SQL so that needs to be installed if you want to use it. Notes in wiki.

Does your current code work on your mainnet/testnet?

@JoeGruffins
Copy link
Member

JoeGruffins commented Oct 13, 2025

Look at dcrdex/dex/testing/doge like that. harness.sh should run a couple nodes or whatever creating a simulated network. It requires having any necessary tools in your path already.

idk if you want to add everything in this pr, but this is also missing changes to the web ui

@ben221199
Copy link
Author

I'm not planning to get familiar with this codebase. The maintainers can ask me information about LBC and the blockchain, but I doubt this PR will get merged. Maybe I even should close it and make an issue instead.

@dev-warrior777
Copy link
Contributor

Does your current code work on your mainnet/testnet?

@ben221199
Copy link
Author

No idea.

@JoeGruffins
Copy link
Member

JoeGruffins commented Oct 14, 2025

There is an issue #3352

It's your call. We were hoping to just review and yes merge when we are able to test it.

@dev-warrior777
Copy link
Contributor

No idea.

Know how you feel .. felt same way when I first did Firo 2 years back. But then it started to work!

IDE vscode

  • install the GO vscode extension

Build (linux) debug version of client/cmd/bisonw

  • Put a breakpoint in client/asset/lbc.go where you think interesting

  • Then make sure the open file is client/cmd/bisonw/main_notray.go

  • Put a breakpoint in the file at cfg, err := configure()

  • Fixup .vscode/launch.json using Run->Add Configuration

  • Name the configuration BisonW or similar and edit like add "args":[ "--log=debug"] if needed

  • Ensure your lbcd is running (how do you load lbcwallet?)

  • Run->Start Debugging

  • Open browser when prompted by the log
    **** OPEN IN YOUR BROWSER TO LOGIN AND TRADE ---> http://127.0.0.1:5758 ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants