The testnet is now live! Become a builder of Polycash's core ecosystem and get early access to a development blockchain that uses the exact same APoW protocol as the soon to be launched mainnet.
First, you'll need to grab some (testnet) PCSH. As this is a testnet and not designed for deployment, it should come pretty cheap compared to other mainnet cryptocurrency tokens. Be aware that testnet PCSH won't transfer over to the mainnet when it's deployed. We suggest getting around 1 PCSH, which should pay for the deployment and development fees for a few medium-complexity dapps. Below are prices for basic actions on the blockchain. Please note that all instructions executed on the Polycash Virtual Machine are priced based on gas, not PCSH. Documentation on VM pricing is in another document.
Action | Cost (PCSH) |
---|---|
Use 1 gas | 0.000001 |
Initiate 1 transaction (base fee) | 0.0001 |
Store 1 byte of data in the blockchain directly1 | 0.000001 |
Next, you need to set up the Polycash software on your machine.
The only client currently available is a Golang/Rust implementation
of the Polycash protocol The only client currently available is the
Golang/Rust reference implementation of the Polycash protocol. Visit
https://github.com/ashy5000/cryptocurrency and clone the repository.
Navigate into the repository root and then into the contracts
directory. Run cargo build
and then move back into the repository
root. Then run go build -o builds/node/node_linux-amd64
to
build the node executable. Run this executable to enter theBlockCMD console.
Type keygen
to generate a keypair, and then showPublicKey
to get your public key. Copy the output. This is the address you'll need to
send PCSH to. Once you've obtained some PCSH and sent it to the correct address,
you can start writing your first smart contract.
Start by creating a file called test.poly
. Write the
following contents into the file:
@memory::alloc(exitCode);
@memory::set(exitCode, 2 + 2);
@contract::exit(exitCode);
The above is a simple program written in the Polylang language to
exit a smart contract with the exit code 2 + 2
(4).
Now, navigate into the project root of the reference client, and
then into the language
directory. Build the CMake
project and run the executable with the path to test.poly
as an argument. Then, navigate back one directory to the reference
client's project root. Run the node executable. Once you are in the
BlockCMD console, run the command deploySmartContract
language/out.blockasm
. This will deploy the smart contract
you wrote to the testnet!
(1): Data is stored directly on-chain. Storing data in the VM state costs 3 + 0.7b gas, where b is the number of bytes stored.