- have NodeJS and NPM installed on your server, see https://nodejs.org/en/download/
- have a MongoDB server installed on your server, see https://docs.mongodb.com/v3.2/administration/install-community/
- have a Steem account with a minimum of 1000 Steem Power
To "install" the app, simply follow these steps:
-
get the files from the repository:
- via the git cli:
git clone https://github.com/harpagon210/steemsmartcontracts.git
(then select the "witnesses" branch:git checkout witnesses
- by downloading the zip file: https://github.com/harpagon210/steemsmartcontracts/archive/witnesses.zip
- via the git cli:
-
in your console type the following command in the folder that contains the files downloaded from the previous step:
npm install
You'll have to configure your node in order to make it listen to the Steem blockchain, simply edit the config.json
file:
(the following file is the pre-configuration file that comes with the software, it will listen to the sidechain id "testnet1", will start up a HTTP JSON RPC server listening on port 5000 and communicate with the other witnesses on port 5001)
{
"chainId": "testnet1", // the id of the sidechain that the node will listen to
"rpcNodePort": 5000, // port of the JSON RPC server that people will use to retrieve data from your node
"p2pPort": 5001, // port that other witnesses will use to communicate with your node
"databaseURL": "mongodb://localhost:27017", // url to your MongoDB server
"databaseName": "ssc", // name of the MongoDB database
"blocksLogFilePath": "./blocks.log", // path to a blocks log file (used with the replay function)
"javascriptVMTimeout": 10000, // the timeout that will be applied to the JavaScript virtual machine, needs to be the same on all the nodes of the sidechain
// array of Steem full nodes url for the failover
"streamNodes": [
"https://api.steemit.com",
"https://anyx.io"
],
"steemAddressPrefix": "STM", // address prefix of the Steem addresses
"steemChainId": "0000000000000000000000000000000000000000000000000000000000000000", // id of the Steem blockchain
"startSteemBlock": 37894037, // last Steem block parsed by the node
"genesisSteemBlock": 29862600 // first block that was parsed by the sidechain, needs to be the same on all nodes listening to the sidechain id previously defined
}
To be a witness you'll need to have a Steem account:
- copy the .env.example
file as .env
- enter the Steem account name as well as the active signing key linked to that account
ACTIVE_SIGNING_KEY=5K...
ACCOUNT=acc...
To enable a witness you need to register it on the sidechain, you can simply send some Steem to yourself with the following memo: - replace "MY.PUBLIC.IP" with the public IP address of your server - replace "MY_PUBLIC_ACTIVE_KEY" with the public active key of the Steem account
{
"id": "ssc-testnet1",
"json": {
"contractName": "witnesses",
"contractAction": "register",
"contractPayload": {
"IP": "MY.PUBLIC.IP",
"RPCPort": 5000,
"P2PPort": 5001,
"signingKey": "MY_PUBLIC_ACTIVE_KEY",
"enabled": true
}
}
}
To vote for witness you'll need to have SSC tokens staked on the testnet (ENG on the mainnet). The number of staked tokens will determine your approval power. All you need to do is broadcast the following JSON:
{
"id": "ssc-testnet1",
"json": {
"contractName": "witnesses",
"contractAction": "approve",
"contractPayload": {
"witness": "STEEM_ACCOUNT_OF_A_WITNESS_TO_APPROVE"
}
}
}