Skip to main content

uploading

Uploading the voting program

To use the compiled program on-chain, the binary must be stored by the SPF service. The SPF client provides an upload utility that stores the program and returns a unique identifier for referencing the program in subsequent operations.

# Upload the compiled voting program to SPF. The command outputs
# the library identifier, which is stored in LIBRARY_ID.
export LIBRARY_ID=$(spf-client upload-program --file voting)

The upload-program command outputs the library’s identifier. For this example, the library identifier is 0x7f7e6993da0d371c4f7f4573df315fe3638d253b74c3f98e946f9b9737b5b51b. This identifier is referenced later when configuring the smart contract and requesting program runs.