Files
rippled/Feature.html
2023-03-24 05:32:31 +00:00

81 lines
4.9 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: How to add new features</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="PageDoc"><div class="header">
<div class="headertitle">
<div class="title">How to add new features </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Steps required to add new features to the code:</p>
<p>1) In this file, increment <code>numFeatures</code> and add a uint256 declaration for the feature at the bottom 2) Add a uint256 definition for the feature to the corresponding source file (<a class="el" href="Feature_8cpp_source.html">Feature.cpp</a>). Use <code>registerFeature</code> to create the feature with the feature's name, <code>Supported::no</code>, and <code>VoteBehavior::DefaultNo</code>. This should be the only place the feature's name appears in code as a string. 3) Use the uint256 as the parameter to <code>view.rules.enabled()</code> to control flow into new code that this feature limits. 4) If the feature development is COMPLETE, and the feature is ready to be SUPPORTED, change the <code>registerFeature</code> parameter to Supported::yes. 5) When the feature is ready to be ENABLED, change the <code>registerFeature</code> parameter to <code>VoteBehavior::DefaultYes</code>. In general, any newly supported amendments (<code>Supported::yes</code>) should have a <code>VoteBehavior::DefaultNo</code> for at least one full release cycle. High priority bug fixes can be an exception to this rule of thumb.</p>
<p>When a feature has been enabled for several years, the conditional code may be removed, and the feature "retired". To retire a feature: 1) Remove the uint256 declaration from this file. 2) MOVE the uint256 definition in <a class="el" href="Feature_8cpp_source.html">Feature.cpp</a> to the "retired features" section at the end of the file. 3) CHANGE the name of the variable to start with "retired". 4) CHANGE the parameters of the <code>registerFeature</code> call to <code>Supported::yes</code> and <code>VoteBehavior::DefaultNo</code>. The feature must remain registered and supported indefinitely because it still exists in the ledger, but there is no need to vote for it because there's nothing to vote for. If it is removed completely from the code, any instances running that code will get amendment blocked. Removing the feature from the ledger is beyond the scope of these instructions. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>