Skip to main content

Get started

Smart contracts used by ONCHAINID are accessible on the ONCHAINID Github organization. This source repository is useful should contract be modified to fit a specific use-case.

Compiled contracts are published as a package @onchain-id/solidity on NPM. This package exports compiled bytecode for deployment and ABIs for interaction, as well as typechain generated types.

Blockchain network

A blockchain network is required to deploy and interact with contracts. Public testnets are perfect fits to experiment, remember that only EVM blockchain networks are currently supported by the tooling (@onchain-id/solidity only contains solidity contracts).

For local testing and development, a local network can be configured. Multiple tools are available. We recommend using hardhat.

To setup a local development node, run the following commands:

# create new folder
mkdir onchainid-node
cd onchainid-node
# Init npm project
npm init -y
# install hardhat
npm install --save-dev hardhat
# Init hardhat
npx hardhat init
# Run the node
npx hardhat node

Next time, running the node will only be running npx hardhat node in the folder.

By default, hardhat creates a few addresses with private keys having some test ethers. Addresses will always be the same unless you update the configuration.