Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Zilliqa
https://github.com/zilliqa/zilliqa-developer
Admin
Tokens:
470,727
Snippets:
1,701
Trust Score:
9.5
License:
GPL-3.0
Update:
1 year ago
Context
Chat
Benchmark
0
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Install Rust Nightly and Trunk Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/bluebell/examples/getting-started.md Commands to install the nightly version of Rust, the Trunk build tool for WebAssembly, and the necessary WebAssembly target. Also includes installing Tailwind CSS for the playground. ```bash rustup install nightly rustup target add wasm32-unknown-unknown cargo install trunk npm install tailwindcss ``` -------------------------------- ### Run Zilliqa CLI for Hello World Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/bluebell/examples/getting-started.md Command to execute the Zilliqa CLI tool to run a 'Hello World' example written in Scilla. It specifies the contract file, backend, entry point, and arguments. ```bash cargo run --bin cli -- examples/hello-world.scilla --runtime-enable debug run --backend evm --entry-point "HelloDebugModule::setHello" --args "[\"Zilliqa ❤️ Rocks\"]" ``` -------------------------------- ### Setup and Run Zilliqa Example (Bash) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/scilla-cookbook/recipes/contract-recipes/zilliqa-js-quickstart.md This bash script outlines the steps to set up and run a Zilliqa JavaScript example. It includes cloning the repository, navigating into the project directory, installing dependencies using npm, and executing the specific example script. ```bash git clone Zilliqa/Zilliqa-JavaScript-Library-Examples . cd Zilliqa-JavaScript-Library-Examples cd node npm i node helloWorld.js ``` -------------------------------- ### Setup and Run ZilliqaJS NodeJS Examples Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/js-library-examples/node/README.md This snippet outlines the steps to set up the ZilliqaJS environment in Node.js, including installing dependencies and running the main example script. It requires Node.js and npm/yarn. ```bash cd node yarn add @zilliqa-js/zilliqa yarn add tslib yarn add bn.js yarn install node helloWorld.js ``` -------------------------------- ### Serve Zilliqa Playground Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/bluebell/examples/getting-started.md Commands to navigate to the playground directory, build Tailwind CSS for styling, and serve the Zilliqa playground application using Trunk. ```bash cd playground NODE_ENV=production tailwindcss -c ./tailwind.config.js -o ./tailwind.css --minify trunk serve ``` -------------------------------- ### Install Zilliqa-js SDK Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/scilla-cookbook/tutorials/interaction-tutorials/incrementing-button-interaction/introduction.md Installs the latest zilliqa-js SDK using npm. This is the recommended way for frontend and backend Javascript frameworks to interact with the blockchain. ```bash npm install @zilliqa-js/zilliqa --save ``` -------------------------------- ### Build and Setup Zilliqa Webpack Variant Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/js-library-examples/webpack/react/README.md Steps to clone the Zilliqa JavaScript library, install dependencies, build the webpack variant, and set up a React project. ```bash git clone https://github.com/Zilliqa/Zilliqa-JavaScript-Library cd Zilliqa-JavaScript-Library yarn install yarn build:web ``` ```bash cp Zilliqa-JavaScript-Library/dist/zilliqa.min.js examples/webpack/react/public cd examples/webpack/react yarn yarn start ``` -------------------------------- ### Compile Zilliqa Project Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/bluebell/examples/getting-started.md Command to compile the Zilliqa project using Cargo, the Rust build system and package manager. ```bash cargo build ``` -------------------------------- ### Install and Test Zilliqa Application Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/multisig/README.md Commands for installing project dependencies, running tests, and linting the code. ```bash npm install npm run test npm run lint npm run test:unit ``` -------------------------------- ### Scilla Contract with State Management Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/bluebell/examples/getting-started.md A Scilla smart contract demonstrating state management. It includes a field to store a welcome message and a transition to update and retrieve it. ```scilla scilla_version 0 library HelloState contract HelloState() field welcome_msg : Uint64 = Uint64 0 transition setHello (msg : Uint64) welcome_msg := msg; msg <- welcome_msg; x = builtin print msg end ``` -------------------------------- ### Clone Zilliqa Hello World Front-End Example Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/dev/dev-started-helloworld.mdx This snippet shows how to clone the Zilliqa Hello World front-end example repository, which serves as a starting point for interacting with Zilliqa smart contracts from a web application. ```bash git clone https://github.com/Zilliqa/dev-portal-examples.git ``` -------------------------------- ### Setup Rust for Playground Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/bluebell/README.md Instructions for setting up the Rust environment to run the Bluebell playground. This involves installing Rust, adding Wasm support, and installing the Trunk build tool. ```bash rustup target add wasm32-unknown-unknown ``` ```bash cargo install trunk ``` ```bash trunk serve ``` -------------------------------- ### Project Setup and Development Commands Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/neo-savant/README.md Commands for installing dependencies, compiling for development and production, running tests, and linting files for the Neo-savant IDE project. ```bash yarn install ``` ```bash yarn dev ``` ```bash yarn build ``` ```bash npm run test ``` ```bash yarn lint ``` -------------------------------- ### Get Zilliqa Contract Init (Go) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/dev/dev-keys-zrc2-wallet-support.mdx Presents a Go example for fetching the immutable initialization parameters of a Zilliqa smart contract using the Zilliqa Go SDK. ```go func GetSmartContractInit() { provider := NewProvider("https://api.zilliqa.com/") response := provider.GetSmartContractInit("173Ca6770Aa56EB00511Dac8e6E13B3D7f16a5a5") result, _ := json.Marshal(response) fmt.Println(string(result)) } ``` -------------------------------- ### Scilla Hello World Contract Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/bluebell/examples/getting-started.md A basic 'Hello World' smart contract written in Scilla, the Zilliqa smart contract language. It defines a transition to print a message. ```scilla scilla_version 0 library HelloDebugModule contract HelloDebugModule() transition setHello (msg : Uint64) x = builtin print msg end ``` -------------------------------- ### Setup Zilliqa Mining Environment Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/needs-refactor/developer-guide/Mining.md Commands to set up the local mining environment by creating directories and downloading configuration files for Zilliqa. ```shell cd ~/Desktop && mkdir join && cd join ``` ```shell wget https://mainnet-join.zilliqa.com/configuration.tar.gz tar zxvf configuration.tar.gz ``` -------------------------------- ### Install Dependencies and Build Zilliqa (Native) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/exchanges/exchange-ip-whitelisting.md This snippet outlines the process for setting up a Zilliqa seed node natively on Ubuntu. It includes cloning the Zilliqa repository, installing numerous system dependencies via apt-get, installing a specific CMake version, installing Python dependencies, and finally building the Zilliqa binary. ```sh # clone Zilliqa source files $ git clone https://github.com/Zilliqa/Zilliqa.git && cd Zilliqa && git checkout tags/<tag_id> # install system dependencies $ sudo apt-get update && sudo apt-get install \ git \ libboost-system-dev \ libboost-filesystem-dev \ libboost-test-dev \ libssl-dev \ libleveldb-dev \ libjsoncpp-dev \ libsnappy-dev \ cmake \ libmicrohttpd-dev \ libjsonrpccpp-dev \ build-essential \ pkg-config \ libevent-dev \ libminiupnpc-dev \ libcurl4-openssl-dev \ libboost-program-options-dev \ libboost-python-dev \ python3-dev \ python3-setuptools \ python3-pip \ gawk # Run the following to install latest version of cmake. # We suggest to install cmake 3.19 or any version >=3.16: wget https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh mkdir -p "${HOME}"/.local bash ./cmake-3.19.3-Linux-x86_64.sh --skip-license --prefix="${HOME}"/.local/ export PATH=$HOME/.local/bin:$PATH cmake --version rm cmake-3.19.3-Linux-x86_64.sh $ export LC_ALL=C $ pip3 install requests clint futures # build the binary. this may take a while. $ ./build.sh ``` -------------------------------- ### Setup Zilliqa Mining Environment Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/needs-refactor/developer-guide/Mining.md Commands to set up the Zilliqa mining environment, including creating directories, downloading configuration files, and retrieving the IP address. ```shell cd ~/Desktop && mkdir join && cd join ``` ```shell wget https://mainnet-join.zilliqa.com/configuration.tar.gz tar zxvf configuration.tar.gz ``` ```shell curl https://ipinfo.io/ip ``` -------------------------------- ### Start Create React App Development Server Source: https://github.com/zilliqa/zilliqa-developer/blob/main/examples/zilliqa-js/react-zilliqa-js/README.md Runs the React application in development mode, providing hot reloading and linting feedback in the console. Access the app at http://localhost:3000. ```bash yarn start ``` -------------------------------- ### Start Snapshot Hub Server Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/governance-api/README.md Starts the snapshot-hub REST API server. This command is used to run the application after dependencies have been installed. ```bash npm start ``` -------------------------------- ### Build Zilliqa Webpack Variant Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/js-library-examples/webpack/html/README.md Steps to clone the Zilliqa JavaScript Library, install dependencies, and build the webpack variant to generate the `zilliqa.min.js` file. ```bash git clone https://github.com/Zilliqa/Zilli-JavaScript-Library cd Zilliqa-JavaScript-Library yarn install yarn build:web ``` -------------------------------- ### Scilla Contract with Default Values Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/bluebell/examples/getting-started.md A Scilla smart contract example showcasing the use of default values and optional types. It defines a field with a default value and a transition to update it, handling `None` values. ```scilla scilla_version 0 library DefaultValuesExample contract DefaultValuesContract() field data : Uint128 = Uint128 100 transition UpdateData(newData : Option Uint128) match newData with | Some val => data := val | None => (* Do nothing, keep the default value *) end end ``` -------------------------------- ### Install Zilliqa JS Dependencies Source: https://github.com/zilliqa/zilliqa-developer/blob/main/examples/zilliqa-js/latest-block/README.md Installs all necessary Zilliqa JavaScript SDK packages and their dependencies using npm. ```sh npm install @zilliqa-js/zilliqa @zilliqa-js/crypto @zilliqa-js/util @zilliqa-js/core @zilliqa-js/account @zilliqa-js/contract @zilliqa-js/blockchain ``` -------------------------------- ### Project Setup and Build Commands Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/governance-snapshot/README.md Provides essential npm commands for setting up the project, running the development server, building for production, and linting the code. ```bash npm install ``` ```bash npm run serve ``` ```bash npm run build ``` ```bash npm run lint ``` -------------------------------- ### Start ZilMiner Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/miners/mining-zilminer.md Command to start the ZilMiner process for mining Zilliqa. It requires specifying the wallet address, worker name, Zilliqa node IP, and the get work port. These parameters need to be customized based on the user's setup. ```bash zilminer -P zil://wallet_address.worker_name@zil_node_ip:get_work_port ``` -------------------------------- ### Full Zilliqa Project Example Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/dev/dev-tools-zilliqars.md A complete Rust program demonstrating Zilliqa contract deployment, state retrieval, and transition calls. It includes setting up the wallet, provider, sending transactions, and interacting with a HelloWorld contract. ```rust use std::error::Error; use zilliqa_rs:: contract::HelloWorld, core::CreateTransactionResponse, middlewares::Middleware, providers::{Http, Provider}, signers::LocalWallet, transaction::TransactionBuilder, core::parse_zil, ; #[tokio::main] async fn main() -> Result<(), Box<dyn Error>> { // Create the signer. let wallet = "0xe53d1c3edaffc7a7bab5418eb836cf75819a82872b4a1a0f1c7fcf5c3e020b89" .parse::<LocalWallet>()?; // Create the provider with a signer. let provider = Provider::<Http>::try_from("http://127.0.0.1:5555")? .with_chain_id(222) .with_signer(wallet.clone()); // Call a JSON-RPC endpoint. let balance = provider .get_balance("0x381f4008505e940ad7681ec3468a719060caf796") .await; println!("{balance:?}"); // Send a transaction let receiver = LocalWallet::create_random()?; let tx = TransactionBuilder::default() .to_address(receiver.address.clone()) .amount(parse_zil("2.0")?) .gas_price(2000000000u128) .gas_limit(50u64) .build(); provider .send_transaction_without_confirm::<CreateTransactionResponse>(tx) .await?; let balance = provider.get_balance(&receiver.address).await; println!("{balance:?}"); // Deploy a contract let contract = HelloWorld::deploy(provider.into(), wallet.address).await?; println!("Contract address: {:?}", contract.address()); println!("Contract owner: {:?}", contract.owner().await?); println!("Welcome msg: {}", contract.welcome_msg().await?); contract.set_hello("Salaam".to_string()).call().await?; println!("Welcome msg: {}", contract.welcome_msg().await?); Ok(()) } ``` -------------------------------- ### Install Dependencies and Run Zilliqa Dev Explorer Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/devex/README.md Commands to install project dependencies, run the application locally on port 3000, and build the application for production. ```sh yarn install yarn start yarn build ``` -------------------------------- ### Get Zilliqa Contract Init (Java) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/dev/dev-keys-zrc2-wallet-support.mdx Provides a Java example for retrieving the immutable initialization parameters of a Zilliqa smart contract via the Zilliqa API. ```java public class App { public static void main(String[] args) throws IOException { HttpProvider client = new HttpProvider("https://api.zilliqa.com"); Rep<List<Contract.State>> smartContractInit = client.getSmartContractInit("173Ca6770Aa56EB00511Dac8e6E13B3D7f16a5a5"); System.out.println(new Gson().toJson(smartContractInit)); } } ``` -------------------------------- ### Build Zilliqa JS Monorepo (Shell) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/examples/zilliqa-js/latest-block/README.md Installs dependencies and builds all packages within the Zilliqa JavaScript monorepo. This is a prerequisite for using the SDK in a boilerplate project. ```sh pnpm i -r pnpm -r build ``` -------------------------------- ### Initialize TypeScript Project (Shell) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/examples/zilliqa-js/latest-block/README.md Initializes a new Node.js project with TypeScript support, including installing necessary development dependencies and generating a tsconfig.json file. ```sh npm init npm install --save-dev typescript @types/node npx tsc --init ``` -------------------------------- ### Install and Initialize Zilliqa SDK in NodeJS Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/js-library-examples/README.md Demonstrates how to add the Zilliqa JavaScript SDK to a NodeJS project using Yarn and initialize a Zilliqa instance connected to the dev-api. ```bash yarn add `@zilliqa-js/zilliqa` ``` ```javascript const { Zilliqa } = require('@zilliqa-js/zilliqa'); const zilliqa = new Zilliqa('https://dev-api.zilliqa.com'); ``` -------------------------------- ### Serve and Build Zilliqa Application Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/multisig/README.md Commands to serve the application for local development with hot-reloading and to build a minified version for production. ```bash npm run serve npm run build ``` -------------------------------- ### Get Zilliqa Smart Contract State (Go) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/dev/dev-keys-zrc2-wallet-support.mdx This Go code example illustrates how to fetch the state of a Zilliqa smart contract. It initializes a provider with the Zilliqa API endpoint and calls GetSmartContractState with the contract address, then marshals and prints the response. ```Go func GetSmartContractState() { provider := NewProvider("https://api.zilliqa.com/") response := provider.GetSmartContractState("173Ca6770Aa56EB00511Dac8e6E13B3D7f16a5a5") result, _ := json.Marshal(response) fmt.Println(string(result)) } ``` -------------------------------- ### Deploying Applications with 'z' Tool Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/governance-snapshot/README.md Demonstrates the initial steps for deploying applications using the 'z' command-line tool, including cloning the devops repository and sourcing environment variables. ```bash git clone https://github.com/Zilliqa/devops.git cd devops source setenv ``` -------------------------------- ### Get Latest Zilliqa Block (TypeScript) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/examples/zilliqa-js/latest-block/README.md Fetches the latest transaction block from the Zilliqa blockchain using the Zilliqa JavaScript SDK. This example initializes the Zilliqa provider and calls the getLatestTxBlock method. ```typescript import { Zilliqa } from "@zilliqa-js/zilliqa"; async function main() { const provider = new Zilliqa("https://api.zilliqa.com/"); const latestBlock = await provider.blockchain.getLatestTxBlock(); console.log(latestBlock); } main(); ``` -------------------------------- ### Build Create React App for Production Source: https://github.com/zilliqa/zilliqa-developer/blob/main/examples/zilliqa-js/react-zilliqa-js/README.md Creates an optimized production build of the React application in the `build` folder. This process minifies the code and includes content hashes in filenames for efficient deployment. ```bash yarn build ``` -------------------------------- ### Deploy Zilliqa Contract Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/scilla-boilerplate/dist/templates/blank-project/readme.md Deploy a Zilliqa smart contract after configuring network and account details in a .env file and initialization parameters in init.json. This command initiates the deployment process. ```Bash npm run deploy ``` -------------------------------- ### Install CMake Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/needs-refactor/developer-guide/Mining.md Downloads, installs, and configures a specific version of CMake (3.19.3) for building Zilliqa. It ensures the correct version is available in the PATH. ```shell wget https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh mkdir -p "${HOME}"/.local bash ./cmake-3.19.3-Linux-x86_64.sh --skip-license --prefix="${HOME}"/.local/ export PATH=$HOME/.local/bin:$PATH cmake --version rm cmake-3.19.3-Linux-x86_64.sh ``` -------------------------------- ### Install Bazelisk with Homebrew (macOS) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/README.md Installs Bazelisk on macOS using the Homebrew package manager, simplifying the setup process for developers on this platform. ```bash brew install bazelisk ``` -------------------------------- ### Deploy Zilliqa Smart Contract Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/scilla-boilerplate/dist/templates/hello-world/readme.md Deploys the Scilla smart contract to the Zilliqa network. Requires a .env file for network and account configuration, and an init.json file for initialization parameters. ```Shell npm run deploy ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/governance-api/README.md Installs the necessary dependencies for the snapshot-hub project using npm. This is a prerequisite for starting the server and running the application. ```bash npm install ``` -------------------------------- ### HTML Structure for ZilliqaJS Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/js-library-examples/webpack/html/README.md An example HTML file (`index.html`) that includes the necessary script tags to load the ZilliqaJS library (`zilliqa.min.js`), a usage example (`index.js`), and a keystore demo (`load-keystore-demo.js`). ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <!-- Please generate zilliqa-min.js using yarn build:web-->> <script src="zilliqa.min.js"></script> <script src="index.js"></script> <script src="load-keystore-demo.js"></script> </head> <body> </body> </html> ``` -------------------------------- ### Get Zilliqa Contract States Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/dev/dev-tools-zilliqars.md Retrieves the immutable and mutable states of a deployed Zilliqa contract. This example shows how to get the 'owner' and 'welcome_msg' states. ```rust println!("Contract owner: {:?}", contract.owner().await?); println!("Welcome msg: {}", contract.welcome_msg().await?); ``` -------------------------------- ### Local Development Environment Setup with 'z' Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/neo-savant/README.md Steps to set up and deploy the Neo-savant application to a local development environment using the 'z' CLI tool. This includes configuring environment variables, creating a local cluster, applying manifests, building and pushing Docker images, and syncing the application. ```sh cd ./products/neo-savant export Z_ENV=z.yaml export ZQ_USER=<user_id>@zilliqa.com z local create z k-apply make image/build-and-push z app sync ``` -------------------------------- ### Zilliqa Node JSON-RPC Response Example Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/exchanges/exchange-ip-whitelisting.md Example of a successful JSON-RPC response from a Zilliqa seed node, indicating the GetBlockchainInfo method worked correctly. ```json {"id":"1","jsonrpc":"2.0","result":{"CurrentDSEpoch":"4789","CurrentMiniEpoch":"478809","DSBlockRate":0.00013455546527607284,"NumDSBlocks":"4790","NumPeers":2400,"NumTransactions":"3091806","NumTxBlocks":"478809","NumTxnsDSEpoch":"185","NumTxnsTxEpoch":"0","ShardingStructure":{"NumPeers":[600,600,600]},"TransactionRate":0,"TxBlockRate":0.013450003515398927}} ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/needs-refactor/developer-guide/Mining.md Installs necessary Python packages, including `request`, `requests`, `clint`, and `futures`, using `pip`. It also sets the `LC_ALL` environment variable. ```shell sudo apt install python-pip export LC_ALL=C pip install request requests clint futures ``` -------------------------------- ### Interact with Zilliqa HelloWorld Tutorial Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/scilla-cookbook/recipes/contract-recipes/zilliqa-js-quickstart.md Demonstrates the JavaScript required to interact with the HelloWorld tutorial smart contract on Zilliqa. This is a common starting point for learning Zilliqa development. ```javascript //shows the javascript required to interact with the helloWorld tutorial scilla helloWorld.js ``` -------------------------------- ### Install Zilliqa Dependencies (Ubuntu) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/needs-refactor/developer-guide/Mining.md Installs essential dependencies required for building the Zilliqa client on Ubuntu systems. This includes development tools, libraries, and Python packages. ```shell sudo apt-get update sudo apt-get install git libboost-system-dev libboost-filesystem-dev libboost-test-dev \ libssl-dev libleveldb-dev libjsoncpp-dev libsnappy-dev libmicrohttpd-dev \ libjsonrpccpp-dev build-essential pkg-config libevent-dev libminiupnpc-dev \ libprotobuf-dev protobuf-compiler libcurl4-openssl-dev libboost-program-options-dev \ libssl-dev python3-dev libboost-python-dev python3-setuptools python3-pip gawk ``` -------------------------------- ### Build and Use Zilliqa SDK in HTML Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/examples/js-library-examples/README.md Provides steps to clone the Zilliqa JavaScript Library repository, build the minified JavaScript file for web use, and copy it for integration into a React project. ```bash git clone https://github.com/Zilliqa/Zilliqa-JavaScript-Library cd Zilliqa-JavaScript-Library yarn install yarn build:web cp Zilliqa-JavaScript-Library/dist/zilliqa.min.js /webpack/react/public cd webpack/react yarn install yarn build:web ``` -------------------------------- ### Build and Run Developer Portal Documentation Locally Source: https://github.com/zilliqa/zilliqa-developer/blob/main/README.md Builds and runs the Docker image for the developer portal documentation locally using ibazel. This starts a server on port 8000 and automatically recompiles on file changes. ```bash ibazel run //products/developer-portal:dev-image ``` -------------------------------- ### Check OpenCL Driver Installation Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/needs-refactor/developer-guide/Mining.md Verifies the correct installation and recognition of OpenCL drivers on the system. This command lists detected OpenCL platforms and devices, confirming driver functionality. ```bash clinfo ``` -------------------------------- ### Install Dependencies (Go) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/products/faucet-service/README.md Installs project dependencies using the Make build tool. This command is essential for setting up the development environment. ```Shell make deps ``` -------------------------------- ### Deploy Hello World Contract on Zilliqa Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/newdocs/developer-portal/docs/dev/dev-education-videos.mdx This video demonstrates how to deploy a 'Hello World' smart contract on the Zilliqa blockchain using their online IDE. It also provides an explanation of the contract's components and a link to the relevant documentation for further details. ```Scilla // Link to Hello World contract code with explanation: https://scilla.readthedocs.io/en/latest/scilla-by-example.html#helloworld ``` -------------------------------- ### Initialize Zilliqa and Wallet Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/docs/sdks/zilliqa-js/index.md Initializes the Zilliqa SDK with the developer API endpoint and sets up a wallet using a private key. It also demonstrates how to derive and display the account's Zilliqa and Bech32 addresses. ```javascript const { BN, Long, bytes, units } = require("@zilliqa-js/util"); const { Zilliqa } = require("@zilliqa-js/zilliqa"); const { toBech32Address, getAddressFromPrivateKey, } = require("@zilliqa-js/crypto"); const zilliqa = new Zilliqa("https://dev-api.zilliqa.com"); const chainId = 333; // chainId of the developer testnet const msgVersion = 1; // current msgVersion const VERSION = bytes.pack(chainId, msgVersion); const privateKey = "3375F915F3F9AE35E6B301B7670F53AD1A5BE15D8221EC7FD5E503F21D3450C8"; zilliqa.wallet.addByPrivateKey(privateKey); const address = getAddressFromPrivateKey(privateKey); console.log(`My account address is: ${address}`); console.log(`My account bech32 address is: ${toBech32Address(address)}`); ``` -------------------------------- ### Install OpenCL Driver (Ubuntu) Source: https://github.com/zilliqa/zilliqa-developer/blob/main/needing-organisation/needs-refactor/developer-guide/Mining.md Installs the OpenCL ICD loader and development files required for GPU mining on Ubuntu. This package provides the necessary libraries for OpenCL-compatible GPUs (AMD/Nvidia) to function with Zilliqa. ```bash sudo apt install ocl-icd-opencl-dev ```