Getting Started

Build on SilverBitcoin: Installation, node setup, and first smart contract

1. System Requirements

1.1 Minimum Requirements

1.2 Development Requirements

2. Installation

2.1 Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup update

2.2 Clone Repository

git clone https://github.com/silverbitcoin/silver2.0.git
cd silver2.0

2.3 Build from Source

cargo build --release
# Binaries available in target/release/

3. Running a Full Node

3.1 Start Node

./target/release/slvrd --rpc-port 8332 --p2p-port 8333

3.2 Node Configuration

Create slvr.conf:

# Network
rpc-port=8332
p2p-port=8333
listen-addr=0.0.0.0:8333

# Performance
threads=4
max-peers=100

# Storage
data-dir=./data
archive-mode=false

# Logging
log-level=info

3.3 Verify Node is Running

curl -X POST http://localhost:8332 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}'

4. Mining Setup

4.1 CPU Mining

./target/release/cpu-miner \
  --pool-url stratum+tcp://pool.silverbitcoin.org:3333 \
  --wallet-address slvr1... \
  --threads 4

4.2 GPU Mining (CUDA)

./target/release/gpu-miner \
  --pool-url stratum+tcp://pool.silverbitcoin.org:3333 \
  --wallet-address slvr1... \
  --device 0

4.3 Mining Pool Setup

./target/release/stratum_pool \
  --listen-addr 0.0.0.0:3333 \
  --node-rpc http://localhost:8332 \
  --min-difficulty 1000

5. Smart Contract Development

5.1 Create First Contract

Create hello.slvr:

(defun hello (name)
  "Greet someone"
  (+ "Hello, " name "!")
)

(defun add (a b)
  "Add two numbers"
  (+ a b)
)

5.2 Compile Contract

slvr compile hello.slvr --output hello.wasm

5.3 Deploy Contract

slvr deploy hello.wasm \
  --node http://localhost:8332 \
  --account my-account

5.4 Call Contract

slvr call hello.wasm hello "World" \
  --node http://localhost:8332

6. Wallet Integration

6.1 Create Wallet

slvr wallet create --name my-wallet --mnemonic-length 24

6.2 Import Wallet

slvr wallet import --name my-wallet --mnemonic "word1 word2 ..."

6.3 Check Balance

slvr wallet balance --name my-wallet --node http://localhost:8332

6.4 Send Transaction

slvr wallet send \
  --from my-wallet \
  --to slvr1... \
  --amount 1.5 \
  --node http://localhost:8332

7. API Reference

7.1 Common JSON-RPC Methods

getblockcount

Get the current block height

curl -X POST http://localhost:8332 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}'

# Response: {"jsonrpc":"2.0","result":123456,"id":1}

getbalance

Get account balance

curl -X POST http://localhost:8332 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"getbalance","params":["slvr1..."],"id":1}'

# Response: {"jsonrpc":"2.0","result":"1.5","id":1}

sendtransaction

Send a transaction

curl -X POST http://localhost:8332 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc":"2.0",
    "method":"sendtransaction",
    "params":["0x..."],
    "id":1
  }'

8. Troubleshooting

8.1 Node Won't Start

8.2 Mining Not Working

8.3 Contract Deployment Failed

9. Next Steps

Need help? Check out our resources:

API ReferenceSlvr LanguageMining Guide