This page covers how to run and interact with Compute Substrate.
Build from source:
git clone https://github.com/your-org/compute-substrate
cd compute-substrate
cargo build --release
Binary will be at:
target/release/csd
Optional:
sudo cp target/release/csd /usr/local/bin/csd
csd node \
--datadir /var/lib/csd/node \
--rpc 0.0.0.0:8789 \
--genesis /etc/csd/genesis.bin \
--p2p-listen /ip4/0.0.0.0/tcp/17999 \
--bootnodes <multiaddr,...>
csd node \
--datadir /var/lib/csd/miner \
--rpc 0.0.0.0:8789 \
--mine \
--miner-addr20 0x... \
--genesis /etc/csd/genesis.bin \
--p2p-listen /ip4/0.0.0.0/tcp/17999 \
--bootnodes <multiaddr,...>
csd wallet new
This returns:
addr20The private key is the wallet right now. Save it securely if you want recovery.
csd wallet addr --privkey 0x<privkey>
csd wallet whoami --privkey 0x<privkey>
csd wallet balance \
--address 0x<addr20> \
--datadir /var/lib/csd/node
csd wallet input \
--privkey 0x<privkey> \
--datadir /var/lib/csd/node \
--min 1000
This prints a spendable input as:
0x<txid>:<vout>:<value>
csd wallet spend \
--privkey 0x<privkey> \
--auto-input \
--datadir /var/lib/csd/node \
--output 0x<addr20>:100000 \
--fee 1000
csd wallet propose \
--privkey 0x<privkey> \
--auto-input \
--datadir /var/lib/csd/node \
--fee 1000 \
--domain eth_price_weekly \
--payload-hash 0x<32-byte-hash> \
--uri "ETH > $4000 by Friday" \
--expires-epoch 100
This builds and signs a proposal transaction, but does not submit it.
csd wallet propose-submit \
--privkey 0x<privkey> \
--auto-input \
--datadir /var/lib/csd/node \
--fee 1000 \
--domain eth_price_weekly \
--payload-hash 0x<32-byte-hash> \
--uri "ETH > $4000 by Friday" \
--expires-epoch 100 \
--rpc-url http://127.0.0.1:8789
csd wallet attest \
--privkey 0x<privkey> \
--auto-input \
--datadir /var/lib/csd/node \
--fee 1000 \
--proposal-id 0x<proposal-txid> \
--score 100 \
--confidence 90
This builds and signs an attestation transaction, but does not submit it.
csd wallet attest-submit \
--privkey 0x<privkey> \
--auto-input \
--datadir /var/lib/csd/node \
--fee 1000 \
--proposal-id 0x<proposal-txid> \
--score 100 \
--confidence 90 \
--rpc-url http://127.0.0.1:8789
curl http://127.0.0.1:8789/top/<domain>
Example:
curl http://127.0.0.1:8789/top/eth_price_weekly