Where is subspace-node and subspace-farmer api guide?

  • already follow Node Interaction · Polkadot Wiki, can get node sync status
  • how to get wallet address balance?
  • how to get farmer runner plotted size and allocated size?

The process is the same as for any other Substrate chain, you need to query storage of balances pallet. I’m afraid we don’t have a Subspace-specific example of this.

Some of this information is available in farmer’s metrics endpoint, there you can find breakdown of sectors by their state (plotted/not plotted/about to expire/expired) and some other information.

  • not any doc for balance? subspace address to hex address?
import { u8aToHex } from "@polkadot/util"
import { decodeAddress } from "@polkadot/util-crypto"

const ADDR = "st8uTMjLf1H3LA3dZRqvKWeLUD6qP7RHai5qtzAT4s4Js1AeX"

// convert to hex
const hex = u8aToHex(decodeAddress(ADDR))
console.log(hex)
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "state_getStorage", "params": ["0x74e4779c285d23de7e8e7d35082bb07e6e3358ddd8746a244bc54d8516a08460"]}' http://192.168.1.5:9944

{"jsonrpc":"2.0","result":null,"id":1}
  • metrics endpoint info is sectors count?
    • so one sectors size is 1G?
    • totla sectors * 1G is not equal to allocated size path=/var/subspace/s03/p000,size=3480G
    • why disk is not full used by df -h show, reamin 200G+ is not used.
subspace_farmer_sectors_total_sectors{farm_id="01HPNRPEMJ0DF360S7KM3G09SF",state="NotPlotted"} 2336
subspace_farmer_sectors_total_sectors{farm_id="01HPNRPMFR5ZKFRCEN3GD86NX8",state="NotPlotted"} 2674
subspace_farmer_sectors_total_sectors{farm_id="01HQ5D9CNE5KTGH3J7TGTDXGS6",state="Plotted"} 45
subspace_farmer_sectors_total_sectors{farm_id="01HQ5D9EN0443XAZPNNVWNFE7Z",state="NotPlotted"} 3215
subspace_farmer_sectors_total_sectors{farm_id="01HQ5D9EN0443XAZPNNVWNFE7Z",state="Plotted"} 44
subspace_farmer_sectors_total_sectors{farm_id="01HPNRPCP2FVF7QW64DAKKP0R3",state="NotPlotted"} 2334
subspace_farmer_sectors_total_sectors{farm_id="01HQ5D9GN1HGNG1R870QSRM0DA",state="NotPlotted"} 3214
subspace_farmer_sectors_total_sectors{farm_id="01HPNRPJEPADQ9JTNJGWNQMVWR",state="Plotted"} 912
subspace_farmer_sectors_total_sectors{farm_id="01HQ5D9GN1HGNG1R870QSRM0DA",state="Plotted"} 45
subspace_farmer_sectors_total_sectors{farm_id="01HPNRPEMJ0DF360S7KM3G09SF",state="Plotted"} 923
subspace_farmer_sectors_total_sectors{farm_id="01HNR27D6WCZAXJR1KX0Y1RVSA",state="Plotted"} 2684
subspace_farmer_sectors_total_sectors{farm_id="01HPNRPCP2FVF7QW64DAKKP0R3",state="Plotted"} 925
subspace_farmer_sectors_total_sectors{farm_id="01HNR27D6WCZAXJR1KX0Y1RVSA",state="NotPlotted"} 643
subspace_farmer_sectors_total_sectors{farm_id="01HQQ0A90JVYBT9CEKBWGPA2CZ",state="NotPlotted"} 3258
subspace_farmer_sectors_total_sectors{farm_id="01HNR27B7WH76V8652F3SE4F7R",state="Plotted"} 2739
subspace_farmer_sectors_total_sectors{farm_id="01HQ5D9AJFV0W5S43824H9BSV7",state="Plotted"} 46
subspace_farmer_sectors_total_sectors{farm_id="01HQ5D9AJFV0W5S43824H9BSV7",state="NotPlotted"} 3213
subspace_farmer_sectors_total_sectors{farm_id="01HQ5D9CNE5KTGH3J7TGTDXGS6",state="NotPlotted"} 3214
subspace_farmer_sectors_total_sectors{farm_id="01HNR27F66XF61VTENDSFQ6NN3",state="NotPlotted"} 609
subspace_farmer_sectors_total_sectors{farm_id="01HPNRPMFR5ZKFRCEN3GD86NX8",state="Plotted"} 585
subspace_farmer_sectors_total_sectors{farm_id="01HNR27B7WH76V8652F3SE4F7R",state="NotPlotted"} 588
subspace_farmer_sectors_total_sectors{farm_id="01HNR27F66XF61VTENDSFQ6NN3",state="Plotted"} 2718
subspace_farmer_sectors_total_sectors{farm_id="01HQQ0A90JVYBT9CEKBWGPA2CZ",state="Plotted"} 1
subspace_farmer_sectors_total_sectors{farm_id="01HPNRPJEPADQ9JTNJGWNQMVWR",state="NotPlotted"} 2347

It is SS58 format, exactly the same as for any other Substrate-based chain.

There is just one endpoint for metrics. You just add subspace_farmer_sectors_total_sectors with different states and the resulting number if number of sectors you have in total.

Because it is farm size, not plot size. Farm contains metadata and other things in addition to the plot as you can see in the directory.

Hard to say, you either didn’t specify large enough farm size or depending on file system there could be reserved space, which can be made available if you only use disk for Subspace and/or know what you’re doing (tune2fs -m 0 /dev/sdX for ext4 on Linux).

arg path=/var/subspace/s03/p000,size=3480G, G is 1000 * 1000 * 1000, not 1024 * 1024 * 1024 ?

Yes, that is correct