This repository contains Substrate's node-template
configured to include Substrate's pallet-contracts
‒ a smart contract module.
This repository contains a couple of modifications that make it unsuitable for a production deployment, but a great fit for development and testing:
- The unstable features of the 
pallet-contractsare enabled by default (see theruntime/Cargo.toml). - The consensus algorithm has been switched to 
manual-sealin #42. Hereby blocks are authored immediately at every transaction, so there is none of the typical six seconds block time associated withgrandpaoraura.- By default, either manual or instant seal does not result in block finalization unless the 
engine_finalizeBlockRPC is executed. However, it is possible to configure the finalization of sealed blocks to occur after a certain amount of time by setting the--finalize-delay-secoption to a specific value, which specifies the number of seconds to delay before finalizing the blocks. The default value is 1 second../target/release/substrate-contracts-node --finalize-delay-sec 5
 
 - By default, either manual or instant seal does not result in block finalization unless the 
 - If no CLI arguments are passed the node is started in development mode by default.
 - A custom logging filter is applied by default that hides block production noise and prints the contracts debug buffer to the console.
 - With each start of the node process the chain starts from genesis ‒ so no
chain state is retained, all contracts will be lost! If you want to retain
chain state you have to supply a 
--base-path. - For 
pallet_contracts::Configwe increased the allowed contract sizes. This avoids running intoCodeTooLargewhen uploading contracts during development. See the comment inruntime/src/lib.rsfor more details. 
If you are looking for a node suitable for production see these configurations:
- Substrate Node Template
 - Substrate Cumulus Parachain Template
 - Contracts Parachain Configuration for Rococo
 
The easiest way is to download a binary release from our releases page
and just execute ./substrate-contracts-node.
Follow the official installation steps to set up all Substrate prerequisites.
Afterwards you can install this node via
cargo install contracts-nodeTo run a local dev node execute
substrate-contracts-nodeA new chain in temporary directory will be created each time the command is executed. This is the
default for this node. If you want to persist chain state across runs you need to
specify a directory with --base-path.
See our FAQ for more details: How do I print something to the console from the runtime?.
Once the node template is running locally, you can connect to it with frontends like Contracts UI or Polkadot-JS Apps and interact with your chain.
Note: Now that this repo has upgraded to using dependencies from crates.io, this section
needs to be updated to reflect the new process, once the first release of the crates from
the new polkadot-sdk mono-repo happens
-  Check Substrate's 
node-templatefor new commits between the new polkadot release branch and the one this repository is currently synced with. The current branch is mentioned in this readme. -  Apply each commit that happened in this 
node-templatefolder since the last sync. -  Check commits for 
pallet-contractssince the last time someone synchronized this repository with Substrate in order to not miss any important changes. -  Execute 
diener update -s --branch my_polkadot_release_branch. Manually upgrade thepallet-assets-chain-extensiondependency to the latest release branch and thencargo update -p pallet-contractsfor this repository. The specific crate which is mentioned here is actually not important: since Substrate uses git references for its Substrate dependencies it means that once one package is updated all are. -  Increment the minor version number in 
node/Cargo.tomlandruntime/Cargo.toml. -  Execute 
cargo run --release. If successful, it should produce blocks and a new, up to date,Cargo.lockwill be created. -  Update this readme with the hash of the Substrate 
mastercommit with which you synchronized. The hash appears two times in this readme. - Create a PR with the changes, have it reviewed and merged.
 -  Replace 
XXin this command with your incremented version number and execute it:git checkout main && git pull && git tag v0.XX.0 && git push origin v0.XX.0. This will push a new tag with the version number to this repository. -  We have set this repository up in a way that tags à la 
vX.X.Xtrigger a CI run that creates a GitHub draft release. You can observe CI runs on GitLab. This draft release will contain a binary for Linux and Mac and appear under Releases. Add a description in the style of "Synchronized withpolkadot-v1.0.0branch." and publish it.