Skip to content

Commit be1b857

Browse files
authored
Merge pull request #180 from KomodoPlatform/dev
sync
2 parents 1e24c8c + e02d04d commit be1b857

File tree

63 files changed

+14167
-3267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+14167
-3267
lines changed

data-for-gpts/all-content.txt

+2,116-3
Large diffs are not rendered by default.

data-for-gpts/antara-content.txt

+129
Original file line numberDiff line numberDiff line change
@@ -17311,6 +17311,37 @@ export const description = "This section contains information required to Setup
1731117311
# Antara Setup
1731217312

1731317313
This section of the documentation contains information required to Setup Antara based Smart Chains.
17314+
export const title = "Activate Custom Consensus modules on a Komodo Smartchain";
17315+
export const description =
17316+
"If you have an existing assetchain based on Komodo platform without Custom Consensus modules enabled, you can activate it at any time.";
17317+
17318+
# How to Activate Custom Consensus modules on an Existing Komodo Smartchain
17319+
17320+
If you have an existing assetchain based on Komodo platform without Custom Consensus modules enabled, you can activate it at any time. Komodo daemon now supports the command-line parameter `-ac_ccactivate=height` , using which you can activate CC on a non-CC enabled chain in a future block height.
17321+
17322+
## Example
17323+
17324+
The first existing chain which doesn't have CC enabled, whose startup command looks like this
17325+
17326+
```bash
17327+
./komodod -ac_name=EXAMPLE -ac_supply=72000000 -addnode=24.54.206.138 &
17328+
```
17329+
17330+
It was a very easy way to start a chain using Komodo technology, with very few parameters. In order to activate CC in this chain, all we have to do is the following:
17331+
17332+
```bash
17333+
./komodod -ac_name=EXAMPLE -ac_supply=72000000 -ac_ccactivate=140 -addnode=24.54.206.138 &
17334+
```
17335+
17336+
`-ac_ccactivate=140` means, Custom Consensus modules are activated at block 140. You can set this parameter to any block height you want the CC to be activated.
17337+
17338+
As this is a hardforking change, all nodes must update. If the chain is being notarized, Notary Nodes need to update to the new parameters as well for the notarization to continue without disruption past the activation block.
17339+
17340+
Once CC is activated on a chain, do not change the startup script. If you do, that will create a new fork.
17341+
17342+
By default, `-ac_ccactivate=height` uses `-ac_cc=2` (If you [recall](/antara/setup/antara-customizations/), `-ac_cc` is the parameter that defines the cluster of chains which can have cross chain Custom Consensus modules). But, you cant add -ac\_cc=2 to the command line, as this will create a new fork. `-ac_ccactivate=height` will take care of those things automagically.
17343+
17344+
Also, addressindex=1 and spentindex=1 need to be in the configuration file, but the daemon will take care of setting this up when `-ac_ccactivate=height` is included as a command-line parameter.
1731417345
export const title = "Advanced Tutorials: Creating Antara Modules for Komodo";
1731517346
export const description =
1731617347
"This tutorial series is intended for advanced Komodo developers who intend to manipulate the default software setup.";
@@ -26476,6 +26507,104 @@ A character that survived a game is also a non-fungible asset and can be traded
2647626507
The `tokentxid` can be found by using the [playerinfo](/antara/api/rogue/#playerinfo) method and submitting the known `playertxid` as an argument. For more information, see the `playerinfo` method.
2647726508

2647826509
The `tokentxid` is created at the character's initial creation and does not change throughout the character's life. When the character dies, the `tokentxid` is sent to a burn address, making the character permanently unplayable.
26510+
export const title = "Using Custom Consensus modules on a Komodo Smartchain";
26511+
export const description = "";
26512+
26513+
# Using the Contracts on a Komodo based Blockchain
26514+
26515+
A high level overview of the Komodo Custom Consensus Framework: [How to write UTXO based CryptoConditions contracts for KMD chains - by jl777](/historical/cc-jl/)
26516+
26517+
To use the contracts on the blockchain, the start command of the chain should contain the parameter `-ac-cc` .
26518+
26519+
A brief overview of the `-ac-cc` parameter:
26520+
26521+
<Note>
26522+
* A chain with -ac\_cc=N with N 0, will have CC active
26523+
* If N is 1, then it just enables CC
26524+
* if N is `>= 2` and `<= 100`, it allows for non-fungible cross chain contracts within all the chains with the same N value
26525+
* if N >= 101, then it forms a cluster of all the chains with the same N value where the base tokens in all the chains in that cluster are fungible via the burn protocol
26526+
</Note>
26527+
26528+
## To test the contracts
26529+
26530+
* Compile Komodo
26531+
26532+
* Navigate to `src` directory, start the test chain with your `pubkey` and issue the SmartContract RPC commands. All the instructions to get you started are below. For a more elaborate explanation on creating a new blockchain using Komodo see: [Creating Komodo Smart Chains](/smart-chains/setup/installing-from-source/)
26533+
26534+
```bash
26535+
#Install dependencies
26536+
26537+
cd ~
26538+
sudo apt-get update
26539+
sudo apt-get upgrade -y
26540+
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libgtest-dev libqt4-dev libqrencode-dev libdb++-dev ntp ntpdate nano software-properties-common curl libcurl4-gnutls-dev cmake clang
26541+
```
26542+
26543+
# Build Komodo
26544+
26545+
```bash
26546+
cd ~
26547+
git clone https://github.com/jl777/komodo
26548+
cd komodo
26549+
git checkout jl777
26550+
./zcutil/fetch-params.sh
26551+
./zcutil/build.sh -j\$(nproc)
26552+
```
26553+
26554+
# Start the Test Chain
26555+
26556+
```bash
26557+
cd ~/komodo/src
26558+
./komodod -ac_cc=1 -ac_name=<CHAIN_NAME-addressindex=1 -spentindex=1 -ac_supply=1000 -ac_reward=10000000000000 -pubkey=<your_pub_key-addnode=195.201.20.230 -addnode=195.201.137.5 -addnode=195.201.20.230 -addnode=94.130.224.11 &
26559+
```
26560+
26561+
## Relevant info:
26562+
26563+
* Source repo: [jl777/komodo](https://github.com/jl777/komodo) (Latest code on cc and new contracts are being added to the `FSM` branch.)
26564+
26565+
* Source directory: [jl777/komodo:src/cc@FSM](https://github.com/jl777/komodo/tree/FSM/src/cc)
26566+
26567+
### Useful Links:
26568+
26569+
(Going through the comments in the following files gives a pretty good overview)
26570+
26571+
* [jl777/komodo:src/cc/assets.cpp@FSM (raw)](https://raw.githubusercontent.com/jl777/komodo/FSM/src/cc/assets.cpp)
26572+
26573+
* [jl777/komodo:src/cc/dice.cpp@FSM (raw)](https://raw.githubusercontent.com/jl777/komodo/FSM/src/cc/dice.cpp)
26574+
26575+
* [jl777/komodo:src/cc/rewards.cpp@FSM (raw)](https://raw.githubusercontent.com/jl777/komodo/FSM/src/cc/rewards.cpp)
26576+
26577+
* [jl777/komodo:src/cc/CCtokens.cpp@FSM (raw)](https://raw.githubusercontent.com/jl777/komodo/FSM/src/cc/CCtokens.cpp)
26578+
26579+
## To add a new contract
26580+
26581+
1. Add EVAL\_CODE to eval.h
26582+
26583+
2. Initialize the variables in the CCinit function below
26584+
26585+
3. Write a Validate function to reject any unsanctioned usage of vin/vout
26586+
26587+
4. Make helper functions to create rawtx for RPC functions
26588+
26589+
5. Add rpc calls to rpcserver.cpp and rpcserver.h and in one of the rpc.cpp files
26590+
26591+
6. Add the new .cpp files to src/Makefile.am
26592+
26593+
1, 2 and 6 are not even coding tasks. 4 and 5 are non-consensus time, mostly dealing with JSON. 3 is the main work needed, which makes sense as a different 3 is what makes it a different contract. A lot of a contracts can use slightly modified functions from the other CC contracts. So the best way to do a new one would be to pick the one that is closest to what you want and start morphing it.
26594+
26595+
## General guidance on reporting issues on discord (Regarding CryptoConditions and SmartContract development)
26596+
26597+
* the specific chain parameters so anyone can connect to it
26598+
26599+
* the **EXACT** rpc call and parameters you used
26600+
26601+
* **the most important!** : the raw tx generated
26602+
26603+
* clear description of why you think it is a bug. for now you need to look at the raw tx details to make sure all vins are valid, signed and all vouts are sane.
26604+
26605+
* Please don't post things like "I tried X and it didnt work" as that does not help at all at this stage. These are raw transaction level things and until everything works, things won't work at the higher level.
26606+
26607+
[Discord Invite](https://komodoplatform.com/discord)
2647926608
export const title = "Understanding Antara Addresses";
2648026609
export const description = "In this guide learn about the different types of addresses used in Antara transactions, including the CC Addresses.";
2648126610

data-for-gpts/historical-content.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ in the Komodo blockchain since inception). The notary nodes process this specifi
16561656
the content of the notarized data.
16571657

16581658
(All examples herein are estimated based off this actual KMD notarization to the BTC network:
1659-
[https://www.blocktrail.com/BTC/tx/313031a1ed2dbe12a20706dff48d3dffb0e39d15e3e4ff936d01f091fb3b8556#tx\_messages](https://blocktrail.com/))
1659+
[https://blockstream.info/tx/313031a1ed2dbe12a20706dff48d3dffb0e39d15e3e4ff936d01f091fb3b8556?expand](https://blockstream.info/))
16601660

16611661
The pieces going into the notarization process could look like this:
16621662

0 commit comments

Comments
 (0)