Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public SmartBCH Testnet #65

Open
CryptoDevving opened this issue Jul 10, 2022 · 17 comments
Open

Public SmartBCH Testnet #65

CryptoDevving opened this issue Jul 10, 2022 · 17 comments

Comments

@CryptoDevving
Copy link

Hello,
Are there documents on how to deploy and run a public SmartBCH testnet?

Thanks

@modenero
Copy link

modenero commented Jul 10, 2022

here you go -> https://docs.smartbch.org/smartbch/testnets

keep in mind that you will also need to deploy your own BCH node, eg. Bitcoin Cash Node (https://bitcoincashnode.org/en/). iirc, you'll need at least 300 GB of disk space; SSD definitely not HDD.

I've done this a few times now, so don't hesitate to ask questions if you need further assistance.

Good luck!

edit: actually 300 GB is for Mainnet, but I'd still reserve at least 200 GB for Testnet.

@CryptoDevving
Copy link
Author

CryptoDevving commented Jul 10, 2022

Thank you so much. Am I able to have people connect to it via metamask? Then have people use the testnet coins as gas? This way people can publically use it and deploy smart contracts using remix?

@modenero
Copy link

Am I able to have people connect to it via metamask?

absolutely!

after you get your node up and running, I'd recommend using Nginx as your reverse proxy.

Here is my config for Mainnet & Testnet (on the same server):

    location /mainnet {
        proxy_set_header Access-Control-Allow-Origin *;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_pass http://127.0.0.1:8545;
        proxy_redirect off;

        proxy_http_version 1.1;
        proxy_read_timeout 1h;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    location /testnet {
        proxy_set_header Access-Control-Allow-Origin *;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_pass http://127.0.0.1:26657;
        proxy_redirect off;

        proxy_http_version 1.1;
        proxy_read_timeout 1h;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

again, reach out if you have any more questions or issues with your setup..

@CryptoDevving
Copy link
Author

Thank you so much once again. I am testing this out on my servers. I probably will have many questions. I have been trying to get into smart contract based side chains for a while.

@modenero
Copy link

no worries .. always happy to help ease the onboarding process for new devs

hopefully, after all the drama settles, we can even have that hackathon https://hacksmart.org/ .. i was supposed to me a mentor

regardless, EVM is a tech that now spans many successful blockchains, so your efforts will certainly NOT go in vain..

@CryptoDevving
Copy link
Author

CryptoDevving commented Jul 11, 2022

What drama if I may ask? I am coming from the smart contract scene and there is always drama there.

A mentor. That is quite amazing. I am very lucky to have you helping me. I hope you mentor others and have the hackathon.

I have another question. I hopefully won't annoy you with all of them. Where would the BCH go when people deploy contracts? Are they stuck in the blockchain or deposited in an address? I am curious about that.

@modenero
Copy link

What drama if I may ask?

I explain it in this issue -> #64

Where would the BCH go when people deploy contracts?

Gas Fees

@CryptoDevving
Copy link
Author

Interesting. So 10mil is locked in the chain? What happened to the original custodian?

So since I only have myself as a validator in my chain then only i get half of the BCH that is used? Then if someone joins my network, they will split it with me? The burn wallet is the BCH burn or a wallet randomly generated on the chain?

@modenero
Copy link

Interesting. So 10mil is locked in the chain? What happened to the original custodian?

i just published this https://docs.sbx.cash/about/coinflex, which has links that should offer you some greater insight.

So since I only have myself as a validator in my chain then only i get half of the BCH that is used?

actually, i've never setup a full validator node (https://docs.smartbch.org/smartbch/testnets_validator#6.-build-createvalidator-tx), but yes that's essentially how it works.

Then if someone joins my network, they will split it with me?

again, i can't confirm from first-hand experience, but yes! not sure if it's 50/50 though. there could be a weighted selection based on the # of coins staked / votes.

i have it in my schedule to deploy my own Mainnet Validator node this month, so I would be happy to follow-up with you once I can confirm the details of the fee split.

The burn wallet is the BCH burn or a wallet randomly generated on the chain?

to be clear, there are 2 burns. one on $SBCH and one on $BCH

$SBCH is simple. iirc, this simply sends to 0x0000000000000000000000000000000000000000, which is the default EVM burn address (hmm, not sure why this acct has nearly 2M txs but nearly no balance though)

on $BCH i'm not 100% clear on this. but I believe the plan is to only burn once an epoch (approx. 2 weeks). that way, any funds queued to burn may be used to payout requests to exchange $SBCH for $BCH. but at the end of the epoch, if there's any balance, then yes! i would presume it would be sent to some "irrecoverable" address

keep in mind that NONE of the $BCH burning exists yet, as CoinFLEX was a centralized custodian handling all of this "manually" .. and that is changing NOW!

@CryptoDevving
Copy link
Author

CryptoDevving commented Jul 11, 2022

My goodness that is awful. So they essentially took the BCH that was transacted/raised on this chain?

I will be looking forward to the results of your main net validator node.

Did someone spam a ton of transactions?

Hopefully I do not sound rude, but why didn't SmartBCH become their own custodians?

Edit:
In theory could this be ported to other bitcoin like blockchains, such as Bitcoin, Ecash, BitcoinSV etc?

@modenero
Copy link

So they essentially took the BCH that was transacted/raised on this chain?

not as yet. but it's on their schedule

why didn't SmartBCH become their own custodians?

the decision was made this way to expedite the release to Mainnet.

In theory could this be ported to other bitcoin like blockchains, such as Bitcoin, Ecash, BitcoinSV etc?

absolutely! all the code is open-source 👍

@CryptoDevving
Copy link
Author

CryptoDevving commented Jul 12, 2022

How would I make it so I am the custodian of my own chain?

Excellent. I figure if I try hard enough it might be easy enough to point it at a different bitcoin based blockchain. However I am unsure if it will be that easy.

Edit:
Could I in theory fork BCH and run this on them forked chain?

@CryptoDevving
Copy link
Author

CryptoDevving commented Jul 24, 2022

I apologize for the double post but I am still having troubles configuring my nginx reverse proxy.

Edit: you showed me your config but I am not sure how to use it.

I hope all is well and I got the smartBCH chain running.

@modenero
Copy link

modenero commented Jul 24, 2022

you showed me your config but I am not sure how to use it.

sure, no worries.

  1. first you install nginx apt install nginx
  2. then open the default site config vim /etc/nginx/sites-available/default
  3. update the default location
  4. finally restart the nginx service

this is the section you need to replace

  location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
  }

with this

    location / {
        proxy_set_header Access-Control-Allow-Origin *;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_pass http://127.0.0.1:8545;
        proxy_redirect off;

        proxy_http_version 1.1;
        proxy_read_timeout 1h;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

to restart Nginx, (on Debian or Ubuntu) use service nginx restart

then point your MetaMask RPC URL to:
http://<your-domain>


if you want to add SSL support, I'd recommend using

https://certbot.eff.org/instructions

Let me know how that works out for you..

edit:
for Testnet use
proxy_pass http://127.0.0.1:26657;

@CryptoDevving
Copy link
Author

CryptoDevving commented Jul 24, 2022

I am always impressed with how great you are.

Where do I establish my domain? Where do I put it? If I want it to be http://www.bestBCHChain.dev or something similar?

Edit: I just made that link up. If it actually does link to something I apologize.

@CryptoDevving
Copy link
Author

Okay sorry to necro a post. But how do I get outside validators connected @modenero?

@modenero
Copy link

Okay sorry to necro a post. But how do I get outside validators connected @modenero?

no worries.

unfortunately, i don't know much about the validation process. you should post your question to https://research.smartbch.org/ and someone from the team (likely Dr. Wang Kui) will answer it

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

No branches or pull requests

2 participants