Table Of Contents:
1. Installation
- Step 1: Create a Blockonomics Account
- Step 2: Adding a Wallet to Blockonomics
- Step 3: Install Greed
- Step 4: Setup Store
- Step 5: Start Bot and Run a Test
Installation
Step 1: Create a Blockonomics Account
- Head over to the Blockonomics website.
- You can create an account using your email and a password or opt for the simpler option by signing up with your Google account.
Step 2: Adding a Wallet to Blockonomics
Once your account is set up, the next step is to add a wallet. This is crucial for receiving your Bitcoin payments directly.
- Go to your Blockonomics dashboard.
- Click on 'Wallet' and then select 'BTC Wallet'.
- Add any name you wish and the xPub Key of your wallet. [To find the xPub key of your BTC wallet, click here]
- Click Create Wallet.
Step 3: Install Greed
Head to github repository of the Telegram Bot and scroll down to the read me section of the page where you will the requirements, installation, and setup of the Bitcoin Telegram bot shop.
Click on the main greed project fork link
Head down to the Links section and click on docs
You will be directed to the installation documentation of the Greed Telegram bot. You have 2 options for installation:
- Docker Engine
- Python [pip]
We will be using Python for this tutorial:
First, check that you meet all the requirements mentioned in the documentation to install the bot successfully and follow the steps mentioned in the documentation:
Once you are on step 8 in the process above ($ nano config/config.toml), you have to do 2 things:
1. Adding your Store Bot:
Go to your telegram application and search for BotFather. this is where you will create your own bot on telegram.
type /newbot. And follow the instructions mentioned. It will ask you for a name and a username for the bot.
Once done you will be given a token. Copy that token and head back to your config.toml file.
Paste the copied token in the token section.
2. Adding Blockonomics API
In the same config.toml file, add the following section at the bottom,
# Blockonomics API key
api_key = "BLOCKONOMICS_API_KEY"
secret = "YOUR_SECRET"
Replace BLOCKONOMICS_API_KEY and YOUR_SECRET with the details mentioned below:
BLOCKONOMICS_API_KEY:
Head to Blockonomics -> Dashboard -> Stores. Copy the API key mentioned here and paste it in the api_key section.
YOUR_SECRET:
Secret can be any random string of your choosing, it's sort of like a password (eg: vLou0hh5t8)
Once, the file is successfully edited, save the file to move to the next step.
Step 4: Setup Store
2. In the callback URL, paste: https://www.blockonomics.co/api/test_callback?secret=YOUR_SECRET
4. Click Create Store.
Now, start your bot by running the command: $ python -OO core.py
Test Setup:
1. Open Telegram, search for your store and send a /start command to your bot to be automatically promoted to Manager.
2. In the menu select Switch to Customer Mode -> Add funds -> Bitcoin -> (amount)
3. You will see the amount and the Bitcoin address. Copy the BTC address and the amount
4. Now go to Blockonomics -> Dashboard -> Log/Test Bench. Paste the BTC address and amount and click Send test payment.
5. You will see that the amount has been credited to your account.
6. You further test your bot by adding products, placing orders, etc.
You have successfully added a Telegram Store bot and integrated bitcoin as payments!