https://github.com/block-core/blockcore-template
Template project used to start a new Blockcore based chain from "dotnet new blockcorecoin" command.
https://github.com/block-core/blockcore-template
Last synced: 9 months ago
JSON representation
Template project used to start a new Blockcore based chain from "dotnet new blockcorecoin" command.
- Host: GitHub
- URL: https://github.com/block-core/blockcore-template
- Owner: block-core
- License: mit
- Created: 2020-03-14T10:58:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T13:23:26.000Z (over 2 years ago)
- Last Synced: 2025-08-14T18:48:25.950Z (10 months ago)
- Language: C#
- Homepage:
- Size: 109 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Blockcore Samples and Templates
# Create your own Blockchain
The right place to get started, is this repository: https://github.com/block-core/blockcore-node
## Introduction to our "dotnet new" template
This repository contains samples for building new blockchain applications and coins using the Blockcore platform.
The samples can be copied directly or if you prefer you can install the Blockcore template and use `dotnet new` to create a new blockchain based on the sample. Using the template will substitute in the name of your blockchain and coin ticker.
## Template Usage
1) Install the template from nuget
```
dotnet new -i Blockcore.Coin.Template
```
2) Create a directory for your coin
```
mkdir mynewcoin
cd mynewcoin
```
3) Create your coin
```
dotnet new blockcorecoin --coinTicker MNC .....
```
There are many parameters you need to specify, so find examples here:
[https://github.com/block-core/blockcore-nodes/tree/master/scripts](https://github.com/block-core/blockcore-nodes/tree/master/scripts)
4) Find all the "TODO" comments in the code for things that needs to be replaced before you can start you blockchain.
### Tasks
- [ ] Add unit tests to template
- [ ] Parameterize ports
- [ ] Parameterize magic number
- [ ] Parameterize pszTimestamp
- [ ] Optional features
### Template Development
Install locally can be done by navigating into the "Blockcore.SampleCoin" sub-folder and running the following command:
```
dotnet new -i .
```
Then you can create a new project like instructed above.
Also consider using the "-o" (--output) switch to easier quickly generate many instances for testing:
```
dotnet new blockcorecoin -c BTC -o CoinOne
```
### Linux
To use the sample coin template on Linux, first install the .NET Core SDK:
```
sudo snap install dotnet-sdk --classic
sudo snap alias dotnet-sdk.dotnet dotnet
```
Then clone the repository to a folder:
```
git clone https://github.com/block-core/blockcore-samples.git
```
Navigate into correct folder and install the template:
```
# Navigate to sample code
cd blockcore-samples
cd Blockcore.SampleCoin
# Install the sample code as a "dotnet new" template
dotnet new -i .
```
Navigate to your blockchain folder where you want to generate code:
```
dotnet new blockcorecoin --output MyCoin
cd MyCoin
```
Edit your code, with Visual Studio Code or another editor.
Now run and test your custom blockchain:
```
cd src
cd MyCoin.Node
dotnet run
```