### Run Node.js DApp Commands Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/tutorials/basics.md.txt Navigate to your DApp's directory and run these commands to install dependencies and start the application. ```bash cd mycontract npm install npm start ``` -------------------------------- ### Run Node.js DApp Source: https://docs.evernode.org/en/latest/sdk/hotpocket/tutorials/basics.html Navigate to your DApp directory, install dependencies, and start the application. This command builds and deploys your DApp to the HotPocket cluster. ```bash cd mycontract npm install npm start ``` -------------------------------- ### Install Evernode Kit as a Global CLI Tool Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/evernodekit/overview.md.txt Install the Evernode Kit globally using npm. Ensure Node.js and Docker are installed as prerequisites. ```bash npm install evernode -g ``` -------------------------------- ### Generate and Start a NodeJs HotPocket Contract Source: https://docs.evernode.org/en/latest/sdk/hotpocket/hpdevkit/overview.html Create a new NodeJs smart contract project, install its dependencies, and start the development server. This command builds and deploys the contract to a local HotPocket cluster. ```bash hpdevkit gen nodejs starter-contract myproj cd myproj npm install npm start ``` -------------------------------- ### Install Evernode CLI Globally Source: https://docs.evernode.org/en/latest/sdk/evernode/evernodekit/overview.html Install the Evernode CLI tool globally on your machine. Ensure Node.js and Docker are installed as prerequisites. ```bash npm install evernode -g ``` -------------------------------- ### Client Connection Output Example Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/tutorials/multinode.md.txt Example output when a client successfully connects to a HotPocket node using a specified port. ```text Connecting to wss://localhost:8081 Connected to wss://localhost:8081 HotPocket Connected. Saying hello... ``` -------------------------------- ### Copy and Execute Start Script in Dockerfile Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/custom-docker.md.txt Add these lines to your Dockerfile to copy a custom start script and make it executable. This script will be run when the container starts. ```dockerfile COPY start.sh /usr/local/bin/hotpocket/start.sh RUN chmod +x /usr/local/bin/hotpocket/start.sh ``` -------------------------------- ### Start All Nodes Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/hpdevkit/overview.md.txt Starts all nodes currently in the HotPocket cluster. ```bash hpdevkit start ``` -------------------------------- ### Example Transaction Output Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/tutorials/multisig.md.txt This is an example of the output you will see in the client console if a multi-sign transaction is successful. ```bash (ledger:232)>> { hash: '549AC22564273BF6BDE60333CB616EACEF3E0CF03103663B1419E1E035083A57', lastLedgerSequence: 11767630, resultCode: 'tesSUCCESS' } ``` -------------------------------- ### Install evdevkit Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/evdevkit/overview.md.txt Installs the Evernode developer kit globally using npm. On Linux, root privileges are required, so use `sudo`. ```bash npm i evdevkit -g ``` -------------------------------- ### Install Evernode Testnet on Ubuntu 20.04 Source: https://docs.evernode.org/en/latest/_sources/hosts/evernode-testnet-host.md.txt Run this command to install Evernode testnet on Ubuntu 20.04. Requires root (sudo) access. ```bash curl -fsSL https://raw.githubusercontent.com/EvernodeXRPL/evernode-resources/main/sashimono/installer/evernode.sh | sudo NETWORK=testnet bash -s install ``` -------------------------------- ### Cluster Creation Output Example Source: https://docs.evernode.org/en/latest/sdk/evernode/tutorials/deploy-cluster.html This is an example of the output you might see after successfully creating an Evernode cluster, including instance details. ```json ... Cluster created! ... Archive finished. (location: $HOME/bundle/bundle.zip) ... Contract bundle uploaded! Created the 5 node cluster! [ { host: 'rDKgSroMoh5Ur1EDxFZnGJXzk2MFeDg3ts', name: '000100008729E98B90DCE8BFE77867DBFE2FE31193169B059699D576000000DB', ip: 'evernode.xumm.dev', pubkey: 'ed0b77366a0202a1573d83ea3c18f73bda23592f190165abb9e82ee03379978014', contract_id: 'eb051608-c916-4f48-a8dc-a906b6e1f19d', peer_port: '22861', user_port: '8081', gp_tcp_port: '36525', gp_udp_port: '39064' }, { host: 'rKRjgkwZABgh6e38cES7aor6cLjFETkpBA', name: '00010000CA1FE108B76979D1557CE80B7BD8103E5942D26893E8B1C300000028', ip: '45.32.197.83', pubkey: 'ed3bd71ef91da28eb4e704ca41618a059e2effabd064c49b226d2edec6cbc5b40b', contract_id: 'eb051608-c916-4f48-a8dc-a906b6e1f19d', peer_port: '22861', user_port: '26201', gp_tcp_port: '36525', gp_udp_port: '39064' }, { host: 'rn49hoLXBY2AnZG4d2EvqVQGLfWaExh9eE', name: '000100002FDFF898274403F4C3A2256611FC885C956ACF32AACE82C400000029', ip: '149.28.92.171', pubkey: 'ed0d1f25e338cc9531130d5c590bdd118b677eec9d4796868128543aaad1ccdbdf', contract_id: 'eb051608-c916-4f48-a8dc-a906b6e1f19d', peer_port: '22861', user_port: '26201', gp_tcp_port: '36525', gp_udp_port: '39064' }, { host: 'rBWAXbwQSGwYg5NPmdVWsQkXTS7fdRhCXL', name: '00010000735AD68125616A771D288703D5335E2503B28187FA05B7E90000004E', ip: '79.173.139.104', pubkey: 'ed1f802792d9e5b4dc8b9a73d93689fb9321a993afdb8077f91611695137be87cd', contract_id: 'eb051608-c916-4f48-a8dc-a906b6e1f19d', peer_port: '22861', user_port: '26200', gp_tcp_port: '36525', gp_udp_port: '39064' }, { host: 'rKQyXCJGv1B3cqkpykvHYM97H2mVSqJkP9', name: '00010000C9FB04D9E46A6F320A4533AB0AD69DE8C15391100000099B00000000', ip: '172.104.131.188', pubkey: 'edaa2f1705f2182e49902544a2ff1433dd745185b42c4857fd7b244eace86e0da1', contract_id: 'eb051608-c916-4f48-a8dc-a906b6e1f19d', peer_port: '22861', user_port: '26201', gp_tcp_port: '36525', gp_udp_port: '39064' } ] ``` -------------------------------- ### Deploy HotPocket Smart Contract Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/evernodekit/overview.md.txt Modify the `start` script in `package.json` to use `evernodecli hp-deploy dist`. Then, run `npm start` to build and deploy the contract. This command also starts monitoring the HotPocket instance console output. ```bash npm start ``` -------------------------------- ### Build Contract Binaries Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/tutorials/multisig.md.txt Run this command to prepare your contract's executables and required files in the `dist` directory. Ensure you have npm installed. ```bash npm i && npm run build ``` -------------------------------- ### Install Evernode Testnet on Ubuntu 24.04 Source: https://docs.evernode.org/en/latest/_sources/hosts/evernode-testnet-host.md.txt Run this command to install Evernode testnet on Ubuntu 24.04. Requires root (sudo) access. ```bash curl -fsSL https://raw.githubusercontent.com/EvernodeXRPL/evernode-24-resources/main/sashimono/installer/evernode.sh | sudo NETWORK=testnet bash -s install ``` -------------------------------- ### View Evernode CLI Help Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/evernodekit/overview.md.txt After installation, use the `evernodecli help` command to view all available commands. ```bash evernodecli help ``` -------------------------------- ### Deploy Node.js Smart Contract Source: https://docs.evernode.org/en/latest/sdk/evernode/evernodekit/overview.html After generating a contract, modify the 'start' script in package.json to use 'evernodecli hp-deploy dist' for deployment. Then, run 'npm start' to build and deploy the contract, and monitor its console output. ```bash npm start ``` -------------------------------- ### Start Docker Container Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/troubleshoot/troubleshoot.md.txt Use this command to start a specific Docker container if it is not running. Verify its status with `docker ps -a`. ```bash docker start ``` -------------------------------- ### Install Evernode on Ubuntu 24.04 Source: https://docs.evernode.org/en/latest/hosts/evernode-host.html Use this command to install the Evernode version compatible with Ubuntu 24.04. Requires root (sudo) access. ```bash curl -fsSL https://raw.githubusercontent.com/EvernodeXRPL/evernode-24-resources/main/sashimono/installer/evernode.sh | sudo bash -s install ``` -------------------------------- ### New Node Log Output Example Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/tutorials/instance-sync.md.txt Example log output from a newly spawned HotPocket node after running the 'hpdevkit spawn' command. It indicates successful ledger synchronization, displays the node's public key, and shows that the node is not yet part of the UNL. ```log 20230527 00:58:59.212 [inf][hpc] Hpfs ldgr sync: Achieved target:54bad461 /primary/0 These are my cli args [ 'red', 'green', 'blue' ] I'm NOT in the UNL. My public key: edecee17cf622edfe35a6850c462ed86bde9952ecf2179d244f2fb1806b77903aa 20230527 00:59:00.646 [inf][hpc] ****Ledger created**** (lcl:15-a7ef4035 state:3c90183b patch:35968a27) These are my cli args [ 'red', 'green', 'blue' ] I'm NOT in the UNL. My public key: edecee17cf622edfe35a6850c462ed86bde9952ecf2179d244f2fb1806b77903aa ``` -------------------------------- ### Evernode Cluster Creation Output Example Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/deploy-multisig.md.txt This is an example of the output you can expect after successfully creating an Evernode cluster. It includes details for each node, such as host, name, public key, contract ID, ports, and signer information. ```json ... Cluster created! ... Archive finished. (location: $HOME/bundle/bundle.zip) ... Contract bundle uploaded! Created the 3 node cluster! [ { host: 'rH8oZBoCQJE1aGwdNRH7icr93RrZkbVaaa', name: '086D3B9FDF60EDCDB2291FD0844FC602235200C839BF8BE14EA91BA82A2B105B', pubkey: 'edd5cebbbd56984a1e728ec16b0f38d048bcc10bef00699c3db0b7b6440f10c1e2', contract_id: '0621b671-8497-49d2-bd4a-5286d38351c0', peer_port: '22867', user_port: '26207', gp_tcp_port: '36531', gp_udp_port: '39016', domain: '45.77.199.188', outbound_ip: '2001:19F0:9002:18D1:0000:0000:0000:0004', created_timestamp: 1710428235311, signer_detail: { account: 'r4KsqnUjUTqLhPxQdKMACVCmmZp2JRNwWA', secret: 'spFA5X1rDNbjRv2aNvpzbfRPBd9Xv', weight: 1 }, life_moments: 1, uploaded: true }, { host: 'rH8oZBoCQJE1aGwdNRH7icr93RrZkbVaaa', name: '3335FB10C49796FC9DF172C6C1122A27FC9D79B6964214A71EFE06C51AB59911', pubkey: 'edaef7bd1250af4c71353d7a237bfd8973d55605a4a324c9881870341c96ac574c', contract_id: '0621b671-8497-49d2-bd4a-5286d38351c0', peer_port: '22866', user_port: '26206', gp_tcp_port: '36529', gp_udp_port: '39014', domain: '45.77.199.188', outbound_ip: '2001:19F0:9002:18D1:0000:0000:0000:0002', created_timestamp: 1710428271929, signer_detail: { account: 'r1CW4YKJzUddKTg76St1wcm9wqxsD7iAq', secret: 'sp8jToG54fTEJ4C4Xdti7yPtjSjE8', weight: 1 }, life_moments: 1, uploaded: true }, { host: 'rH8oZBoCQJE1aGwdNRH7icr93RrZkbVaaa', name: 'A8C76E7F0A90B0385244F5BAEA8AA971FF4F4569029FE67926EBC4983B9A88F5', pubkey: 'ed6f417fa7d7aa9c65b52d5e17d50290c1574eaabf7bba2dcd2d7dbf93adc83ee0', contract_id: '0621b671-8497-49d2-bd4a-5286d38351c0', peer_port: '22865', user_port: '26205', gp_tcp_port: '36527', gp_udp_port: '39012', domain: '45.77.199.188', outbound_ip: '2001:19F0:9002:18D1:0000:0000:0000:0003', created_timestamp: 1710428312388, signer_detail: { account: 'rB2kjE5YcLZtpqfFqmmp219L1QfHHZEwnR', secret: 'ssA2fsawnm8zJEsA8V1M4qqo8tXH7', weight: 1 }, life_moments: 1, uploaded: true } ] ``` -------------------------------- ### HotPocket DApp Log Output Example Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/tutorials/basics.md.txt Example console output from a running HotPocket node, showing ledger creation and contract execution status. ```log 20220821 09:23:50.213 [inf][hpc] ****Ledger created**** (lcl:1-a80e9b9d state:aab8e909 patch:7365a671) Blank contract 20220821 09:23:51.209 [inf][hpc] ****Ledger created**** (lcl:2-55e988d9 state:aab8e909 patch:7365a671) Blank contract 20220821 09:23:52.209 [inf][hpc] ****Ledger created**** (lcl:3-835c39b2 state:aab8e909 patch:7365a671) Blank contract ``` -------------------------------- ### Run HotPocket Client Application Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/tutorials/basics.md.txt Navigate to the client directory, install dependencies, and run the client application using these commands. Ensure the HotPocket node is already running. ```bash cd myclient npm install node myclient.js ``` -------------------------------- ### Resolving Stuck Evernode Installations Source: https://docs.evernode.org/en/latest/_sources/hosts/evernode-diagnostics.md.txt If Evernode installation hangs on 'Checking server wss:\....', it may be due to broken package dependencies. Remove the setup helpers directory and reinstall. ```bash rm -r /tmp/evernode-setup-helpers ``` -------------------------------- ### Acquire and Deploy Help Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/deploy-single.md.txt Displays the help information for the `acquire-and-deploy` command, listing supported options. ```bash evdevkit acquire-and-deploy --help ``` -------------------------------- ### View HotPocket Node Logs Source: https://docs.evernode.org/en/latest/sdk/hotpocket/tutorials/basics.html Example console output from a running HotPocket node, showing ledger creation and contract execution. ```text 20220821 09:23:50.213 [inf][hpc] ****Ledger created**** (lcl:1-a80e9b9d state:aab8e909 patch:7365a671) Blank contract 20220821 09:23:51.209 [inf][hpc] ****Ledger created**** (lcl:2-55e988d9 state:aab8e909 patch:7365a671) Blank contract 20220821 09:23:52.209 [inf][hpc] ****Ledger created**** (lcl:3-835c39b2 state:aab8e909 patch:7365a671) Blank contract ``` -------------------------------- ### Instance Acquisition Details Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/evdevkit/overview.md.txt Example of the data structure returned when acquiring an instance from Evernode. This includes details like contract ID, public key, and ports. ```javascript { name: "AC53DF1598E419E333F6304A0A5C7581599F20CCF5CF58312337AD0848A2E30D", pubkey: "ed748d39effb987b34b4d205eef5e3bec7297d481c1f31fa283ca1637f8cb2d152", contract_id: "03d85fbc-a8b2-42ba-923e-5a5a0406bb5e", peer_port: 22862, user_port: 26202, gp_tcp_port: 36527, gp_udp_port: 39066, domain: "evernode.rocks", created_timestamp: 1722320990329 } ``` -------------------------------- ### Display Cluster Create Help Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/deploy-multisig.md.txt To see all available options and parameters for the `cluster-create` command, use the `--help` flag. This is useful for customizing cluster creation beyond the basic setup. ```bash evdevkit cluster-create --help ``` -------------------------------- ### tenantClient.connect() Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Connects the client to the XRPL server, loads configurations, and initiates subscriptions. ```APIDOC ## tenantClient.connect() ### Description Connects the client to xrpl server and do the config loading and subscriptions. ‘subscribe’ is called inside this. ### Returns - Boolean value `true` if the connection is successful. ``` -------------------------------- ### Node.js HotPocket Contract Example Source: https://docs.evernode.org/en/latest/sdk/hotpocket/tutorials/instance-sync.html A basic Node.js contract for HotPocket that logs CLI arguments and checks if the node's public key is in the UNL. Ensure 'hotpocket-nodejs-contract' is installed. ```javascript const HotPocket = require("hotpocket-nodejs-contract"); const process = require("process"); const mycontract = async (ctx) => { // Print the cli args passed to our application. console.log("These are my cli args", process.argv.splice(2)); // Indicate whether this node's public key is in the UNL. if (ctx.unl.find(ctx.publicKey)) console.log("I'm in the UNL."); else console.log("I'm NOT in the UNL. My public key:", ctx.publicKey); }; const hpc = new HotPocket.Contract(); hpc.init(mycontract); ``` -------------------------------- ### Preferred Hosts File Example Source: https://docs.evernode.org/en/latest/sdk/evernode/tutorials/deploy-cluster.html Create a text file listing the Xahau addresses of your preferred hosts, one per line. This file is used by the cluster creation command. ```text rVJhd8kTYyBMK8LmETUPA99HMhNd14D4q rerP15ECELmVFXVVRoz4FHy8mhxTAuyW3 rrssGm5h8aWncB3CGMuQ2WGfexubbeCTLV rnzeYqWqUaXDzRcTbwLJ2MsHsc1neZkDx9 ``` -------------------------------- ### Install Evernode on Ubuntu 24.04 Source: https://docs.evernode.org/en/latest/_sources/hosts/evernode-host.md.txt Use this command to install Evernode on Ubuntu 24.04. Ensure your system is up-to-date before running the installer. ```bash curl -fsSL https://raw.githubusercontent.com/EvernodeXRPL/evernode-24-resources/main/sashimono/installer/evernode.sh | sudo bash -s install ``` -------------------------------- ### Complete Custom Dockerfile Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/custom-docker.md.txt This is the complete Dockerfile for building a custom Evernode image. It includes copying watchdog files, a custom start script, and setting the entrypoint. ```dockerfile FROM evernode/sashimono:hp.latest-ubt.20.04-njs.20 RUN mkdir -p /usr/local/bin/hotpocket/watchdog COPY watchdog/dist/* /usr/local/bin/hotpocket/watchdog COPY start.sh /usr/local/bin/hotpocket/start.sh RUN chmod +x /usr/local/bin/hotpocket/start.sh ENTRYPOINT ["/usr/local/bin/hotpocket/start.sh"] ``` -------------------------------- ### Example Output from Node 1 Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/tutorials/instance-sync.md.txt This output shows the ledger creation, the CLI arguments passed to the contract ('red', 'green', 'blue'), and confirmation that the node is part of the UNL. ```text 20230527 00:58:46.650 [inf][hpc] ****Ledger created**** (lcl:1-f192e9d1 state:3c90183b patch:35968a27) These are my cli args [ 'red', 'green', 'blue' ] I'm in the UNL. 20230527 00:58:47.645 [inf][hpc] ****Ledger created**** (lcl:2-bbf23bc9 state:3c90183b patch:35968a27) These are my cli args [ 'red', 'green', 'blue' ] I'm in the UNL. ``` -------------------------------- ### Calculator Contract and Client (Node.js) Source: https://docs.evernode.org/en/latest/sdk/hotpocket/examples.html A Node.js example featuring a calculator contract and its corresponding client. This demonstrates how to create a contract for arithmetic operations and interact with it from a client. ```javascript // Contract: calculator.ts import { Contract, Runtime } from "@hotpocket/core"; export class CalculatorContract extends Contract { @Runtime async add(a: number, b: number): Promise { return a + b; } @Runtime async subtract(a: number, b: number): Promise { return a - b; } } ``` ```javascript // Client: calculator_client.ts import { HotPocketClient } from "@hotpocket/client"; async function main() { const client = new HotPocketClient("http://localhost:8080"); // Replace with your HotPocket node URL const resultAdd = await client.callContract("CalculatorContract", "add", [5, 3]); console.log("5 + 3 = ", resultAdd); const resultSubtract = await client.callContract("CalculatorContract", "subtract", [10, 4]); console.log("10 - 4 = ", resultSubtract); } main().catch(console.error); ``` -------------------------------- ### Start Specific Node Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/hpdevkit/overview.md.txt Starts a specific node in the cluster by providing its node number. ```bash hpdevkit start ``` -------------------------------- ### foundationClient.connect() Source: https://docs.evernode.org/en/latest/_sources/APIs/evernode-js-api.md.txt Connects the client to the XRPL server, loading configuration and initiating subscriptions. ```APIDOC ## foundationClient.connect() ### Description Connects the client to xrpl server and do the config loading and subscriptions. 'subscribe' is called inside this. ### Returns Boolean value `true` if the connection is successful. ``` -------------------------------- ### Install Evernode npm Package Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/evernodekit/overview.md.txt Installs the evernode npm package locally in a Node.js project. ```bash npm install evernode ``` -------------------------------- ### XrplContext.init Source: https://docs.evernode.org/en/latest/_sources/APIs/everpocket-api.md.txt Initializes the XRPL context, preparing it for subsequent operations. ```APIDOC ## xrplContext.init() ### Description Initialize the xrpl context. ``` -------------------------------- ### Preferred Hosts File Example Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/deploy-cluster.md.txt Create a text file listing the Xahau addresses of preferred hosts, one per line. This file is used to specify where to acquire cluster instances from. ```text rVJhd8kTYyBMK8LmETUPA99HMhNd14D4q rerP15ECELmVFXVVRoz4FHy8mhxTAuyW3 rrssGm5h8aWncB3CGMuQ2WGfexubbeCTLV rnzeYqWqUaXDzRcTbwLJ2MsHsc1neZkDx9 ``` -------------------------------- ### TenantClient.prepareAccount Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Prepares the tenant account by setting up account fields and trust lines. ```APIDOC ## tenantClient.prepareAccount([options]) ### Description Prepare the tenant account with account fields and trust lines. ### Parameters #### Path Parameters - **options** (Object) - Optional - Optional configuration for the account setup. ``` -------------------------------- ### Install hpdevkit Globally Source: https://docs.evernode.org/en/latest/_sources/sdk/hotpocket/hpdevkit/overview.md.txt Install the hpdevkit global npm package. On Linux, root privileges are required, so use `sudo`. ```bash npm i hpdevkit -g ``` -------------------------------- ### hostClient.getMomentStartIndex(index) Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Retrieves the start index (timestamp) of a moment. If no index is provided, it returns the start index of the current moment. ```APIDOC ## hostClient.getMomentStartIndex(index) ### Description Get start index (timestamp) of the moment. ### Method instance method of `HostClient` ### Parameters #### Path Parameters - **index** (number) - Optional - Index (timestamp) to get the moment start index. ### Returns The index (timestamp) of the moment as a ‘number’. Returns the current moment’s start index (timestamp) if ledger index parameter is not given. ``` -------------------------------- ### Dockerfile: Override Entrypoint Source: https://docs.evernode.org/en/latest/sdk/evernode/tutorials/custom-docker.html Sets the custom start script as the container's entrypoint, ensuring it runs when the container starts. ```dockerfile ENTRYPOINT ["/usr/local/bin/hotpocket/start.sh"] ``` -------------------------------- ### Bundle DApp Package Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/deploy-single.md.txt Create a deployable DApp package by running the bundle command. Ensure you replace placeholders with your contract directory path, instance public key, and binary details. ```bash evdevkit bundle $HOME/contract edbf186b1bbedf0a3e7351ec969d0aeee40b45831fd924db0a129663ec5920992d /usr/bin/node -a index.js ``` -------------------------------- ### RegistryClient.connect Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Establishes a connection to the XRPL server, loads configuration, and initiates subscriptions. ```APIDOC ## registryClient.connect() ### Description Connects the client to xrpl server and do the config loading and subscriptions. ‘subscribe’ is called inside this. ### Method `connect()` ### Returns Boolean value `true` if the connection is successful. ``` -------------------------------- ### Install hpdevkit Globally Source: https://docs.evernode.org/en/latest/sdk/hotpocket/hpdevkit/overview.html Install the HotPocket developer kit globally using npm. On Linux, you may need to use sudo. ```bash npm i hpdevkit -g ``` -------------------------------- ### Acquire and Deploy Instance with Contract Source: https://docs.evernode.org/en/latest/sdk/evernode/tutorials/deploy-single.html This command simplifies the process by acquiring a new Evernode instance and deploying your contract to it in a single operation. Replace placeholders with your specific contract path, binary details, and the target host's Xahau address. ```bash evdevkit acquire-and-deploy $HOME/contract /usr/bin/node r9kCyGhhwGj3KaSGemFrrPVpXkzVtT2b1N -a index.js ``` ```json ... Instance created! { name: '000100004B2CDD9D208422C913DFB2EDB880FCA30D653644920E65060000006B', pubkey: 'ede6d05dc23bf9aba9cabf6de65d280acc0ba3f2a356484af28b140a125308705d', contract_id: '7902171c-3d34-4c10-a5f7-d436e3525852', peer_port: '22861', user_port: '8081', domain: 'node2.aksumwealth.xyz', outbound_ip: '5.78.76.104', created_timestamp: 1695605219865 } ... Archive finished. (location: $HOME/bundle/bundle.zip) ... Contract bundle uploaded! Contract deployed! ``` ```bash evdevkit acquire-and-deploy --help ``` -------------------------------- ### tenantClient.getMomentStartIndex(index) Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Retrieves the start index (timestamp) of a moment. If no index is provided, it returns the current moment's start index. ```APIDOC ## tenantClient.getMomentStartIndex(index) ### Description Get start index (timestamp) of the moment. ### Parameters #### Path Parameters - **index** (number) - Optional - Index (timestamp) to get the moment start index. ### Returns - The index (timestamp) of the moment as a ‘number’. Returns the current moment’s start index (timestamp) if ledger index parameter is not given. ``` -------------------------------- ### registryClient.getMomentStartIndex(index) Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Retrieves the start index (timestamp) for a given moment. If no index is provided, it returns the start index of the current moment. ```APIDOC ## registryClient.getMomentStartIndex(index) ⇒ ### Description Get start index (timestamp) of the moment. ### Parameters #### Path Parameters - **index** (number) - Optional - Index (timestamp) to get the moment start index. ### Returns The index (timestamp) of the moment as a ‘number’. Returns the current moment’s start index (timestamp) if ledger index parameter is not given. ``` -------------------------------- ### hostClient.connect Source: https://docs.evernode.org/en/latest/_sources/APIs/evernode-js-api.md.txt Connects the client to the XRPL server, loads configuration, and sets up subscriptions. This method is essential for initializing the client's connection. ```APIDOC ## hostClient.connect() ### Description Connects the client to xrpl server and do the config loading and subscriptions. 'subscribe' is called inside this. ### Method Not specified (assumed to be a client-side method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response Boolean value `true` if the connection is successful. #### Response Example (No example provided in source) ``` -------------------------------- ### heartbeatClient.getMomentStartIndex(index) Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Retrieves the start index (timestamp) of a given moment. If no index is provided, it returns the current moment's start index. ```APIDOC ## heartbeatClient.getMomentStartIndex(index) ### Description Get start index (timestamp) of the moment. ### Parameters * **index** (number, optional) - Index (timestamp) to get the moment start index. Defaults to the current moment's start index if not provided. ### Returns The index (timestamp) of the moment as a ‘number’. Returns the current moment’s start index (timestamp) if ledger index parameter is not given. ``` -------------------------------- ### hostClient.offerLease(leaseIndex, leaseAmount, tosHash, outboundIPAddress) Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Creates a lease offer with specified parameters including lease index, amount, terms of service hash, and an optional outbound IP address. ```APIDOC ## hostClient.offerLease(leaseIndex, leaseAmount, tosHash, outboundIPAddress) ### Description Create a lease offer. ### Parameters #### Path Parameters - **leaseIndex** (number) - Required - Index number for the lease. - **leaseAmount** (number) - Required - Amount (EVRs) of the lease offer. - **tosHash** (string) - Required - Hex hash of the Terms Of Service text. - **outboundIPAddress** (string) - Optional - Assigned IP Address. ``` -------------------------------- ### baseEvernodeClient.getMomentStartIndex(index) Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Retrieves the start index (timestamp) of a specific moment. If no index is provided, it returns the current moment's start index. ```APIDOC ## baseEvernodeClient.getMomentStartIndex(index) ### Description Get start index (timestamp) of the moment. ### Parameters #### Path Parameters - **index** (number) - Optional - [Optional] Index (timestamp) to get the moment start index. ### Returns - The index (timestamp) of the moment as a ‘number’. Returns the current moment’s start index (timestamp) if ledger index parameter is not given. ``` -------------------------------- ### Initialize and Use Evernode Clients Source: https://docs.evernode.org/en/latest/sdk/evernode/evernodekit/overview.html Require the Evernode package and initialize clients for interacting with Evernode networks. This example demonstrates setting the default network to testnet and logging the governor address. ```javascript const { EvernodeClient, HotPocketClient, HotPocketContract, EverPocketContract } = require('evernode'); async function main() { await EvernodeClient.Defaults.useNetwork('testnet'); governorAddress = EvernodeClient.Defaults.values.governorAddress; console.log('Governor address:', governorAddress); } main() ``` -------------------------------- ### Evernode Bootstrap Contract (C++) Source: https://docs.evernode.org/en/latest/sdk/hotpocket/examples.html A C++ example for bootstrapping an Evernode contract on the HotPocket platform. This serves as a foundational example for Evernode development. ```cpp #include class MyEvernodeContract : public hotpocket::EvernodeContract { public: MyEvernodeContract(hotpocket::Context* ctx) : hotpocket::EvernodeContract(ctx) {} virtual void initialize() override { // Initialization logic } virtual void handle_transaction(const hotpocket::Transaction& tx) override { // Transaction handling logic } }; // HotPocket entry point extern "C" void hotpocket_entry(hotpocket::Context* ctx) { hotpocket::register_contract(ctx); } ``` -------------------------------- ### Example C Contract Source: https://docs.evernode.org/en/latest/sdk/hotpocket/examples.html An example of a HotPocket contract written in C. This demonstrates how to implement smart contracts using C for the HotPocket platform. ```c #include int add(int a, int b) { return a + b; } // HotPocket contract entry point void hotpocket_entry(hotpocket_context_t* ctx) { // Example: register a function hotpocket_register_function(ctx, "add", add); } ``` -------------------------------- ### foundationClient.getMomentStartIndex Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Retrieves the start index (timestamp) of a moment. If no index is provided, it returns the current moment's start index. This method is part of the FoundationClient. ```APIDOC ## foundationClient.getMomentStartIndex(index) ### Description Get start index (timestamp) of the moment. ### Parameters #### Path Parameters - **index** (number) - Optional - Index (timestamp) to get the moment start index. ### Returns The index (timestamp) of the moment as a ‘number’. Returns the current moment’s start index (timestamp) if ledger index parameter is not given. ``` -------------------------------- ### Deregister Evernode Host Source: https://docs.evernode.org/en/latest/hosts/maintenance.html Use this command to deregister an Evernode host. Ensure Evernode is not installed on the machine where you run this command if you are recovering EVRs from a failed installation. ```bash curl -fsSL https://raw.githubusercontent.com/EvernodeXRPL/evernode-resources/main/sashimono/installer/evernode.sh | sudo bash -s deregister ``` -------------------------------- ### Initialize HotPocket Files Source: https://docs.evernode.org/en/latest/sdk/hotpocket/tutorials/standalone.html Use this command to create the necessary HotPocket configuration and file structure within a specified volume. The container is temporary and removed upon completion. ```bash docker run --rm --privileged -v "${PWD}/mycontract":/mycontract evernode/hotpocket:latest-ubt.20.04-njs.20 new /mycontract/contract ``` -------------------------------- ### hostClient.offerLease Source: https://docs.evernode.org/en/latest/_sources/APIs/evernode-js-api.md.txt Creates a lease offer with specified details. This is an instance method of HostClient. ```APIDOC ## hostClient.offerLease(leaseIndex, leaseAmount, tosHash, outboundIPAddress) ### Description Create a lease offer. ### Method instance method of HostClient ### Parameters #### Path Parameters - **leaseIndex** (number) - Index number for the lease. - **leaseAmount** (number) - Amount (EVRs) of the lease offer. - **tosHash** (string) - Hex hash of the Terms Of Service text. - **outboundIPAddress** (string) - Optional. Assigned IP Address. Defaults to null. ``` -------------------------------- ### Acquire and Deploy Contract Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/evdevkit/overview.md.txt Combines acquiring an instance, bundling the contract, and deploying it to Evernode. Arguments are similar to acquire and deploy commands. ```bash evdevkit acquire-and-deploy -a ``` -------------------------------- ### baseEvernodeClient.getMomentStartIndex Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Retrieves the start index (timestamp) for a given moment. ```APIDOC ## baseEvernodeClient.getMomentStartIndex(index) ### Description Get the start index (timestamp) for the given moment. ### Method instance method of `BaseEvernodeClient` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Parameters * **index** (number) - Required - The moment (timestamp) for which to get the start index. ### Request Example ```javascript const startIndex = await client.getMomentStartIndex(1678886400); console.log('Start Index:', startIndex); ``` ### Response * **Returns** (number) - The start index (timestamp) of the given moment. ### Response Example ```json { "startIndex": 1678886000 } ``` ``` -------------------------------- ### MultiSigner.getSigner Source: https://docs.evernode.org/en/latest/_sources/APIs/everpocket-api.md.txt Get the signer. Retrieves the current signer information. ```APIDOC ## multiSigner.getSigner() ### Description Get the signer. ### Method Not specified (assumed to be a method call within a JavaScript context) ### Parameters None ### Response #### Success Response (200) - **signerInfo** (object) - Signer info. ``` -------------------------------- ### Acquire and Deploy Instance Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/deploy-single.md.txt Acquires and deploys an Evernode instance with a contract in a single command. Requires specifying contract directory, node executable, host Xahau address, and main script. ```bash evdevkit acquire-and-deploy $HOME/contract /usr/bin/node r9kCyGhhwGj3KaSGemFrrPVpXkzVtT2b1N -a index.js ``` -------------------------------- ### foundationClient.getMomentStartIndex(index) Source: https://docs.evernode.org/en/latest/_sources/APIs/evernode-js-api.md.txt Retrieves the start index (timestamp) for a given moment. ```APIDOC ## foundationClient.getMomentStartIndex(index) ### Description Get start index (timestamp) of the moment. ### Parameters #### Path Parameters - **index** (number) - Optional - Index (timestamp) to get the moment value. ### Returns The index (timestamp) of the moment as a 'number'. Returns the current moment's start index (timestamp) if ledger index parameter is not given. ``` -------------------------------- ### foundationClient.connect Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Connects the client to the XRPL server, loads configurations, and initiates subscriptions. This method is part of the FoundationClient. ```APIDOC ## foundationClient.connect() ### Description Connects the client to xrpl server and do the config loading and subscriptions. ‘subscribe’ is called inside this. ### Returns Boolean value `true` if the connection is successful. ``` -------------------------------- ### HostClient Constructor Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Initializes a new instance of the HostClient class. ```APIDOC ## new HostClient(xrpAddress, xrpSecret, [options]) ### Description Creates an instance of HostClient. ### Parameters #### Path Parameters - **xrpAddress** (string) - The XRP address to associate with this client. - **xrpSecret** (string) - The secret (private key) associated with the XRP address. - **options** (Object) - Optional - Additional configuration options for the HostClient. ``` -------------------------------- ### registryClient.getReputationInfoByAddress Source: https://docs.evernode.org/en/latest/_sources/APIs/evernode-js-api.md.txt Gets the general reputation information for a specified host address. ```APIDOC ## registryClient.getReputationInfoByAddress(hostsAddress) ### Description Gets the general reputation information for a specified host address. ### Method instance method of [RegistryClient](#RegistryClient) ### Parameters #### Path Parameters - **hostsAddress** (string) - Required - Host address. ### Response #### Success Response (200) - **Reputation info object** ``` -------------------------------- ### Start/Stop All HotPocket Nodes Source: https://docs.evernode.org/en/latest/sdk/hotpocket/hpdevkit/overview.html Commands to start or stop all nodes in the HotPocket cluster. ```bash hpdevkit start ``` ```bash hpdevkit stop ``` -------------------------------- ### hostClient.mintLease Source: https://docs.evernode.org/en/latest/_sources/APIs/evernode-js-api.md.txt Mints a lease offer with the provided parameters. This is an instance method of HostClient. ```APIDOC ## hostClient.mintLease(leaseIndex, leaseAmount, tosHash, outboundIPAddress) ### Description Mint a lease offer. ### Method instance method of HostClient ### Parameters #### Path Parameters - **leaseIndex** (number) - Index number for the lease. - **leaseAmount** (number) - Amount (EVRs) of the lease offer. - **tosHash** (string) - Hex hash of the Terms Of Service text. - **outboundIPAddress** (string) - Optional. Assigned IP Address. Defaults to null. ``` -------------------------------- ### evernodeContext.getCurMoment([options]) Source: https://docs.evernode.org/en/latest/APIs/everpocket-api.html Gets the current Evernode moment, with optional voting options. ```APIDOC ## evernodeContext.getCurMoment([options]) ### Description Get the current evernode moment. ### Method instance method of `EvernodeContext` ### Parameters #### Path Parameters - **options** (object) - Optional. Vote options to collect the current moment value. ### Returns The current moment value. ``` -------------------------------- ### XrplContext.getTransactionSubmissionInfo Source: https://docs.evernode.org/en/latest/_sources/APIs/everpocket-api.md.txt Gets information related to transaction submission, including options for decision making. ```APIDOC ## xrplContext.getTransactionSubmissionInfo([options], [decisionOptions]) ### Description Get transaction submission info. ### Parameters #### Path Parameters - **options** (object) - Optional - Options for transaction submission. - **decisionOptions** (object) - Optional - Options for decision making. ``` -------------------------------- ### Spawn and Sync a New Node Source: https://docs.evernode.org/en/latest/sdk/hotpocket/tutorials/instance-sync.html Simulates the creation of a new, blank node (node 4) with minimal information. It then displays the log output showing the node discovering the existing contract cluster and syncing with it, eventually becoming a clone. Note that the new node is not initially part of the cluster's UNL. ```bash hpdevkit spawn ``` ```text ... 20230527 00:58:59.212 [inf][hpc] Hpfs ldgr sync: Achieved target:54bad461 /primary/0 These are my cli args [ 'red', 'green', 'blue' ] I'm NOT in the UNL. My public key: edecee17cf622edfe35a6850c462ed86bde9952ecf2179d244f2fb1806b77903aa 20230527 00:59:00.646 [inf][hpc] ****Ledger created**** (lcl:15-a7ef4035 state:3c90183b patch:35968a27) These are my cli args [ 'red', 'green', 'blue' ] I'm NOT in the UNL. My public key: edecee17cf622edfe35a6850c462ed86bde9952ecf2179d244f2fb1806b77903aa ... ``` -------------------------------- ### evernodeContext.getEvernodeConfig Source: https://docs.evernode.org/en/latest/_sources/APIs/everpocket-api.md.txt Get evernode configuration. This method retrieves the current configuration settings for Evernode. ```APIDOC ## evernodeContext.getEvernodeConfig() ### Description Get evernode configuration. ### Method Not specified (Instance method) ### Endpoint Not specified ### Parameters None ### Response #### Success Response - The evernode configuration. ### Response Example Not specified ``` -------------------------------- ### heartbeatClient.connect() Source: https://docs.evernode.org/en/latest/APIs/evernode-js-api.html Connects the client to the XRPL server, loads configurations, and initiates subscriptions. Returns true if the connection is successful. ```APIDOC ## heartbeatClient.connect() ### Description Connects the client to xrpl server and do the config loading and subscriptions. ‘subscribe’ is called inside this. ### Returns Boolean value `true` if the connection is successful. ``` -------------------------------- ### getMomentStartIndex Source: https://docs.evernode.org/en/latest/_sources/APIs/evernode-js-api.md.txt Retrieves the starting index for a given moment. This can be useful for navigating or referencing ledger states. ```APIDOC ## getMomentStartIndex(index) ### Description Retrieves the starting index for a given moment. ### Method GET ### Endpoint /getMomentStartIndex/{index} ### Parameters #### Path Parameters - **index** (number) - Required - The index of the moment. ### Response #### Success Response (200) - **startIndex** (number) - The starting index for the specified moment. ``` -------------------------------- ### Reinstall Evernode After Transfer Source: https://docs.evernode.org/en/latest/_sources/hosts/maintenance.md.txt After initiating a host registration transfer, use this standard installation command on the new host. Provide the original host's Xahau account and secret when prompted. ```bash curl -fsSL https://raw.githubusercontent.com/EvernodeXRPL/evernode-resources/main/sashimono/installer/evernode.sh | sudo bash -s install ``` -------------------------------- ### xrplApi.getURITokenByIndex Source: https://docs.evernode.org/en/latest/_sources/APIs/evernode-js-api.md.txt Gets the URI token by index. This method retrieves a URI token based on its index. ```APIDOC ## xrplApi.getURITokenByIndex(index) ### Description Gets the URI token by index. ### Method Not specified (assumed to be a JavaScript method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **index** (string) - Required - The index of the URI token. ``` -------------------------------- ### Acquire Command Help Source: https://docs.evernode.org/en/latest/_sources/sdk/evernode/tutorials/deploy-single.md.txt Use this command to view supported options for the `acquire` command, such as specifying life moments. ```bash evdevkit acquire --help ```