Discourse is an open-source discussion platform used for most crypto governances and projects to discuss proposals, updates, and research. The following is a quick guide on how to add Sign-In with Web3 to your existing Discourse, as well as the ability to allow users to tip each other.
- A Discourse forum that is self-hosted or that is hosted with a provider that allows third party plugins, like Communiteq.
The Sign-In with Web3 plugin still requires users to enter an email to associate with their accounts after authenticating for the first time. If the user owns an ENS address, it will be the default selected username. Once an email address is associated, users can then sign in using the SIWE option at any time.
To install and enable the plugin on your self-hosted Discourse use the following method: Access your container’s app.yml file (present in /var/discourse/containers/)
cd /var/discourse
nano containers/app.yml
Add the plugin’s repository URL to your container’s app.yml file:
hooks:
before_code: # <-- added
- exec: # <-- added
cmd: # <-- added
- gem install rubyzip # <-- added
- gem instal rbsecp256k1 # <-- added
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/6doworld/discourse-6dc-tipper.git # <-- added
Follow the existing format of the docker_manager.git line; if it does not
contain sudo -E -u discourse
then insert - git clone https://github.com/6doworld/discourse-6dc-tipper.git
.
Rebuild the container:
cd /var/discourse
./launcher rebuild app
To disable it either remove the plugin or uncheck discourse siwe enabled at (Admin Settings -> Plugins -> discourse-6dc-tippet -> discourse 6dc tipper enabled ).
WalletConnect support can be provided via Infura. Create a new Infura project in order to receive a new Infura project ID. Then go to the settings (same as before) and paste the ID in that location and click on the checkmark.
As an alternative, you can configure the WalletConnect instance with JSON RPC endpoints, as shown below:
Doing so will supersede the Infura ID configuration option for WalletConnect specifically, other uses of an Infura ID won't be affected.
The top field is for your mainnet JSON RPC Endpoint & the bottom field is your Rinkeby JSON RPC Endpoint
By default a statement is added to the messages: Sign-in to Discourse via Ethereum. To edit this statement access the settings (same as before) and update it.
For the tipping functionality to work, this is a crucial point in configuration. Choose a Blockchain Network you would like your users to be locked to such as Avalanche, Ethereum, BSC etc.
In order to allow your users to tip each other, you must add an ERC-20 Contract. You can paste in your deployed ERC-20 Contract or use one of the existing one's such as USDC. Make sure the ERC-20 is available on the network chain id.
Make sure you don't forget this step! Update the Currency label as it appears in many pop-ups & system messages. You would want your users' to know what currency they have used to tip!
We have implemented limitations so contract owners have a peace of mind. Lock your users so they can only tip between certain amounts to avoid eating through all your Contract balance at once!
You can set limitations for how often users can tip every day, hour and minute. If you would prefer to remove the cap you can enter 0
or false
. Each limitation is applied in the order that appears on the admin panel.